diff --git a/e2e/errors_test.go b/e2e/errors_test.go index 5f226822a..df5e63a0c 100644 --- a/e2e/errors_test.go +++ b/e2e/errors_test.go @@ -21,8 +21,9 @@ import ( "testing" ) -//nolint:lll // error string cannot be split into multiple lines as is a // output from kubectl. +// +//nolint:lll // error string cannot be split into multiple lines as is a func TestGetStdErr(t *testing.T) { t.Parallel() tests := []struct { diff --git a/e2e/kms.go b/e2e/kms.go index 7cf1a74e0..7538446ae 100644 --- a/e2e/kms.go +++ b/e2e/kms.go @@ -122,8 +122,9 @@ func (vc *vaultConfig) canGetPassphrase() bool { // getPassphrase method will execute few commands to try read the secret for // specified key from inside the vault container: -// * authenticate with vault and ignore any stdout (we do not need output) -// * issue get request for particular key +// - authenticate with vault and ignore any stdout (we do not need output) +// - issue get request for particular key +// // resulting in stdOut (first entry in tuple) - output that contains the key // or stdErr (second entry in tuple) - error getting the key. func (vc *vaultConfig) getPassphrase(f *framework.Framework, key string) (string, string) { diff --git a/e2e/migration.go b/e2e/migration.go index 6802d981f..8fd7e42c3 100644 --- a/e2e/migration.go +++ b/e2e/migration.go @@ -30,6 +30,7 @@ import ( // composeIntreeMigVolID create a volID similar to intree migration volID // the migration volID format looks like below // mig-mons--image- +// //nolint:lll // ex: "mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-e0b45b52-7e09-47d3-8f1b-806995fa4412_706f6f6c5f7265706c6963615f706f6f6c func composeIntreeMigVolID(mons, rbdImageName string) string { poolField := hex.EncodeToString([]byte(defaultRBDPool)) diff --git a/e2e/rbd.go b/e2e/rbd.go index 7a629b617..13146f7d8 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -204,6 +204,7 @@ func checkGetKeyError(err error, stdErr string) bool { } // checkClusternameInMetadata check for cluster name metadata on RBD image. +// //nolint:nilerr // intentionally returning nil on error in the retry loop. func checkClusternameInMetadata(f *framework.Framework, ns, pool, image string) { t := time.Duration(deployTimeout) * time.Minute diff --git a/e2e/rbd_helper.go b/e2e/rbd_helper.go index c8175cf75..b9fc53604 100644 --- a/e2e/rbd_helper.go +++ b/e2e/rbd_helper.go @@ -75,6 +75,7 @@ var deepFlattenSupport = []util.KernelVersion{ // To use `io-timeout=0` we need // www.mail-archive.com/linux-block@vger.kernel.org/msg38060.html +// //nolint:gomnd // numbers specify Kernel versions. var nbdZeroIOtimeoutSupport = []util.KernelVersion{ { diff --git a/e2e/utils.go b/e2e/utils.go index 2e2798aca..de85a0142 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -1529,13 +1529,14 @@ func validateController( return deleteResource(rbdExamplePath + "storageclass.yaml") } -//nolint:deadcode,unused // Unused code will be used in future. // k8sVersionGreaterEquals checks the ServerVersion of the Kubernetes cluster // and compares it to the major.minor version passed. In case the version of // the cluster is equal or higher to major.minor, `true` is returned, `false` // otherwise. // If fetching the ServerVersion of the Kubernetes cluster fails, the calling // test case is marked as `FAILED` and gets aborted. +// +//nolint:deadcode,unused // Unused code will be used in future. func k8sVersionGreaterEquals(c kubernetes.Interface, major, minor int) bool { v, err := c.Discovery().ServerVersion() if err != nil { @@ -1681,6 +1682,7 @@ func retryKubectlFile(namespace string, action kubectlAction, filename string, t // retryKubectlArgs takes a namespace and action telling kubectl what to do // with the passed arguments. This function retries until no error occurred, or // the timeout passed. +// //nolint:unparam // retryKubectlArgs will be used with kubectlDelete arg later on. func retryKubectlArgs(namespace string, action kubectlAction, t int, args ...string) error { timeout := time.Duration(t) * time.Minute diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 80b24273e..873b8175c 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -241,6 +241,7 @@ func checkValidCreateVolumeRequest( } // CreateVolume creates a reservation and the volume in backend, if it is not already present. +// //nolint:gocognit,gocyclo,nestif,cyclop // TODO: reduce complexity func (cs *ControllerServer) CreateVolume( ctx context.Context, @@ -730,6 +731,7 @@ func (cs *ControllerServer) ControllerExpandVolume( // CreateSnapshot creates the snapshot in backend and stores metadata // in store +// //nolint:gocognit,gocyclo,cyclop // golangci-lint did not catch this earlier, needs to get fixed late func (cs *ControllerServer) CreateSnapshot( ctx context.Context, @@ -986,6 +988,7 @@ func (cs *ControllerServer) validateSnapshotReq(ctx context.Context, req *csi.Cr // DeleteSnapshot deletes the snapshot in backend and removes the // snapshot metadata from store. +// //nolint:gocyclo,cyclop // TODO: reduce complexity func (cs *ControllerServer) DeleteSnapshot( ctx context.Context, diff --git a/internal/cephfs/fuserecovery.go b/internal/cephfs/fuserecovery.go index ca66662a5..0b249b017 100644 --- a/internal/cephfs/fuserecovery.go +++ b/internal/cephfs/fuserecovery.go @@ -96,18 +96,18 @@ func validateFsType(mountpoint, fsType string, mis []mountutil.MountInfo) bool { // volume moutpoints inside the NodePublishVolume call. // // Restoration is performed in following steps: -// 1. Detection: staging target path must be a working mountpoint, and target -// path must not be a corrupted mountpoint (see getMountState()). If either -// of those checks fail, mount recovery is performed. -// 2. Recovery preconditions: -// * NodeStageMountinfo is present for this volume, -// * if staging target path and target path are mountpoints, they must be -// managed by ceph-fuse, -// * VolumeOptions.Mounter must evaluate to "fuse". -// 3. Recovery: -// * staging target path is unmounted and mounted again using ceph-fuse, -// * target path is only unmounted; NodePublishVolume is then expected to -// continue normally. +// 1. Detection: staging target path must be a working mountpoint, and target +// path must not be a corrupted mountpoint (see getMountState()). If either +// of those checks fail, mount recovery is performed. +// 2. Recovery preconditions: +// * NodeStageMountinfo is present for this volume, +// * if staging target path and target path are mountpoints, they must be +// managed by ceph-fuse, +// * VolumeOptions.Mounter must evaluate to "fuse". +// 3. Recovery: +// * staging target path is unmounted and mounted again using ceph-fuse, +// * target path is only unmounted; NodePublishVolume is then expected to +// continue normally. func (ns *NodeServer) tryRestoreFuseMountsInNodePublish( ctx context.Context, volID fsutil.VolumeID, diff --git a/internal/cephfs/store/volumeoptions.go b/internal/cephfs/store/volumeoptions.go index db63a90ea..1f97b7329 100644 --- a/internal/cephfs/store/volumeoptions.go +++ b/internal/cephfs/store/volumeoptions.go @@ -210,6 +210,7 @@ func fmtBackingSnapshotOptionMismatch(optName, expected, actual string) error { // NewVolumeOptions generates a new instance of volumeOptions from the provided // CSI request parameters. +// //nolint:gocyclo,cyclop // TODO: reduce complexity func NewVolumeOptions( ctx context.Context, @@ -348,6 +349,7 @@ func IsVolumeCreateRO(caps []*csi.VolumeCapability) bool { // newVolumeOptionsFromVolID generates a new instance of volumeOptions and VolumeIdentifier // from the provided CSI VolumeID. +// //nolint:gocyclo,cyclop // TODO: reduce complexity func NewVolumeOptionsFromVolID( ctx context.Context, diff --git a/internal/controller/controller.go b/internal/controller/controller.go index 7bc6e157d..f4ac810f4 100644 --- a/internal/controller/controller.go +++ b/internal/controller/controller.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/controller/persistentvolume/persistentvolume.go b/internal/controller/persistentvolume/persistentvolume.go index 96c21e150..4a3295d8b 100644 --- a/internal/controller/persistentvolume/persistentvolume.go +++ b/internal/controller/persistentvolume/persistentvolume.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/journal/voljournal.go b/internal/journal/voljournal.go index 7125a7370..9782159ac 100644 --- a/internal/journal/voljournal.go +++ b/internal/journal/voljournal.go @@ -279,9 +279,9 @@ NOTE: As the function manipulates omaps, it should be called with a lock against held, to prevent parallel operations from modifying the state of the omaps for this request name. Return values: - - ImageData: which contains the UUID,Pool,PoolID and ImageAttributes that were reserved for the - passed in reqName, empty if there was no reservation found - - error: non-nil in case of any errors + - ImageData: which contains the UUID,Pool,PoolID and ImageAttributes that were reserved for the + passed in reqName, empty if there was no reservation found + - error: non-nil in case of any errors */ func (conn *Connection) CheckReservation(ctx context.Context, journalPool, reqName, namePrefix, snapParentName, kmsConfig string, @@ -431,9 +431,9 @@ NOTE: As the function manipulates omaps, it should be called with a lock against held, to prevent parallel operations from modifying the state of the omaps for this request name. Input arguments: - - csiJournalPool: Pool name that holds the CSI request name based journal - - volJournalPool: Pool name that holds the image/subvolume and the per-image journal (may be - different if image is created in a topology constrained pool) + - csiJournalPool: Pool name that holds the CSI request name based journal + - volJournalPool: Pool name that holds the image/subvolume and the per-image journal (may be + different if image is created in a topology constrained pool) */ func (conn *Connection) UndoReservation(ctx context.Context, csiJournalPool, volJournalPool, volName, reqName string, @@ -537,24 +537,24 @@ NOTE: As the function manipulates omaps, it should be called with a lock against held, to prevent parallel operations from modifying the state of the omaps for this request name. Input arguments: - - journalPool: Pool where the CSI journal is stored (maybe different than the pool where the - image/subvolume is created due to topology constraints) - - journalPoolID: pool ID of the journalPool - - imagePool: Pool where the image/subvolume is created - - imagePoolID: pool ID of the imagePool - - reqName: Name of the volume request received - - namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-generated UUID) - - parentName: Name of the parent image/subvolume if reservation is for a snapshot (optional) - - kmsConf: Name of the key management service used to encrypt the image (optional) - - encryptionType: Type of encryption used when kmsConf is set (optional) - - volUUID: UUID need to be reserved instead of auto-generating one (this is useful for mirroring and metro-DR) - - owner: the owner of the volume (optional) - - backingSnapshotID: ID of the snapshot on which the CephFS snapshot-backed volume is based (optional) + - journalPool: Pool where the CSI journal is stored (maybe different than the pool where the + image/subvolume is created due to topology constraints) + - journalPoolID: pool ID of the journalPool + - imagePool: Pool where the image/subvolume is created + - imagePoolID: pool ID of the imagePool + - reqName: Name of the volume request received + - namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-generated UUID) + - parentName: Name of the parent image/subvolume if reservation is for a snapshot (optional) + - kmsConf: Name of the key management service used to encrypt the image (optional) + - encryptionType: Type of encryption used when kmsConf is set (optional) + - volUUID: UUID need to be reserved instead of auto-generating one (this is useful for mirroring and metro-DR) + - owner: the owner of the volume (optional) + - backingSnapshotID: ID of the snapshot on which the CephFS snapshot-backed volume is based (optional) Return values: - - string: Contains the UUID that was reserved for the passed in reqName - - string: Contains the image name that was reserved for the passed in reqName - - error: non-nil in case of any errors + - string: Contains the UUID that was reserved for the passed in reqName + - string: Contains the image name that was reserved for the passed in reqName + - error: non-nil in case of any errors */ func (conn *Connection) ReserveName(ctx context.Context, journalPool string, journalPoolID int64, diff --git a/internal/kms/kms.go b/internal/kms/kms.go index 82eadfd3e..dbe734fe1 100644 --- a/internal/kms/kms.go +++ b/internal/kms/kms.go @@ -61,11 +61,11 @@ var ( // GetKMS returns an instance of Key Management System. // -// - tenant is the owner of the Volume, used to fetch the Vault Token from the -// Kubernetes Namespace where the PVC lives -// - kmsID is the service name of the KMS configuration -// - secrets contain additional details, like TLS certificates to connect to -// the KMS +// - tenant is the owner of the Volume, used to fetch the Vault Token from the +// Kubernetes Namespace where the PVC lives +// - kmsID is the service name of the KMS configuration +// - secrets contain additional details, like TLS certificates to connect to +// the KMS func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, error) { if kmsID == "" || kmsID == DefaultKMSType { return GetDefaultKMS(secrets) diff --git a/internal/kms/vault_sa.go b/internal/kms/vault_sa.go index 6154877cb..a5361da73 100644 --- a/internal/kms/vault_sa.go +++ b/internal/kms/vault_sa.go @@ -44,29 +44,30 @@ ServiceAccount from the Tenant that owns the volume to store/retrieve the encryption passphrase of volumes. Example JSON structure in the KMS config is, -{ - "vault-tenant-sa": { - "encryptionKMSType": "vaulttenantsa", - "vaultAddress": "http://vault.default.svc.cluster.local:8200", - "vaultBackendPath": "secret/", - "vaultTLSServerName": "vault.default.svc.cluster.local", - "vaultCAFromSecret": "vault-ca", - "vaultClientCertFromSecret": "vault-client-cert", - "vaultClientCertKeyFromSecret": "vault-client-cert-key", - "vaultCAVerify": "false", - "tenantConfigName": "ceph-csi-kms-config", - "tenantSAName": "ceph-csi-vault-sa", - "tenants": { - "my-app": { - "vaultAddress": "https://vault.example.com", - "vaultCAVerify": "true" - }, - "an-other-app": { - "tenantSAName": "encryped-storage-sa" - } - }, - ... -}. + + { + "vault-tenant-sa": { + "encryptionKMSType": "vaulttenantsa", + "vaultAddress": "http://vault.default.svc.cluster.local:8200", + "vaultBackendPath": "secret/", + "vaultTLSServerName": "vault.default.svc.cluster.local", + "vaultCAFromSecret": "vault-ca", + "vaultClientCertFromSecret": "vault-client-cert", + "vaultClientCertKeyFromSecret": "vault-client-cert-key", + "vaultCAVerify": "false", + "tenantConfigName": "ceph-csi-kms-config", + "tenantSAName": "ceph-csi-vault-sa", + "tenants": { + "my-app": { + "vaultAddress": "https://vault.example.com", + "vaultCAVerify": "true" + }, + "an-other-app": { + "tenantSAName": "encryped-storage-sa" + } + }, + ... + }. */ type vaultTenantSA struct { vaultTenantConnection diff --git a/internal/kms/vault_tokens.go b/internal/kms/vault_tokens.go index eea2cf4b0..5f922b30c 100644 --- a/internal/kms/vault_tokens.go +++ b/internal/kms/vault_tokens.go @@ -160,30 +160,31 @@ VaultTokens represents a Hashicorp Vault KMS configuration that provides a Token per tenant. Example JSON structure in the KMS config is, -{ - "vault-with-tokens": { - "encryptionKMSType": "vaulttokens", - "vaultAddress": "http://vault.default.svc.cluster.local:8200", - "vaultBackend": "kv-v2", - "vaultBackendPath": "secret/", - "vaultTLSServerName": "vault.default.svc.cluster.local", - "vaultCAFromSecret": "vault-ca", - "vaultClientCertFromSecret": "vault-client-cert", - "vaultClientCertKeyFromSecret": "vault-client-cert-key", - "vaultCAVerify": "false", - "tenantConfigName": "ceph-csi-kms-config", - "tenantTokenName": "ceph-csi-kms-token", - "tenants": { - "my-app": { - "vaultAddress": "https://vault.example.com", - "vaultCAVerify": "true" - }, - "an-other-app": { - "tenantTokenName": "storage-encryption-token" - } - }, - ... -}. + + { + "vault-with-tokens": { + "encryptionKMSType": "vaulttokens", + "vaultAddress": "http://vault.default.svc.cluster.local:8200", + "vaultBackend": "kv-v2", + "vaultBackendPath": "secret/", + "vaultTLSServerName": "vault.default.svc.cluster.local", + "vaultCAFromSecret": "vault-ca", + "vaultClientCertFromSecret": "vault-client-cert", + "vaultClientCertKeyFromSecret": "vault-client-cert-key", + "vaultCAVerify": "false", + "tenantConfigName": "ceph-csi-kms-config", + "tenantTokenName": "ceph-csi-kms-token", + "tenants": { + "my-app": { + "vaultAddress": "https://vault.example.com", + "vaultCAVerify": "true" + }, + "an-other-app": { + "tenantTokenName": "storage-encryption-token" + } + }, + ... + }. */ type vaultTenantConnection struct { vaultConnection diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 3bbf952ed..72ead0f5e 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -1060,6 +1060,7 @@ func (cs *ControllerServer) ValidateVolumeCapabilities( } // CreateSnapshot creates the snapshot in backend and stores metadata in store. +// //nolint:gocyclo,cyclop // TODO: reduce complexity. func (cs *ControllerServer) CreateSnapshot( ctx context.Context, diff --git a/internal/rbd/migration_test.go b/internal/rbd/migration_test.go index a03f6a57a..0cb62c25d 100644 --- a/internal/rbd/migration_test.go +++ b/internal/rbd/migration_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/rbd/mirror.go b/internal/rbd/mirror.go index 0b6e5dc3d..4f6507614 100644 --- a/internal/rbd/mirror.go +++ b/internal/rbd/mirror.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 7798acf72..51b69f9e1 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -114,6 +114,7 @@ var ( // parseBoolOption checks if parameters contain option and parse it. If it is // empty or not set return default. +// //nolint:unparam // currently defValue is always false, this can change in the future func parseBoolOption(ctx context.Context, parameters map[string]string, optionName string, defValue bool) bool { boolVal := defValue diff --git a/internal/rbd/rbd_journal.go b/internal/rbd/rbd_journal.go index c9681060a..2570e3a0c 100644 --- a/internal/rbd/rbd_journal.go +++ b/internal/rbd/rbd_journal.go @@ -538,6 +538,7 @@ func undoVolReservation(ctx context.Context, rbdVol *rbdVolume, cr *util.Credent // Generate new volume Handler // The volume handler won't remain same as its contains poolID,clusterID etc // which are not same across clusters. +// //nolint:gocyclo,cyclop,nestif // TODO: reduce complexity func RegenerateJournal( volumeAttributes map[string]string, diff --git a/internal/rbd/snapshot.go b/internal/rbd/snapshot.go index e793d3e01..bb420475c 100644 --- a/internal/rbd/snapshot.go +++ b/internal/rbd/snapshot.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/util/credentials_test.go b/internal/util/credentials_test.go index 27c22dbc9..49368706e 100644 --- a/internal/util/credentials_test.go +++ b/internal/util/credentials_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/util/k8s/parameters.go b/internal/util/k8s/parameters.go index f212e3915..22d06afb7 100644 --- a/internal/util/k8s/parameters.go +++ b/internal/util/k8s/parameters.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/util/k8s/parameters_test.go b/internal/util/k8s/parameters_test.go index fa959b894..9a8baf46d 100644 --- a/internal/util/k8s/parameters_test.go +++ b/internal/util/k8s/parameters_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/util/util_test.go b/internal/util/util_test.go index 6e2e0a13d..d8ff37450 100644 --- a/internal/util/util_test.go +++ b/internal/util/util_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/util/volid.go b/internal/util/volid.go index f0b62ce41..01b8f3693 100644 --- a/internal/util/volid.go +++ b/internal/util/volid.go @@ -32,15 +32,15 @@ The CSI identifier is composed as elaborated in the comment against ComposeCSIID DecomposeCSIID is the inverse of the same function. The CSIIdentifier structure carries the following fields, -- LocationID: 64 bit integer identifier determining the location of the volume on the Ceph cluster. - It is the ID of the poolname or fsname, for RBD or CephFS backed volumes respectively. -- EncodingVersion: Carries the version number of the encoding scheme used to encode the CSI ID, - and is preserved for any future proofing w.r.t changes in the encoding scheme, and to retain - ability to parse backward compatible encodings. -- ClusterID: Is a unique ID per cluster that the CSI instance is serving and is restricted to - lengths that can be accommodated in the encoding scheme. -- ObjectUUID: Is the on-disk uuid of the object (image/snapshot) name, for the CSI volume that - corresponds to this CSI ID. + - LocationID: 64 bit integer identifier determining the location of the volume on the Ceph cluster. + It is the ID of the poolname or fsname, for RBD or CephFS backed volumes respectively. + - EncodingVersion: Carries the version number of the encoding scheme used to encode the CSI ID, + and is preserved for any future proofing w.r.t changes in the encoding scheme, and to retain + ability to parse backward compatible encodings. + - ClusterID: Is a unique ID per cluster that the CSI instance is serving and is restricted to + lengths that can be accommodated in the encoding scheme. + - ObjectUUID: Is the on-disk uuid of the object (image/snapshot) name, for the CSI volume that + corresponds to this CSI ID. */ type CSIIdentifier struct { LocationID int64 @@ -60,6 +60,7 @@ const ( /* ComposeCSIID composes a CSI ID from passed in parameters. Version 1 of the encoding scheme is as follows, + [csi_id_version=1:4byte] + [-:1byte] [length of clusterID=1:4byte] + [-:1byte] [clusterID:36bytes (MAX)] + [-:1byte]