Skip to content

Commit

Permalink
policyset: adjust delete() returns (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 authored Nov 27, 2024
1 parent de3cbb2 commit c1ead0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ocm/policyset.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ func (builder *PolicySetBuilder) Delete() (*PolicySetBuilder, error) {
builder.Definition.Name, builder.Definition.Namespace)

if !builder.Exists() {
return builder, fmt.Errorf("policySet cannot be deleted because it does not exist")
glog.V(100).Infof("PolicySet %s does not exist in namespace %s",
builder.Definition.Name, builder.Definition.Namespace)

builder.Object = nil

return builder, nil
}

err := builder.apiClient.Delete(context.TODO(), builder.Definition)
Expand Down

0 comments on commit c1ead0e

Please sign in to comment.