Skip to content

Nodeselector Description update#1483

Open
smulje wants to merge 1 commit into
nmstate:mainfrom
smulje:NNCP-Nodeselector-Description-fix
Open

Nodeselector Description update#1483
smulje wants to merge 1 commit into
nmstate:mainfrom
smulje:NNCP-Nodeselector-Description-fix

Conversation

@smulje
Copy link
Copy Markdown

@smulje smulje commented Apr 10, 2026

This PR updates the NodeSelector field description in the CRD to more accurately reflect its current behavior and limitations.

Previously, the description referenced general Kubernetes node selector semantics and linked to the upstream documentation, which may imply support for advanced selector features such as matchExpressions. However, the current implementation only supports simple equality-based key-value matching.

What’s changed
Clarified that NodeSelector uses simple key-value (equality-based) label matching only
Explicitly stated that all specified labels must match for the policy to be applied to a node
Added a clear note that matchLabels and matchExpressions are not supported

Why this change
The previous description could mislead users into assuming support for full Kubernetes label selector semantics. This update ensures the documentation is aligned with actual functionality, reducing confusion and preventing incorrect configurations.

@kubevirt-bot
Copy link
Copy Markdown
Collaborator

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Apr 10, 2026
@kubevirt-bot kubevirt-bot requested a review from mkowalski April 10, 2026 10:38
@kubevirt-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mkowalski for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot requested a review from phoracek April 10, 2026 10:38
@kubevirt-bot kubevirt-bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Apr 10, 2026
@kubevirt-bot
Copy link
Copy Markdown
Collaborator

Hi @smulje. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the description of the NodeSelector field in the NodeNetworkConfigurationPolicy CRD to clarify its label matching behavior and limitations. However, the reviewer noted that these changes were made manually to the YAML file rather than the Go source code, which risks inconsistency and loss of updates during future manifest regeneration. It is recommended to apply these documentation improvements to the Go API definitions and use the generation tools to update the manifests.

Comment on lines +78 to +82
NodeSelector is a selector that determines which nodes the policy will be applied to.
It uses simple key-value label matching (equality-based selection only). All specified
labels must match a node's labels for the policy to be scheduled on that node.
Supports a maximum of 256 label selectors. Note: matchLabels and matchExpressions syntax
are not supported; only direct key-value pair matching is available.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This CRD file appears to have been updated manually, which presents two issues:

  1. Inconsistency: The corresponding manifest in bundle/manifests/nmstate.io_nodenetworkconfigurationpolicies.yaml was not updated, leading to inconsistent documentation across the repository.
  2. Maintainability: This file is typically generated from Go source code using controller-gen (as indicated by the annotations in the bundle version). Manual changes will be lost the next time the manifests are regenerated.

Please apply these description updates to the docstrings of the NodeSelector field in the Go API definitions (likely in api/shared/ where NodeNetworkConfigurationPolicySpec is defined) and then run the manifest generation command (e.g., make manifests) to update all YAML files consistently.

Additionally, note a minor grammatical correction: "syntax are not supported" should be "syntax is not supported" or "syntaxes are not supported".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

@mkowalski
Copy link
Copy Markdown
Member

Kindly please use your corporate credentials for the commit sign off instead of the current Signed-off-by: Swati Mulje <86704969+smulje@users.noreply.github.com>

@smulje smulje force-pushed the NNCP-Nodeselector-Description-fix branch 3 times, most recently from 61f478a to aafda55 Compare April 10, 2026 11:15
value: quay.io/nmstate/kubernetes-nmstate-handler:latest
- name: HANDLER_IMAGE_PULL_POLICY
value: IfNotPresent
value: Always
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nope, it’s not going in

value: quay.io/openshift/origin-kube-rbac-proxy:4.10.0
image: quay.io/nmstate/kubernetes-nmstate-operator:latest
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As above, nope

@smulje smulje force-pushed the NNCP-Nodeselector-Description-fix branch 2 times, most recently from 8678507 to deb4170 Compare April 13, 2026 07:57
@smulje smulje requested a review from mkowalski April 13, 2026 09:43
@mkowalski
Copy link
Copy Markdown
Member

image This does not seem ready. I am pretty sure we wouldn't be happy merging the PR in its current state

Signed-off-by: Swati Mulje <smulje@redhat.com>
@smulje smulje force-pushed the NNCP-Nodeselector-Description-fix branch from deb4170 to d0e178f Compare April 24, 2026 05:23
@smulje
Copy link
Copy Markdown
Author

smulje commented May 6, 2026

The suggested changes have been completed. Please review and let me know if everything looks good to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants