Skip to content

Commit 3aefaf5

Browse files
authored
Merge pull request kubernetes-csi#1173 from yati1998/parameter
Add secrets for Get VolumeGroupSnapshot
2 parents 2965ff7 + 722c022 commit 3aefaf5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pkg/sidecar-controller/groupsnapshot_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateGroupSnapshotContentStat
756756
return groupSnapshotContent, fmt.Errorf("failed to get group snapshot class %s for group snapshot content %s: %v", *groupSnapshotContent.Spec.VolumeGroupSnapshotClassName, groupSnapshotContent.Name, err)
757757
}
758758

759-
groupSnapshotSecretRef, err := utils.GetGroupSnapshotSecretReference(utils.GroupSnapshotterSecretParams, class.Parameters, groupSnapshotContent.GetObjectMeta().GetName(), nil)
759+
groupSnapshotSecretRef, err := utils.GetGroupSnapshotSecretReference(utils.GroupSnapshotterGetSecretParams, class.Parameters, groupSnapshotContent.GetObjectMeta().GetName(), nil)
760760
if err != nil {
761761
klog.Errorf("Failed to get secret reference for group snapshot content %s: %v", groupSnapshotContent.Name, err)
762762
return groupSnapshotContent, fmt.Errorf("failed to get secret reference for group snapshot content %s: %v", groupSnapshotContent.Name, err)

pkg/utils/util.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ const (
6565
PrefixedSnapshotterListSecretNameKey = csiParameterPrefix + "snapshotter-list-secret-name" // Prefixed name key for ListSnapshots secret
6666
PrefixedSnapshotterListSecretNamespaceKey = csiParameterPrefix + "snapshotter-list-secret-namespace" // Prefixed namespace key for ListSnapshots secret
6767

68+
PrefixedGroupSnapshotterGetSecretNameKey = csiParameterPrefix + "group-snapshotter-get-secret-name" // Prefixed name key for GetVolumeGroupSnapshot secret
69+
PrefixedGroupSnapshotterGetSecretNamespaceKey = csiParameterPrefix + "group-snapshotter-get-secret-namespace" // Prefixed namespace key for GetVolumeGroupSnapshot secret
70+
6871
PrefixedVolumeSnapshotNameKey = csiParameterPrefix + "volumesnapshot/name" // Prefixed VolumeSnapshot name key
6972
PrefixedVolumeSnapshotNamespaceKey = csiParameterPrefix + "volumesnapshot/namespace" // Prefixed VolumeSnapshot namespace key
7073
PrefixedVolumeSnapshotContentNameKey = csiParameterPrefix + "volumesnapshotcontent/name" // Prefixed VolumeSnapshotContent name key
@@ -176,6 +179,12 @@ var SnapshotterListSecretParams = secretParamsMap{
176179
secretNamespaceKey: PrefixedSnapshotterListSecretNamespaceKey,
177180
}
178181

182+
var GroupSnapshotterGetSecretParams = secretParamsMap{
183+
name: "GroupSnapshotterGet",
184+
secretNameKey: PrefixedGroupSnapshotterGetSecretNameKey,
185+
secretNamespaceKey: PrefixedGroupSnapshotterGetSecretNamespaceKey,
186+
}
187+
179188
// Annotations on VolumeSnapshotContent objects entirely controlled by csi-snapshotter
180189
// Changes to these annotations will be ignored for determining whether to sync changes to content objects
181190
// AnnVolumeSnapshotBeingCreated is managed entirely by the csi-snapshotter sidecar
@@ -548,6 +557,8 @@ func RemovePrefixedParameters(param map[string]string) (map[string]string, error
548557
case PrefixedSnapshotterSecretNamespaceKey:
549558
case PrefixedSnapshotterListSecretNameKey:
550559
case PrefixedSnapshotterListSecretNamespaceKey:
560+
case PrefixedGroupSnapshotterGetSecretNameKey:
561+
case PrefixedGroupSnapshotterGetSecretNamespaceKey:
551562
case PrefixedGroupSnapshotterSecretNameKey:
552563
case PrefixedGroupSnapshotterSecretNamespaceKey:
553564
default:

0 commit comments

Comments
 (0)