Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise warning if ns is missing #10135

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/ctr/commands/namespaces/namespaces.go
Expand Up @@ -173,8 +173,10 @@ var removeCommand = &cli.Command{
}
log.G(ctx).WithError(err).Errorf("unable to delete %v", target)
continue
} else {
log.G(ctx).WithError(err).Warnf("namespace %v not found", target)
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a potential change in behavior; previously we would consider the command to be idempotent; it would ignore the error if it's not found, and print the target (line 180/182 below).

With this change, it's no longer considered idempotent, and printing a warning; printing a warning may be ok, but the continue here also means that it's no longer printing the target.

I realise ctr is a debugging tool, so not considered "stable", but wondering if there's a potential for scripts to be depending on this (i.e. target to be printed).

Copy link
Author

@ksdpmx ksdpmx Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for explaining. yes there's a potential breaking change for idempotency in outputs with this pr.

}

}

fmt.Println(target)
Expand Down