diff --git a/pkg/sidecar-controller/groupsnapshot_helper.go b/pkg/sidecar-controller/groupsnapshot_helper.go index 053c842ae..45d49106e 100644 --- a/pkg/sidecar-controller/groupsnapshot_helper.go +++ b/pkg/sidecar-controller/groupsnapshot_helper.go @@ -756,7 +756,7 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateGroupSnapshotContentStat return groupSnapshotContent, fmt.Errorf("failed to get group snapshot class %s for group snapshot content %s: %v", *groupSnapshotContent.Spec.VolumeGroupSnapshotClassName, groupSnapshotContent.Name, err) } - groupSnapshotSecretRef, err := utils.GetGroupSnapshotSecretReference(utils.GroupSnapshotterSecretParams, class.Parameters, groupSnapshotContent.GetObjectMeta().GetName(), nil) + groupSnapshotSecretRef, err := utils.GetGroupSnapshotSecretReference(utils.GroupSnapshotterGetSecretParams, class.Parameters, groupSnapshotContent.GetObjectMeta().GetName(), nil) if err != nil { klog.Errorf("Failed to get secret reference for group snapshot content %s: %v", groupSnapshotContent.Name, err) return groupSnapshotContent, fmt.Errorf("failed to get secret reference for group snapshot content %s: %v", groupSnapshotContent.Name, err) diff --git a/pkg/utils/util.go b/pkg/utils/util.go index ee3326bc9..58c1e90c2 100644 --- a/pkg/utils/util.go +++ b/pkg/utils/util.go @@ -65,6 +65,9 @@ const ( PrefixedSnapshotterListSecretNameKey = csiParameterPrefix + "snapshotter-list-secret-name" // Prefixed name key for ListSnapshots secret PrefixedSnapshotterListSecretNamespaceKey = csiParameterPrefix + "snapshotter-list-secret-namespace" // Prefixed namespace key for ListSnapshots secret + PrefixedGroupSnapshotterGetSecretNameKey = csiParameterPrefix + "group-snapshotter-get-secret-name" // Prefixed name key for GetVolumeGroupSnapshot secret + PrefixedGroupSnapshotterGetSecretNamespaceKey = csiParameterPrefix + "group-snapshotter-get-secret-namespace" // Prefixed namespace key for GetVolumeGroupSnapshot secret + PrefixedVolumeSnapshotNameKey = csiParameterPrefix + "volumesnapshot/name" // Prefixed VolumeSnapshot name key PrefixedVolumeSnapshotNamespaceKey = csiParameterPrefix + "volumesnapshot/namespace" // Prefixed VolumeSnapshot namespace key PrefixedVolumeSnapshotContentNameKey = csiParameterPrefix + "volumesnapshotcontent/name" // Prefixed VolumeSnapshotContent name key @@ -176,6 +179,12 @@ var SnapshotterListSecretParams = secretParamsMap{ secretNamespaceKey: PrefixedSnapshotterListSecretNamespaceKey, } +var GroupSnapshotterGetSecretParams = secretParamsMap{ + name: "GroupSnapshotterGet", + secretNameKey: PrefixedGroupSnapshotterGetSecretNameKey, + secretNamespaceKey: PrefixedGroupSnapshotterGetSecretNamespaceKey, +} + // Annotations on VolumeSnapshotContent objects entirely controlled by csi-snapshotter // Changes to these annotations will be ignored for determining whether to sync changes to content objects // AnnVolumeSnapshotBeingCreated is managed entirely by the csi-snapshotter sidecar @@ -548,6 +557,8 @@ func RemovePrefixedParameters(param map[string]string) (map[string]string, error case PrefixedSnapshotterSecretNamespaceKey: case PrefixedSnapshotterListSecretNameKey: case PrefixedSnapshotterListSecretNamespaceKey: + case PrefixedGroupSnapshotterGetSecretNameKey: + case PrefixedGroupSnapshotterGetSecretNamespaceKey: case PrefixedGroupSnapshotterSecretNameKey: case PrefixedGroupSnapshotterSecretNamespaceKey: default: