Skip to content

Commit

Permalink
Fix: make read-only object not found error more clear (#5614)
Browse files Browse the repository at this point in the history
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
  • Loading branch information
Somefive committed Mar 6, 2023
1 parent e7dad3c commit 91638eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func createOrGetExisting(ctx context.Context, act *applyAction, c client.Client,
return nil, err
}
if act.readOnly {
return nil, fmt.Errorf("cannot create %s (%s) in read-only mode", desired.GetObjectKind().GroupVersionKind().Kind, desired.GetName())
return nil, fmt.Errorf("%s (%s) is marked as read-only but does not exist. You should check the existence of the resource or remove the read-only policy", desired.GetObjectKind().GroupVersionKind().Kind, desired.GetName())
}
if act.updateAnnotation {
if err := addLastAppliedConfigAnnotation(desired); err != nil {
Expand Down

0 comments on commit 91638eb

Please sign in to comment.