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

node-labeller: Remove obsolete functionalities #11146

Merged

Conversation

RamLavi
Copy link
Contributor

@RamLavi RamLavi commented Feb 5, 2024

What this PR does

Before this PR:
node labeller supported deprecated annotations (since v0.40 release).

After this PR:
node labeller will not support these annotations, as kubevirt does not support upgrade from this release anymore.

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

node-labeller: Remove obsolete functionalities

Node labeller was moved into core Kubevirt as part of
v0.40 release [0]. As part of this move the labels were renamed
to match Kubevirt practice and functionality to remove the old
ones was introduced.
Now when we don't support upgrade from the
old version we can remove this functionality.

[0]
kubevirt@5eb8807

Signed-off-by: Luboslav Pivarc <lpivarc@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Feb 5, 2024
@RamLavi RamLavi changed the title node labeller: Remove obsolete functionalities node-labeller: Remove obsolete functionalities Feb 5, 2024
@RamLavi RamLavi force-pushed the remove_obsolete_node_label_functions branch from 474b4ec to 73524af Compare February 5, 2024 11:19
@RamLavi
Copy link
Contributor Author

RamLavi commented Feb 5, 2024

It's strange that the unit test lane failed, as I didn't add/remove any in this PR..
/test pull-kubevirt-unit-test-arm64

@@ -230,20 +226,7 @@ func (n *NodeLabeller) patchNode(originalNode, node *v1.Node) error {
})
}

if !equality.Semantic.DeepEqual(originalNode.Annotations, node.Annotations) {
Copy link
Contributor

@enp0s3 enp0s3 Feb 5, 2024

Choose a reason for hiding this comment

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

@RamLavi Are you sure its completely safe to remove the annotation handling? what about [LabellerSkipNodeAnnotation]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WRT the LabellerSkipNodeAnnotation annotation, AFAIU this annotation is set by the user in order to opt-out the node-labeling entirely (see here). If that annotation is set then node-labeller will not patch anything, so this part of "patchNode" code won't run. In other words, I'm not removing this annotation's functionality.

As for if I'm completely sure that the annotations are not needed, it says so on the commit message that introduced the node-labeller on release 0.40 (see commit here):

This commit migrates the node labeller from ssp operator into kubevirt.
This feature labels nodes with host supported cpu models and features and hyper-v features.

After new labeller runs it deletes all old labels / annotations and
creates new labels with new namespace.

So IIUC now that we don't have to support the upgrade from this version then we can remove this code handling old annotations/labels.

... But I didn't stop there and further examined the code to double check..
Notice that:

  • The original (now archived) node-labeller repo added both labels and annotations (see here).
  • When the node-labeller moved to kubevirt (see main branch PR) on v0.40.0 - the behavior changed:
    • new labels were only added to the metadata.labels (see here).
    • annotations were only used in order to be removed (see here)
    • Specifically - only the annotations with the DeprecatedLabellerNamespaceAnnotation prefix were removed. This deprecated annotation is exactly the one we are now no longer supporting.

Do you think I should check any further?

Copy link
Contributor

Choose a reason for hiding this comment

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

@RamLavi Thank you for the detailed explanation!

Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

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

Hey, I have a question ^^

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

/approve
/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 5, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xpivarc

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

The pull request process is described here

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2024
@RamLavi
Copy link
Contributor Author

RamLavi commented Feb 5, 2024

Hey, I have a question ^^

Thanks for asking! Please see answer

@RamLavi
Copy link
Contributor Author

RamLavi commented Feb 6, 2024

/test pull-kubevirt-e2e-arm64

@enp0s3
Copy link
Contributor

enp0s3 commented Feb 7, 2024

/hold cancel

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 7, 2024
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2024
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.27-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.29-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.27-sig-network
/test pull-kubevirt-e2e-k8s-1.27-sig-storage
/test pull-kubevirt-e2e-k8s-1.27-sig-compute
/test pull-kubevirt-e2e-k8s-1.27-sig-operator
/test pull-kubevirt-e2e-k8s-1.28-sig-network
/test pull-kubevirt-e2e-k8s-1.28-sig-storage
/test pull-kubevirt-e2e-k8s-1.28-sig-compute
/test pull-kubevirt-e2e-k8s-1.28-sig-operator

@kubevirt-bot kubevirt-bot merged commit 426aa42 into kubevirt:main Feb 7, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants