Skip to content

sidecar: Get credentials from annotation for snapshots #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/sidecar-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
}
}

// The VolumeSnapshotContents that are a member of a VolumeGroupSnapshot will always
// have Spec.VolumeSnapshotClassName unset, use annotations for secrets in such case.
if volumeGroupSnapshotMemberWithGroupSnapshotHandle {
snapshotterListCredentials, err = ctrl.GetCredentialsFromAnnotation(content)
if err != nil {
return content, fmt.Errorf("failed to get credentials from annotation for snapshot content %s: %v", content.Name, err)
}
}

readyToUse, creationTime, size, groupSnapshotID, err = ctrl.handler.GetSnapshotStatus(content, snapshotterListCredentials)
if err != nil {
klog.Errorf("checkandUpdateContentStatusOperation: failed to call get snapshot status to check whether snapshot is ready to use %q", err)
Expand Down