From c1ead0eda2120f0a5633996ff32afcfeb520724d Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Wed, 27 Nov 2024 15:36:45 -0600 Subject: [PATCH] policyset: adjust delete() returns (#803) --- pkg/ocm/policyset.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/ocm/policyset.go b/pkg/ocm/policyset.go index 87f6b1139..b107de13d 100644 --- a/pkg/ocm/policyset.go +++ b/pkg/ocm/policyset.go @@ -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)