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

Allow multiple namespace flags #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmaggioni
Copy link

Since the [ignore-]checks flags can already be specified multiple times, now it can be done with the [ignore-]namespaces flags too. Their output is logically AND'ed.

The long options have been renamed from namespace to namespaces for consistency with the rest of the flags. This is a breaking change for those who use the long options but not the shorthands.

The precondition of specifying either includes or excludes is still valid.

Copy link
Contributor

@adamwg adamwg left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

This change itself looks good, but I would like to preserve backward compatibility with the existing flag names so we don't break anyone who might be using clusterlint from scripts/CI/etc.

cli.StringFlag{
Name: "n, namespace",
cli.StringSliceFlag{
Name: "n, namespaces",
Copy link
Contributor

Choose a reason for hiding this comment

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

To preserve backward compatibility you can add namespace as another alias here. It will look a little awkward in the help, but I'd like to avoid breaking existing users. I.e.:

Name: "n, namespaces, namespace",

Copy link
Author

Choose a reason for hiding this comment

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

Sure, makes sense. Do you want to add singular aliases to the checks and groups flags too (ex.: Name: "c, checks, check",) to show a common pattern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants