mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
journal: remove SetCSIDirectorySuffix to simplify journal creation
The function SetCSIDirectorySuffix was used only one per (long-lived, gloabl) journal object. It is simpler to construct the journal objects with this needed parameter: 1. As it is required to function and non-optional AFAICT 2. Removes the temptation to mutate global object 3. Reduces LOC with exact same functionality 4. SetCSIDirectorySuffix would not behave correctly if called a 2nd time anyway. Point 4. means that if you called the function twice to change the suffix when you previously had "csi.volumes.alice", you'd get "csi.volumes.alice.bob" instead of "csi.volumes.bob" what one would expect. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
b065726f19
commit
78a6de2bd0
@ -109,11 +109,8 @@ func (fs *Driver) Run(conf *util.Config, cachePersister util.CachePersister) {
|
||||
if conf.InstanceID != "" {
|
||||
CSIInstanceID = conf.InstanceID
|
||||
}
|
||||
// Get an instance of the volume journal
|
||||
volJournal = journal.NewCSIVolumeJournal()
|
||||
|
||||
// Update keys with CSI instance suffix
|
||||
volJournal.SetCSIDirectorySuffix(CSIInstanceID)
|
||||
// Create an instance of the volume journal
|
||||
volJournal = journal.NewCSIVolumeJournal(CSIInstanceID)
|
||||
|
||||
// Update namespace for storing keys into a specific namespace on RADOS, in the CephFS
|
||||
// metadata pool
|
||||
|
Reference in New Issue
Block a user