Skip to content

Commit

Permalink
Update default storageclass check error
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Wang <[email protected]>
  • Loading branch information
w13915984028 committed Jan 21, 2025
1 parent 146e721 commit 867a873
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/webhook/resources/storageclass/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (v *storageClassValidator) validateSetUniqueDefault(newObj runtime.Object)
// return set default error
// when find another have storageclass.kubernetes.io/is-default-class annotation and value is true.
if v, ok := sc.Annotations[util.AnnotationIsDefaultStorageClassName]; ok && v == "true" {
return werror.NewInvalidError("default storage class %s already exists, please reset it first", sc.Name)
return werror.NewInvalidError(fmt.Sprintf("default storage class %s already exists, please reset it first before set %s as default", sc.Name, newSC.Name), "")
}
}

Expand Down

0 comments on commit 867a873

Please sign in to comment.