journal: rename CSIJournal to Config

This better reflects what it actually does now.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-05-14 14:04:13 -04:00 committed by mergify[bot]
parent 52603d595a
commit 8dea42a624
3 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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,

View File

@ -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