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 ignoring specific labels in dangling service selector check #465

Merged
merged 1 commit into from Jan 4, 2023

Conversation

heckler1
Copy link
Contributor

We have services that select pods based on statefulset.kubernetes.io/pod-name, which is populated by the Kubernetes control plane. I would like to prevent this from being linted on for our use-case, while still checking if the other selector labels are correct.

This instance with service labels is specific to my use-case, but I'm also happy to expand this to the other "dangling" checks if desired.

for _, ignoredLabel := range p.IgnoredLabels {
delete(selector, ignoredLabel)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a test for this change?

@heckler1 heckler1 force-pushed the sheckler/dangling-selector-params branch from 625fce1 to 68ebebe Compare December 15, 2022 15:34
@heckler1 heckler1 requested review from janisz and removed request for dhaus67 December 22, 2022 19:26
@janisz janisz requested a review from dhaus67 January 2, 2023 14:00
@heckler1
Copy link
Contributor Author

heckler1 commented Jan 4, 2023

@dhaus67, @janisz If I could trouble one of y'all for a merge, I'd appreciate it. Thanks!

@dhaus67 dhaus67 merged commit 02f1163 into stackrox:main Jan 4, 2023
abrad3 pushed a commit to abrad3/kube-linter that referenced this pull request Sep 28, 2023
…ackrox#465)

Co-authored-by: Stephen Heckler <sheckler@cloudflare.com>
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.

None yet

3 participants