From 8dea42a6240232450a2b8dd5e0574c9ca7445fdc Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 14 May 2020 14:04:13 -0400 Subject: [PATCH] journal: rename CSIJournal to Config This better reflects what it actually does now. Signed-off-by: John Mulligan --- internal/cephfs/driver.go | 2 +- internal/journal/voljournal.go | 18 +++++++++--------- internal/rbd/driver.go | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/cephfs/driver.go b/internal/cephfs/driver.go index ccc4d6223..5207ad987 100644 --- a/internal/cephfs/driver.go +++ b/internal/cephfs/driver.go @@ -56,7 +56,7 @@ var ( // volJournal is used to maintain RADOS based journals for CO generated // VolumeName to backing CephFS subvolumes - volJournal *journal.CSIJournal + volJournal *journal.Config ) // NewDriver returns new ceph driver diff --git a/internal/journal/voljournal.go b/internal/journal/voljournal.go index 2f2581ff0..742941746 100644 --- a/internal/journal/voljournal.go +++ b/internal/journal/voljournal.go @@ -112,7 +112,7 @@ const ( ) // CSIJournal defines the interface and the required key names for the above RADOS based OMaps -type CSIJournal struct { +type Config struct { // csiDirectory is the name of the CSI volumes object map that contains CSI volume-name (or // snapshot name) based keys csiDirectory string @@ -147,8 +147,8 @@ type CSIJournal struct { } // NewCSIVolumeJournal returns an instance of CSIJournal for volumes -func NewCSIVolumeJournal(suffix string) *CSIJournal { - return &CSIJournal{ +func NewCSIVolumeJournal(suffix string) *Config { + return &Config{ csiDirectory: "csi.volumes." + suffix, csiNameKeyPrefix: "csi.volume.", cephUUIDDirectoryPrefix: "csi.volume.", @@ -162,8 +162,8 @@ func NewCSIVolumeJournal(suffix string) *CSIJournal { } // NewCSISnapshotJournal returns an instance of CSIJournal for snapshots -func NewCSISnapshotJournal(suffix string) *CSIJournal { - return &CSIJournal{ +func NewCSISnapshotJournal(suffix string) *Config { + return &Config{ csiDirectory: "csi.snaps." + suffix, csiNameKeyPrefix: "csi.snap.", cephUUIDDirectoryPrefix: "csi.snap.", @@ -178,14 +178,14 @@ func NewCSISnapshotJournal(suffix string) *CSIJournal { // NewCSIVolumeJournalWithNamespace returns an instance of CSIJournal for // volumes using a predetermined namespace value. -func NewCSIVolumeJournalWithNamespace(suffix, ns string) *CSIJournal { +func NewCSIVolumeJournalWithNamespace(suffix, ns string) *Config { j := NewCSIVolumeJournal(suffix) j.namespace = ns return j } // GetNameForUUID returns volume name -func (cj *CSIJournal) GetNameForUUID(prefix, uid string, isSnapshot bool) string { +func (cj *Config) GetNameForUUID(prefix, uid string, isSnapshot bool) string { if prefix == "" { if isSnapshot { prefix = defaultSnapshotNamingPrefix @@ -207,14 +207,14 @@ type ImageData struct { // Connection represents a real or virtual connection to a ceph cluster // that can make changes to the journal(s). type Connection struct { - config *CSIJournal + config *Config // connection metadata monitors string cr *util.Credentials } // Connect establishes a new connection to a ceph cluster for journal metadata. -func (cj *CSIJournal) Connect(monitors string, cr *util.Credentials) (*Connection, error) { +func (cj *Config) Connect(monitors string, cr *util.Credentials) (*Connection, error) { conn := &Connection{ config: cj, monitors: monitors, diff --git a/internal/rbd/driver.go b/internal/rbd/driver.go index 04e8cd029..7117f872b 100644 --- a/internal/rbd/driver.go +++ b/internal/rbd/driver.go @@ -51,8 +51,8 @@ var ( // volJournal and snapJournal are used to maintain RADOS based journals for CO generated // VolumeName to backing RBD images - volJournal *journal.CSIJournal - snapJournal *journal.CSIJournal + volJournal *journal.Config + snapJournal *journal.Config ) // NewDriver returns new rbd driver