Skip to content

Commit

Permalink
fail if annotation not present
Browse files Browse the repository at this point in the history
  • Loading branch information
RaunakShah committed Apr 18, 2022
1 parent a386aed commit 6db13c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/controller.go
Expand Up @@ -1135,7 +1135,7 @@ func (p *csiProvisioner) getSnapshotSource(ctx context.Context, claim *v1.Persis
// Verify if this volume is allowed to alter its mode.
allowVolumeModeChange, ok := snapContentObj.Annotations[annAllowVolumeModeChange]
if !ok {
klog.Infof("%s annotation not present on VolumeSnapshotContent %s. Allowing volume mode change ...", annAllowVolumeModeChange, snapContentObj.Name)
return nil, fmt.Errorf("requested volume %s/%s modifies the mode of the source volume but does not have permission to do so.", claim.Namespace, claim.Name)
}
allowVolumeModeChangeBool, err := strconv.ParseBool(allowVolumeModeChange)
if err != nil {
Expand Down

0 comments on commit 6db13c9

Please sign in to comment.