mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-21 22:00:19 +00:00
build: address gofmt
warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
a6c14c051f
commit
9201da0502
@ -21,8 +21,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint:lll // error string cannot be split into multiple lines as is a
|
|
||||||
// output from kubectl.
|
// output from kubectl.
|
||||||
|
//
|
||||||
|
//nolint:lll // error string cannot be split into multiple lines as is a
|
||||||
func TestGetStdErr(t *testing.T) {
|
func TestGetStdErr(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
|
@ -122,8 +122,9 @@ func (vc *vaultConfig) canGetPassphrase() bool {
|
|||||||
|
|
||||||
// getPassphrase method will execute few commands to try read the secret for
|
// getPassphrase method will execute few commands to try read the secret for
|
||||||
// specified key from inside the vault container:
|
// specified key from inside the vault container:
|
||||||
// * authenticate with vault and ignore any stdout (we do not need output)
|
// - authenticate with vault and ignore any stdout (we do not need output)
|
||||||
// * issue get request for particular key
|
// - issue get request for particular key
|
||||||
|
//
|
||||||
// resulting in stdOut (first entry in tuple) - output that contains the key
|
// resulting in stdOut (first entry in tuple) - output that contains the key
|
||||||
// or stdErr (second entry in tuple) - error getting the key.
|
// or stdErr (second entry in tuple) - error getting the key.
|
||||||
func (vc *vaultConfig) getPassphrase(f *framework.Framework, key string) (string, string) {
|
func (vc *vaultConfig) getPassphrase(f *framework.Framework, key string) (string, string) {
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
// composeIntreeMigVolID create a volID similar to intree migration volID
|
// composeIntreeMigVolID create a volID similar to intree migration volID
|
||||||
// the migration volID format looks like below
|
// the migration volID format looks like below
|
||||||
// mig-mons-<hash>-image-<UUID_<poolhash>
|
// mig-mons-<hash>-image-<UUID_<poolhash>
|
||||||
|
//
|
||||||
//nolint:lll // ex: "mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-e0b45b52-7e09-47d3-8f1b-806995fa4412_706f6f6c5f7265706c6963615f706f6f6c
|
//nolint:lll // ex: "mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-e0b45b52-7e09-47d3-8f1b-806995fa4412_706f6f6c5f7265706c6963615f706f6f6c
|
||||||
func composeIntreeMigVolID(mons, rbdImageName string) string {
|
func composeIntreeMigVolID(mons, rbdImageName string) string {
|
||||||
poolField := hex.EncodeToString([]byte(defaultRBDPool))
|
poolField := hex.EncodeToString([]byte(defaultRBDPool))
|
||||||
|
@ -204,6 +204,7 @@ func checkGetKeyError(err error, stdErr string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// checkClusternameInMetadata check for cluster name metadata on RBD image.
|
// checkClusternameInMetadata check for cluster name metadata on RBD image.
|
||||||
|
//
|
||||||
//nolint:nilerr // intentionally returning nil on error in the retry loop.
|
//nolint:nilerr // intentionally returning nil on error in the retry loop.
|
||||||
func checkClusternameInMetadata(f *framework.Framework, ns, pool, image string) {
|
func checkClusternameInMetadata(f *framework.Framework, ns, pool, image string) {
|
||||||
t := time.Duration(deployTimeout) * time.Minute
|
t := time.Duration(deployTimeout) * time.Minute
|
||||||
|
@ -75,6 +75,7 @@ var deepFlattenSupport = []util.KernelVersion{
|
|||||||
|
|
||||||
// To use `io-timeout=0` we need
|
// To use `io-timeout=0` we need
|
||||||
// www.mail-archive.com/linux-block@vger.kernel.org/msg38060.html
|
// www.mail-archive.com/linux-block@vger.kernel.org/msg38060.html
|
||||||
|
//
|
||||||
//nolint:gomnd // numbers specify Kernel versions.
|
//nolint:gomnd // numbers specify Kernel versions.
|
||||||
var nbdZeroIOtimeoutSupport = []util.KernelVersion{
|
var nbdZeroIOtimeoutSupport = []util.KernelVersion{
|
||||||
{
|
{
|
||||||
|
@ -1529,13 +1529,14 @@ func validateController(
|
|||||||
return deleteResource(rbdExamplePath + "storageclass.yaml")
|
return deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:deadcode,unused // Unused code will be used in future.
|
|
||||||
// k8sVersionGreaterEquals checks the ServerVersion of the Kubernetes cluster
|
// k8sVersionGreaterEquals checks the ServerVersion of the Kubernetes cluster
|
||||||
// and compares it to the major.minor version passed. In case the version of
|
// 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`
|
// the cluster is equal or higher to major.minor, `true` is returned, `false`
|
||||||
// otherwise.
|
// otherwise.
|
||||||
// If fetching the ServerVersion of the Kubernetes cluster fails, the calling
|
// If fetching the ServerVersion of the Kubernetes cluster fails, the calling
|
||||||
// test case is marked as `FAILED` and gets aborted.
|
// 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 {
|
func k8sVersionGreaterEquals(c kubernetes.Interface, major, minor int) bool {
|
||||||
v, err := c.Discovery().ServerVersion()
|
v, err := c.Discovery().ServerVersion()
|
||||||
if err != nil {
|
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
|
// retryKubectlArgs takes a namespace and action telling kubectl what to do
|
||||||
// with the passed arguments. This function retries until no error occurred, or
|
// with the passed arguments. This function retries until no error occurred, or
|
||||||
// the timeout passed.
|
// the timeout passed.
|
||||||
|
//
|
||||||
//nolint:unparam // retryKubectlArgs will be used with kubectlDelete arg later on.
|
//nolint:unparam // retryKubectlArgs will be used with kubectlDelete arg later on.
|
||||||
func retryKubectlArgs(namespace string, action kubectlAction, t int, args ...string) error {
|
func retryKubectlArgs(namespace string, action kubectlAction, t int, args ...string) error {
|
||||||
timeout := time.Duration(t) * time.Minute
|
timeout := time.Duration(t) * time.Minute
|
||||||
|
@ -241,6 +241,7 @@ func checkValidCreateVolumeRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateVolume creates a reservation and the volume in backend, if it is not already present.
|
// CreateVolume creates a reservation and the volume in backend, if it is not already present.
|
||||||
|
//
|
||||||
//nolint:gocognit,gocyclo,nestif,cyclop // TODO: reduce complexity
|
//nolint:gocognit,gocyclo,nestif,cyclop // TODO: reduce complexity
|
||||||
func (cs *ControllerServer) CreateVolume(
|
func (cs *ControllerServer) CreateVolume(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -730,6 +731,7 @@ func (cs *ControllerServer) ControllerExpandVolume(
|
|||||||
|
|
||||||
// CreateSnapshot creates the snapshot in backend and stores metadata
|
// CreateSnapshot creates the snapshot in backend and stores metadata
|
||||||
// in store
|
// in store
|
||||||
|
//
|
||||||
//nolint:gocognit,gocyclo,cyclop // golangci-lint did not catch this earlier, needs to get fixed late
|
//nolint:gocognit,gocyclo,cyclop // golangci-lint did not catch this earlier, needs to get fixed late
|
||||||
func (cs *ControllerServer) CreateSnapshot(
|
func (cs *ControllerServer) CreateSnapshot(
|
||||||
ctx context.Context,
|
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
|
// DeleteSnapshot deletes the snapshot in backend and removes the
|
||||||
// snapshot metadata from store.
|
// snapshot metadata from store.
|
||||||
|
//
|
||||||
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
||||||
func (cs *ControllerServer) DeleteSnapshot(
|
func (cs *ControllerServer) DeleteSnapshot(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
@ -96,18 +96,18 @@ func validateFsType(mountpoint, fsType string, mis []mountutil.MountInfo) bool {
|
|||||||
// volume moutpoints inside the NodePublishVolume call.
|
// volume moutpoints inside the NodePublishVolume call.
|
||||||
//
|
//
|
||||||
// Restoration is performed in following steps:
|
// Restoration is performed in following steps:
|
||||||
// 1. Detection: staging target path must be a working mountpoint, and target
|
// 1. Detection: staging target path must be a working mountpoint, and target
|
||||||
// path must not be a corrupted mountpoint (see getMountState()). If either
|
// path must not be a corrupted mountpoint (see getMountState()). If either
|
||||||
// of those checks fail, mount recovery is performed.
|
// of those checks fail, mount recovery is performed.
|
||||||
// 2. Recovery preconditions:
|
// 2. Recovery preconditions:
|
||||||
// * NodeStageMountinfo is present for this volume,
|
// * NodeStageMountinfo is present for this volume,
|
||||||
// * if staging target path and target path are mountpoints, they must be
|
// * if staging target path and target path are mountpoints, they must be
|
||||||
// managed by ceph-fuse,
|
// managed by ceph-fuse,
|
||||||
// * VolumeOptions.Mounter must evaluate to "fuse".
|
// * VolumeOptions.Mounter must evaluate to "fuse".
|
||||||
// 3. Recovery:
|
// 3. Recovery:
|
||||||
// * staging target path is unmounted and mounted again using ceph-fuse,
|
// * staging target path is unmounted and mounted again using ceph-fuse,
|
||||||
// * target path is only unmounted; NodePublishVolume is then expected to
|
// * target path is only unmounted; NodePublishVolume is then expected to
|
||||||
// continue normally.
|
// continue normally.
|
||||||
func (ns *NodeServer) tryRestoreFuseMountsInNodePublish(
|
func (ns *NodeServer) tryRestoreFuseMountsInNodePublish(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
volID fsutil.VolumeID,
|
volID fsutil.VolumeID,
|
||||||
|
@ -210,6 +210,7 @@ func fmtBackingSnapshotOptionMismatch(optName, expected, actual string) error {
|
|||||||
|
|
||||||
// NewVolumeOptions generates a new instance of volumeOptions from the provided
|
// NewVolumeOptions generates a new instance of volumeOptions from the provided
|
||||||
// CSI request parameters.
|
// CSI request parameters.
|
||||||
|
//
|
||||||
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
||||||
func NewVolumeOptions(
|
func NewVolumeOptions(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -348,6 +349,7 @@ func IsVolumeCreateRO(caps []*csi.VolumeCapability) bool {
|
|||||||
|
|
||||||
// newVolumeOptionsFromVolID generates a new instance of volumeOptions and VolumeIdentifier
|
// newVolumeOptionsFromVolID generates a new instance of volumeOptions and VolumeIdentifier
|
||||||
// from the provided CSI VolumeID.
|
// from the provided CSI VolumeID.
|
||||||
|
//
|
||||||
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
//nolint:gocyclo,cyclop // TODO: reduce complexity
|
||||||
func NewVolumeOptionsFromVolID(
|
func NewVolumeOptionsFromVolID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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.
|
held, to prevent parallel operations from modifying the state of the omaps for this request name.
|
||||||
|
|
||||||
Return values:
|
Return values:
|
||||||
- ImageData: which contains the UUID,Pool,PoolID and ImageAttributes that were reserved for the
|
- ImageData: which contains the UUID,Pool,PoolID and ImageAttributes that were reserved for the
|
||||||
passed in reqName, empty if there was no reservation found
|
passed in reqName, empty if there was no reservation found
|
||||||
- error: non-nil in case of any errors
|
- error: non-nil in case of any errors
|
||||||
*/
|
*/
|
||||||
func (conn *Connection) CheckReservation(ctx context.Context,
|
func (conn *Connection) CheckReservation(ctx context.Context,
|
||||||
journalPool, reqName, namePrefix, snapParentName, kmsConfig string,
|
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.
|
held, to prevent parallel operations from modifying the state of the omaps for this request name.
|
||||||
|
|
||||||
Input arguments:
|
Input arguments:
|
||||||
- csiJournalPool: Pool name that holds the CSI request name based journal
|
- 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
|
- 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)
|
different if image is created in a topology constrained pool)
|
||||||
*/
|
*/
|
||||||
func (conn *Connection) UndoReservation(ctx context.Context,
|
func (conn *Connection) UndoReservation(ctx context.Context,
|
||||||
csiJournalPool, volJournalPool, volName, reqName string,
|
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.
|
held, to prevent parallel operations from modifying the state of the omaps for this request name.
|
||||||
|
|
||||||
Input arguments:
|
Input arguments:
|
||||||
- journalPool: Pool where the CSI journal is stored (maybe different than the pool where the
|
- journalPool: Pool where the CSI journal is stored (maybe different than the pool where the
|
||||||
image/subvolume is created due to topology constraints)
|
image/subvolume is created due to topology constraints)
|
||||||
- journalPoolID: pool ID of the journalPool
|
- journalPoolID: pool ID of the journalPool
|
||||||
- imagePool: Pool where the image/subvolume is created
|
- imagePool: Pool where the image/subvolume is created
|
||||||
- imagePoolID: pool ID of the imagePool
|
- imagePoolID: pool ID of the imagePool
|
||||||
- reqName: Name of the volume request received
|
- reqName: Name of the volume request received
|
||||||
- namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-generated UUID)
|
- 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)
|
- 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)
|
- kmsConf: Name of the key management service used to encrypt the image (optional)
|
||||||
- encryptionType: Type of encryption used when kmsConf is set (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)
|
- 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)
|
- owner: the owner of the volume (optional)
|
||||||
- backingSnapshotID: ID of the snapshot on which the CephFS snapshot-backed volume is based (optional)
|
- backingSnapshotID: ID of the snapshot on which the CephFS snapshot-backed volume is based (optional)
|
||||||
|
|
||||||
Return values:
|
Return values:
|
||||||
- string: Contains the UUID that was reserved for the passed in reqName
|
- 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
|
- string: Contains the image name that was reserved for the passed in reqName
|
||||||
- error: non-nil in case of any errors
|
- error: non-nil in case of any errors
|
||||||
*/
|
*/
|
||||||
func (conn *Connection) ReserveName(ctx context.Context,
|
func (conn *Connection) ReserveName(ctx context.Context,
|
||||||
journalPool string, journalPoolID int64,
|
journalPool string, journalPoolID int64,
|
||||||
|
@ -61,11 +61,11 @@ var (
|
|||||||
|
|
||||||
// GetKMS returns an instance of Key Management System.
|
// GetKMS returns an instance of Key Management System.
|
||||||
//
|
//
|
||||||
// - tenant is the owner of the Volume, used to fetch the Vault Token from the
|
// - tenant is the owner of the Volume, used to fetch the Vault Token from the
|
||||||
// Kubernetes Namespace where the PVC lives
|
// Kubernetes Namespace where the PVC lives
|
||||||
// - kmsID is the service name of the KMS configuration
|
// - kmsID is the service name of the KMS configuration
|
||||||
// - secrets contain additional details, like TLS certificates to connect to
|
// - secrets contain additional details, like TLS certificates to connect to
|
||||||
// the KMS
|
// the KMS
|
||||||
func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, error) {
|
func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, error) {
|
||||||
if kmsID == "" || kmsID == DefaultKMSType {
|
if kmsID == "" || kmsID == DefaultKMSType {
|
||||||
return GetDefaultKMS(secrets)
|
return GetDefaultKMS(secrets)
|
||||||
|
@ -44,29 +44,30 @@ ServiceAccount from the Tenant that owns the volume to store/retrieve the
|
|||||||
encryption passphrase of volumes.
|
encryption passphrase of volumes.
|
||||||
|
|
||||||
Example JSON structure in the KMS config is,
|
Example JSON structure in the KMS config is,
|
||||||
{
|
|
||||||
"vault-tenant-sa": {
|
{
|
||||||
"encryptionKMSType": "vaulttenantsa",
|
"vault-tenant-sa": {
|
||||||
"vaultAddress": "http://vault.default.svc.cluster.local:8200",
|
"encryptionKMSType": "vaulttenantsa",
|
||||||
"vaultBackendPath": "secret/",
|
"vaultAddress": "http://vault.default.svc.cluster.local:8200",
|
||||||
"vaultTLSServerName": "vault.default.svc.cluster.local",
|
"vaultBackendPath": "secret/",
|
||||||
"vaultCAFromSecret": "vault-ca",
|
"vaultTLSServerName": "vault.default.svc.cluster.local",
|
||||||
"vaultClientCertFromSecret": "vault-client-cert",
|
"vaultCAFromSecret": "vault-ca",
|
||||||
"vaultClientCertKeyFromSecret": "vault-client-cert-key",
|
"vaultClientCertFromSecret": "vault-client-cert",
|
||||||
"vaultCAVerify": "false",
|
"vaultClientCertKeyFromSecret": "vault-client-cert-key",
|
||||||
"tenantConfigName": "ceph-csi-kms-config",
|
"vaultCAVerify": "false",
|
||||||
"tenantSAName": "ceph-csi-vault-sa",
|
"tenantConfigName": "ceph-csi-kms-config",
|
||||||
"tenants": {
|
"tenantSAName": "ceph-csi-vault-sa",
|
||||||
"my-app": {
|
"tenants": {
|
||||||
"vaultAddress": "https://vault.example.com",
|
"my-app": {
|
||||||
"vaultCAVerify": "true"
|
"vaultAddress": "https://vault.example.com",
|
||||||
},
|
"vaultCAVerify": "true"
|
||||||
"an-other-app": {
|
},
|
||||||
"tenantSAName": "encryped-storage-sa"
|
"an-other-app": {
|
||||||
}
|
"tenantSAName": "encryped-storage-sa"
|
||||||
},
|
}
|
||||||
...
|
},
|
||||||
}.
|
...
|
||||||
|
}.
|
||||||
*/
|
*/
|
||||||
type vaultTenantSA struct {
|
type vaultTenantSA struct {
|
||||||
vaultTenantConnection
|
vaultTenantConnection
|
||||||
|
@ -160,30 +160,31 @@ VaultTokens represents a Hashicorp Vault KMS configuration that provides a
|
|||||||
Token per tenant.
|
Token per tenant.
|
||||||
|
|
||||||
Example JSON structure in the KMS config is,
|
Example JSON structure in the KMS config is,
|
||||||
{
|
|
||||||
"vault-with-tokens": {
|
{
|
||||||
"encryptionKMSType": "vaulttokens",
|
"vault-with-tokens": {
|
||||||
"vaultAddress": "http://vault.default.svc.cluster.local:8200",
|
"encryptionKMSType": "vaulttokens",
|
||||||
"vaultBackend": "kv-v2",
|
"vaultAddress": "http://vault.default.svc.cluster.local:8200",
|
||||||
"vaultBackendPath": "secret/",
|
"vaultBackend": "kv-v2",
|
||||||
"vaultTLSServerName": "vault.default.svc.cluster.local",
|
"vaultBackendPath": "secret/",
|
||||||
"vaultCAFromSecret": "vault-ca",
|
"vaultTLSServerName": "vault.default.svc.cluster.local",
|
||||||
"vaultClientCertFromSecret": "vault-client-cert",
|
"vaultCAFromSecret": "vault-ca",
|
||||||
"vaultClientCertKeyFromSecret": "vault-client-cert-key",
|
"vaultClientCertFromSecret": "vault-client-cert",
|
||||||
"vaultCAVerify": "false",
|
"vaultClientCertKeyFromSecret": "vault-client-cert-key",
|
||||||
"tenantConfigName": "ceph-csi-kms-config",
|
"vaultCAVerify": "false",
|
||||||
"tenantTokenName": "ceph-csi-kms-token",
|
"tenantConfigName": "ceph-csi-kms-config",
|
||||||
"tenants": {
|
"tenantTokenName": "ceph-csi-kms-token",
|
||||||
"my-app": {
|
"tenants": {
|
||||||
"vaultAddress": "https://vault.example.com",
|
"my-app": {
|
||||||
"vaultCAVerify": "true"
|
"vaultAddress": "https://vault.example.com",
|
||||||
},
|
"vaultCAVerify": "true"
|
||||||
"an-other-app": {
|
},
|
||||||
"tenantTokenName": "storage-encryption-token"
|
"an-other-app": {
|
||||||
}
|
"tenantTokenName": "storage-encryption-token"
|
||||||
},
|
}
|
||||||
...
|
},
|
||||||
}.
|
...
|
||||||
|
}.
|
||||||
*/
|
*/
|
||||||
type vaultTenantConnection struct {
|
type vaultTenantConnection struct {
|
||||||
vaultConnection
|
vaultConnection
|
||||||
|
@ -1060,6 +1060,7 @@ func (cs *ControllerServer) ValidateVolumeCapabilities(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateSnapshot creates the snapshot in backend and stores metadata in store.
|
// CreateSnapshot creates the snapshot in backend and stores metadata in store.
|
||||||
|
//
|
||||||
//nolint:gocyclo,cyclop // TODO: reduce complexity.
|
//nolint:gocyclo,cyclop // TODO: reduce complexity.
|
||||||
func (cs *ControllerServer) CreateSnapshot(
|
func (cs *ControllerServer) CreateSnapshot(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -114,6 +114,7 @@ var (
|
|||||||
|
|
||||||
// parseBoolOption checks if parameters contain option and parse it. If it is
|
// parseBoolOption checks if parameters contain option and parse it. If it is
|
||||||
// empty or not set return default.
|
// empty or not set return default.
|
||||||
|
//
|
||||||
//nolint:unparam // currently defValue is always false, this can change in the future
|
//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 {
|
func parseBoolOption(ctx context.Context, parameters map[string]string, optionName string, defValue bool) bool {
|
||||||
boolVal := defValue
|
boolVal := defValue
|
||||||
|
@ -538,6 +538,7 @@ func undoVolReservation(ctx context.Context, rbdVol *rbdVolume, cr *util.Credent
|
|||||||
// Generate new volume Handler
|
// Generate new volume Handler
|
||||||
// The volume handler won't remain same as its contains poolID,clusterID etc
|
// The volume handler won't remain same as its contains poolID,clusterID etc
|
||||||
// which are not same across clusters.
|
// which are not same across clusters.
|
||||||
|
//
|
||||||
//nolint:gocyclo,cyclop,nestif // TODO: reduce complexity
|
//nolint:gocyclo,cyclop,nestif // TODO: reduce complexity
|
||||||
func RegenerateJournal(
|
func RegenerateJournal(
|
||||||
volumeAttributes map[string]string,
|
volumeAttributes map[string]string,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -32,15 +32,15 @@ The CSI identifier is composed as elaborated in the comment against ComposeCSIID
|
|||||||
DecomposeCSIID is the inverse of the same function.
|
DecomposeCSIID is the inverse of the same function.
|
||||||
|
|
||||||
The CSIIdentifier structure carries the following fields,
|
The CSIIdentifier structure carries the following fields,
|
||||||
- LocationID: 64 bit integer identifier determining the location of the volume on the Ceph cluster.
|
- 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.
|
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,
|
- 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
|
and is preserved for any future proofing w.r.t changes in the encoding scheme, and to retain
|
||||||
ability to parse backward compatible encodings.
|
ability to parse backward compatible encodings.
|
||||||
- ClusterID: Is a unique ID per cluster that the CSI instance is serving and is restricted to
|
- 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.
|
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
|
- ObjectUUID: Is the on-disk uuid of the object (image/snapshot) name, for the CSI volume that
|
||||||
corresponds to this CSI ID.
|
corresponds to this CSI ID.
|
||||||
*/
|
*/
|
||||||
type CSIIdentifier struct {
|
type CSIIdentifier struct {
|
||||||
LocationID int64
|
LocationID int64
|
||||||
@ -60,6 +60,7 @@ const (
|
|||||||
/*
|
/*
|
||||||
ComposeCSIID composes a CSI ID from passed in parameters.
|
ComposeCSIID composes a CSI ID from passed in parameters.
|
||||||
Version 1 of the encoding scheme is as follows,
|
Version 1 of the encoding scheme is as follows,
|
||||||
|
|
||||||
[csi_id_version=1:4byte] + [-:1byte]
|
[csi_id_version=1:4byte] + [-:1byte]
|
||||||
[length of clusterID=1:4byte] + [-:1byte]
|
[length of clusterID=1:4byte] + [-:1byte]
|
||||||
[clusterID:36bytes (MAX)] + [-:1byte]
|
[clusterID:36bytes (MAX)] + [-:1byte]
|
||||||
|
Loading…
Reference in New Issue
Block a user