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

feat: add support for matchExpressions when filtering for nodes #1697

Merged

Conversation

miguelvr
Copy link
Contributor

@miguelvr miguelvr commented Nov 28, 2024

Description, Motivation and Context

Includes the ability to use a Kubernetes matchExpressions label selector for the nodeResources analyzer.

I wanted to write pre-flight checks to analyze nodes that contained a specific label and another that negated it. Currently, this is not possible with the MatchLabel selector. It would be possible with a MatchExpressions label selector by using the negation operators (e.g., NotIn / DoesNotExist)

Checklist

Does this PR introduce a breaking change?

  • Yes
  • No

@miguelvr miguelvr requested a review from a team as a code owner November 28, 2024 15:48
@CLAassistant
Copy link

CLAassistant commented Nov 28, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@nvanthao nvanthao left a comment

Choose a reason for hiding this comment

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

Many thanks for the contribution @miguelvr!

The changes look good, I will approve it after we fix the failed Github Action.

When we introduce new field in Troubleshoot spec, we have to ensure the schemas are updated accordingly. Please run below command from the project root directory and commit the changes accordingly.

make schemas
make check-schemas

@miguelvr
Copy link
Contributor Author

miguelvr commented Nov 29, 2024

@nvanthao make generate fails locally because it assumes a specific relative path directory structure (that I think it's used in CI, based on the git history)

it seems like the files are not generated to the repo anyway, so I skipped that command and committed everything else.

Let me know if there's something else I should fix on my end

@nvanthao nvanthao self-requested a review November 30, 2024 12:10
Copy link
Member

@nvanthao nvanthao left a comment

Choose a reason for hiding this comment

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

Thank you for running the commands and for pointing out the issue with the relative paths. We'll address that separately to ensure smoother local workflows.

Since the schemas were successfully generated by other targets and everything else looks good, I'll go ahead and approve this PR. Many thanks for your contribution!

@nvanthao nvanthao merged commit 8e26470 into replicatedhq:main Nov 30, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants