Skip to content

Commit 4cedb3f

Browse files
authored
Merge pull request #1297 from black-dragon74/get-creds-from-annon
sidecar: Get credentials from annotation for snapshots
2 parents 6464d82 + 78bbdbf commit 4cedb3f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
290290
}
291291
}
292292

293+
// The VolumeSnapshotContents that are a member of a VolumeGroupSnapshot will always
294+
// have Spec.VolumeSnapshotClassName unset, use annotations for secrets in such case.
295+
if volumeGroupSnapshotMemberWithGroupSnapshotHandle {
296+
snapshotterListCredentials, err = ctrl.GetCredentialsFromAnnotation(content)
297+
if err != nil {
298+
return content, fmt.Errorf("failed to get credentials from annotation for snapshot content %s: %v", content.Name, err)
299+
}
300+
}
301+
293302
readyToUse, creationTime, size, groupSnapshotID, err = ctrl.handler.GetSnapshotStatus(content, snapshotterListCredentials)
294303
if err != nil {
295304
klog.Errorf("checkandUpdateContentStatusOperation: failed to call get snapshot status to check whether snapshot is ready to use %q", err)

0 commit comments

Comments
 (0)