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

Fix LookupReservedIdentityByLabels function to return consistent results #26795

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

skmatti
Copy link
Contributor

@skmatti skmatti commented Jul 13, 2023

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

The function results inconsistent results if both fixed and reserved identities are present.

For e.g., the following returns 1

- "reserved:host"
- "k8s:io.cilium.fixed-identity=128"

whereas the following returns 128

- "k8s:io.cilium.fixed-identity=128"
- "reserved:host"

Also, this simplifies the logic to make it more readable.

@skmatti skmatti requested review from a team as code owners July 13, 2023 02:46
@maintainer-s-little-helper
Copy link

Commit 287605c5d18e35c860405e517075a1fa85a64235 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jul 13, 2023
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Jul 13, 2023
@maintainer-s-little-helper
Copy link

Commit 287605c5d18e35c860405e517075a1fa85a64235 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commits ab86fcf4d6568446162660c38fd6e79d0374acce, c315ca586c1c2233d28aeed9946249a95bf5831a do not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

1 similar comment
@maintainer-s-little-helper
Copy link

Commits ab86fcf4d6568446162660c38fd6e79d0374acce, c315ca586c1c2233d28aeed9946249a95bf5831a do not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commit ab86fcf4d6568446162660c38fd6e79d0374acce does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commit 3686ef81ed11f2fa8679c6b554a46cfed37ab41d does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Jul 13, 2023
@maintainer-s-little-helper
Copy link

Commit bd89c81eb22f62e9913d43c3802dc0f3cd03505c does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

1 similar comment
@maintainer-s-little-helper
Copy link

Commit bd89c81eb22f62e9913d43c3802dc0f3cd03505c does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Jul 13, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Jul 13, 2023
Copy link
Member

@aditighag aditighag left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Could you go over the guidelines to submit a PR - https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#submitting-a-pull-request? More specifically, the change-id in the sign-off can be dropped from the commit message. Is this a user facing commit? We'll need to add a label accordingly.
In the meantime, I've triggered the tests.

The function results inconsistent results if both fixed
and reserved identities are present.

Also, this simplifies the logic to make it more readable.

Signed-off-by: Satish Matti <smatti@google.com>
@skmatti
Copy link
Contributor Author

skmatti commented Jul 30, 2023

Thanks for your contribution. Could you go over the guidelines to submit a PR - https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#submitting-a-pull-request? More specifically, the change-id in the sign-off can be dropped from the commit message. Is this a user facing commit? We'll need to add a label accordingly. In the meantime, I've triggered the tests.

Thanks for your comment, I just updated the comment.

@ldelossa ldelossa added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Aug 7, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 7, 2023
@nathanjsweet
Copy link
Member

/test

Copy link
Member

@nathanjsweet nathanjsweet left a comment

Choose a reason for hiding this comment

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

This is much better. Thank you for reworking this logic!

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 10, 2023
@nathanjsweet
Copy link
Member

Thanks @skmatti 🙏 !

@nathanjsweet nathanjsweet merged commit 47555b4 into cilium:main Aug 11, 2023
@skmatti skmatti deleted the master-lbls branch August 18, 2023 03:08
@joestringer joestringer added release-note/misc This PR makes changes that have no direct user impact. and removed release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Aug 31, 2023
@joestringer
Copy link
Member

heads up @ldelossa I switched this to release-note/misc since it wasn't obvious to me whether there was any user-facing observable change here. If there is a workflow where we think that this could impact users, then feel free to switch the release-note back. It may then also be helpful to describe how they may be impacted and consider even whether there should be an upgrade note to describe the impact.

@christarazi christarazi added the affects/v1.14 This issue affects v1.14 branch label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/v1.14 This issue affects v1.14 branch kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants