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

karmadactl: Add the reserved label karmada.io/system to resources created by the join command #4620

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Feb 8, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:
Follow-up to #3262

Adds the well-known "karmada.io/managed" label to resources created by karmada controllers

We need a way to bypass creation of some ClusterRole/Rolebindings by our OPA Gatekeeper and we don't have a consistent label to select on. When we join a cluster via push command, it creates ClusterRole/ClusterRoleBinding that are too open (* and *) which is by default blocked by our opa-gatekeeper policies. This allows us to bypass it by the karmada managed label.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmadactl`: Add the reserved label `karmada.io/system` to resources created by the `join` command.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 8, 2024
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 70.73171% with 12 lines in your changes missing coverage. Please review.

Project coverage is 28.27%. Comparing base (a2e7828) to head (284dd27).

Files Patch % Lines
pkg/karmadactl/register/register.go 0.00% 12 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4620      +/-   ##
==========================================
+ Coverage   28.26%   28.27%   +0.01%     
==========================================
  Files         632      632              
  Lines       43589    43612      +23     
==========================================
+ Hits        12319    12332      +13     
- Misses      30372    30382      +10     
  Partials      898      898              
Flag Coverage Δ
unittests 28.27% <70.73%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@grosser grosser left a comment

Choose a reason for hiding this comment

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

@karmada-bot
Copy link
Collaborator

@chaunceyjiang: GitHub didn't allow me to request PR reviews from the following users: a7i.

Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @a7i

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/test-infra repository.

@XiShanYongYe-Chang
Copy link
Member

Hi @chaunceyjiang, can you help take a review again?

Copy link
Member

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Thanks~

/LGTM

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2024
@chaunceyjiang
Copy link
Member

/cc @XiShanYongYe-Chang PTAL.

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/lgtm
/cc @RainbowMango

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/assign
Another PR I missed :( :( I'll look at it ASAP.

@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label May 16, 2024
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Forced pushed to solve conflicts and updated release-notes.

@karmada-bot karmada-bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 16, 2024
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2024
@a7i a7i force-pushed the amir/managed-by-label branch 2 times, most recently from 22d9f6c to 901c878 Compare July 8, 2024 17:11
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grosser, RainbowMango

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

@a7i a7i changed the title set karmada.io/managed label to all credentials resources set karmada.io/system label to all member cluster registration resources Jul 8, 2024
@a7i
Copy link
Contributor Author

a7i commented Jul 9, 2024

@XiShanYongYe-Chang no rush, but should be ready for your review

@XiShanYongYe-Chang
Copy link
Member

OK, thanks~
/retest

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks~

pkg/util/constants.go Outdated Show resolved Hide resolved
pkg/util/constants.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 11, 2024
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
@a7i a7i changed the title set karmada.io/system label to all member cluster registration resources set karmada.io/system label to all system level resources managed by karmada controllers Jul 11, 2024
@a7i a7i changed the title set karmada.io/system label to all system level resources managed by karmada controllers karmadactl: Add the reserved label karmada.io/managed to resources created by the join command Jul 11, 2024
@a7i a7i changed the title karmadactl: Add the reserved label karmada.io/managed to resources created by the join command karmadactl: Add the reserved label karmada.io/system to resources created by the join command Jul 11, 2024
@zhzhuang-zju
Copy link
Contributor

/retest

@XiShanYongYe-Chang
Copy link
Member

Thanks~
/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2024
@zhzhuang-zju
Copy link
Contributor

/lgtm
and failed e2e cases also rerun successfully~
cc @whitewindmills I observed that you added the /hold label earlier, please take a look at it again for any other comments? Note that once hold is canceled, pr will get merged since there is approve label

@RainbowMango
Copy link
Member

/hold cancel

@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 12, 2024
@karmada-bot karmada-bot merged commit 2ae4592 into karmada-io:master Jul 12, 2024
12 checks passed
@a7i a7i deleted the amir/managed-by-label branch July 12, 2024 13:31
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants