From fb097571934973c9e34df494a37d1a840fa323ff Mon Sep 17 00:00:00 2001 From: "Sean P. Kane" Date: Thu, 6 Jan 2022 11:32:14 -0800 Subject: [PATCH] Ignore 404 NOT FOUND when trying to delete a tag Signed-off-by: Sean P. Kane --- internal/commands/tag/rm.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/commands/tag/rm.go b/internal/commands/tag/rm.go index bb156bf..89a1bb3 100644 --- a/internal/commands/tag/rm.go +++ b/internal/commands/tag/rm.go @@ -96,7 +96,12 @@ func runRm(ctx context.Context, streams command.Streams, hubClient *hub.Client, } if err := hubClient.RemoveTag(reference.FamiliarName(ref), ref.Tag()); err != nil { - return err + if strings.Contains(err.Error(), "404 NOT FOUND") { + fmt.Fprintln(streams.Out(), "Not Found", image) + return nil + } else { + return err + } } fmt.Fprintln(streams.Out(), "Deleted", image) return nil