Skip to content

Commit

Permalink
Merge pull request #1173 from yati1998/parameter
Browse files Browse the repository at this point in the history
Add secrets for Get VolumeGroupSnapshot
  • Loading branch information
k8s-ci-robot authored Nov 15, 2024
2 parents 2965ff7 + 722c022 commit 3aefaf5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sidecar-controller/groupsnapshot_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3aefaf5

Please sign in to comment.