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

nfd-master: predictable handling of unprefixed names #1471

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Nov 23, 2023

Make the handling of unprefixed names (of labels, annotations and
extended resources) well-defined and predictable. Previously the
resulting output was not predictable in case the same name was coming in
both the unprefixed and prefixed form, say unprefixed foo=bar coming from
one source (be it nfd-worker or NodeFeature(Rule)) and
feature.node.kubernetes.io/foo=baz from a NodeFeature(Rule).
Previously the output value was randomly either bar or baz.

This patch adds prefixes to all names early in the processing
"pipeline", preventing random name clashes later on.

Remove some stale variables that were leftover from the recent removal
of nfd version annotations.
Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit dc5af8b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/655fb31381548600080e53fb
😎 Deploy Preview https://deploy-preview-1471--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 23, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 23, 2023
@marquiz
Copy link
Contributor Author

marquiz commented Nov 23, 2023

Depends on #1470
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 23, 2023
Make the handling of unprefixed names (of labels, annotations and
extended resources) well-defined and predictable. Previously the
resulting output was not predictable in case the same name was coming in
both the unprefixed and prefixed form, say unprefixed "foo=bar" coming from
one source (be it nfd-worker or NodeFeature(Rule)) and
"feature.node.kubernetes.io/foo=baz" from a NodeFeature(Rule).
Previously the output value was randomly either "bar" or "baz".

This patch adds prefixes to all names early in the processing
"pipeline", preventing random name clashes later on.
Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

go test -v ./test/e2e/ -args -nfd.repo=ghcr.io/arangogutierrez/node-feature-discovery -nfd.tag=v0.15.0-devel-129-gdc5af8be-dirty \
            -kubeconfig=/Users/eduardoa/.kube/config \
            -nfd.e2e-config= \
            -nfd.pull-if-not-present=false \
            -ginkgo.focus="\[kubernetes-sigs\] NFD master and worker" \
            -test.timeout=1h \
            
  Nov 24 11:08:50.847: INFO: The --provider flag is not set. Continuing as if --provider=skeleton had been used.
=== RUN   TestE2E
  I1124 11:08:50.847912   13265 e2e.go:117] Starting e2e run "fd76fdfb-fdcf-42c2-89fd-ddef8ed78fea" on Ginkgo node 1
Running Suite: Kubernetes e2e suite - /Users/eduardoa/src/github/k8s-sigs/node-feature-discovery/test/e2e
=========================================================================================================
Random Seed: 1700820530 - will randomize all specs

Will run 16 of 299 specs
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS•S•SS•SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS•S••••S•SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Ran 9 of 299 Specs in 119.999 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 290 Skipped

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 08602e8f2d49e3955481c6f65e69e24550b89e65

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

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:
  • OWNERS [ArangoGutierrez,marquiz]

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

@ArangoGutierrez
Copy link
Contributor

Depends on #1470 /hold

#1470 has been merged

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 24, 2023
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #1471 (dc5af8b) into master (38ed148) will decrease coverage by 0.04%.
Report is 2 commits behind head on master.
The diff coverage is 53.65%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1471      +/-   ##
==========================================
- Coverage   30.55%   30.51%   -0.04%     
==========================================
  Files          58       58              
  Lines        7527     7530       +3     
==========================================
- Hits         2300     2298       -2     
- Misses       4978     4982       +4     
- Partials      249      250       +1     
Files Coverage Δ
pkg/nfd-master/nfd-master.go 45.79% <53.65%> (-0.35%) ⬇️

@k8s-ci-robot k8s-ci-robot merged commit 4e7f8b1 into kubernetes-sigs:master Nov 24, 2023
12 checks passed
@marquiz marquiz deleted the devel/default-ns-fix branch November 24, 2023 10:47
@marquiz marquiz mentioned this pull request Dec 20, 2023
24 tasks
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants