Skip to content

Commit

Permalink
Do not panic when a default snapshotclass does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoce committed Nov 22, 2024
1 parent 07425bd commit 5fa26d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/sidecar-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,12 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotWrapper(content *crdv1.V
return content, fmt.Errorf("failed to add VolumeSnapshotBeingCreated annotation on the content %s: %q", content.Name, err)
}

parameters, err := utils.RemovePrefixedParameters(class.Parameters)
var parameters map[string]string
if class != nil {
parameters = class.Parameters
}

parameters, err = utils.RemovePrefixedParameters(parameters)
if err != nil {
return content, fmt.Errorf("failed to remove CSI Parameters of prefixed keys: %v", err)
}
Expand Down

0 comments on commit 5fa26d0

Please sign in to comment.