From d7167fc7d6b58c14b7e2018e8484a41a3606373d Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Fri, 1 Nov 2024 08:39:36 -0500 Subject: [PATCH] secret: adjust delete() returns (#753) --- pkg/secret/secret.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/secret/secret.go b/pkg/secret/secret.go index b59db401a..9e867f57e 100644 --- a/pkg/secret/secret.go +++ b/pkg/secret/secret.go @@ -145,6 +145,11 @@ func (builder *Builder) Delete() error { glog.V(100).Infof("Deleting the secret %s from namespace %s", builder.Definition.Name, builder.Definition.Namespace) if !builder.Exists() { + glog.V(100).Infof("Secret %s does not exist in namespace %s", + builder.Definition.Name, builder.Definition.Namespace) + + builder.Object = nil + return nil } @@ -157,7 +162,7 @@ func (builder *Builder) Delete() error { builder.Object = nil - return err + return nil } // Exists checks whether the given secret exists.