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

feat: karmadactl init: grant clusterrole admin with karamda resource permission #3937

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

zhy76
Copy link
Member

@zhy76 zhy76 commented Aug 14, 2023

What type of PR is this?

What this PR does / why we need it:
feat: karmadactl init: grant clusterrole admin with karamda resource permission
Which issue(s) this PR fixes:
Part of #3916

Special notes for your reviewer:
Does this PR introduce a user-facing change?:

`karmadactl`: Granted full permissions of Karmada resources to `admin` during deployment of Karmada with `init`.

@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 14, 2023
@zhy76
Copy link
Member Author

zhy76 commented Aug 14, 2023

How can I test locally?
I do like this:

make karmadactl
cp ./karmadactl /usr/local/bin/karmadactl
curl -L https://github.com/karmada-io/karmada/releases/download/v1.7.0-alpha.3/crds.tar.gz -o crds.tar.gz
karmadactl init --kube-image-mirror-country=cn --crds ./crds.tar.gz

but still has some problem:
image

@XiShanYongYe-Chang
Copy link
Member

/cc @lonelyCZ @prodanlabs
Can you help take a look?

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2023

Codecov Report

Merging #3937 (90b944a) into master (54e900c) will increase coverage by 0.26%.
Report is 4 commits behind head on master.
The diff coverage is 91.33%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3937      +/-   ##
==========================================
+ Coverage   54.70%   54.96%   +0.26%     
==========================================
  Files         229      229              
  Lines       22074    22217     +143     
==========================================
+ Hits        12076    12212     +136     
- Misses       9352     9358       +6     
- Partials      646      647       +1     
Flag Coverage Δ
unittests 54.96% <91.33%> (+0.26%) ⬆️

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

Files Changed Coverage Δ
pkg/karmadactl/cmdinit/karmada/deploy.go 0.00% <0.00%> (ø)
pkg/karmadactl/cmdinit/karmada/rbac.go 92.37% <95.65%> (+4.37%) ⬆️
pkg/karmadactl/cmdinit/kubernetes/deployments.go 100.00% <100.00%> (ø)
pkg/karmadactl/cmdinit/utils/rbac.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@lonelyCZ
Copy link
Member

How can I test locally? I do like this:

make karmadactl
cp ./karmadactl /usr/local/bin/karmadactl
curl -L https://github.com/karmada-io/karmada/releases/download/v1.7.0-alpha.3/crds.tar.gz -o crds.tar.gz
karmadactl init --kube-image-mirror-country=cn --crds ./crds.tar.gz

but still has some problem: image

It seems lack of git tag info locally. You can use git tag <version> to add a new tag and then build it.

…permission

Signed-off-by: zhy76 <958474674@qq.com>
@zhy76
Copy link
Member Author

zhy76 commented Aug 15, 2023

How can I test locally? I do like this:

make karmadactl
cp ./karmadactl /usr/local/bin/karmadactl
curl -L https://github.com/karmada-io/karmada/releases/download/v1.7.0-alpha.3/crds.tar.gz -o crds.tar.gz
karmadactl init --kube-image-mirror-country=cn --crds ./crds.tar.gz

but still has some problem: image

It seems lack of git tag info locally. You can use git tag <version> to add a new tag and then build it.

Thanks~

@zhy76
Copy link
Member Author

zhy76 commented Aug 15, 2023

I have tested on my side:

git tag v1.7.0-alpha.3-60-g749f3843
hack/cli-testing-environment.sh
export KUBECONFIG="/root/karmada/karmada-apiserver.config”

image
karmada-edit:
image
karmada-view:
image
edit:
image
view:
image
admin:
image

@XiShanYongYe-Chang
Copy link
Member

Hi @zhy76, is it ready to review?

@zhy76
Copy link
Member Author

zhy76 commented Aug 16, 2023

Hi @zhy76, is it ready to review?

Yes

@XiShanYongYe-Chang
Copy link
Member

/assign

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~
/lgtm
/cc @lonelyCZ

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2023
@Vacant2333
Copy link
Contributor

if karmadactl deinit need to delete these rbac resources?

@XiShanYongYe-Chang
Copy link
Member

if karmadactl deinit need to delete these rbac resources?

Good question. My understanding is that when calling deinit, it will be accompanied by the removal of the Karmada control plane, and these resources will also disappear. Ask @zhy76 to help confirm this again.

@zhy76
Copy link
Member Author

zhy76 commented Aug 18, 2023

if karmadactl deinit need to delete these rbac resources?

Good question. My understanding is that when calling deinit, it will be accompanied by the removal of the Karmada control plane, and these resources will also disappear. Ask @zhy76 to help confirm this again.

Yes, what I understand is that the karmada control plane saves the clusterrole in karmada's etcd, and after doing deinit, karmada's etcd will be deleted, which will delete the clusterrole.

@XiShanYongYe-Chang
Copy link
Member

/cc @lonelyCZ @RainbowMango

@XiShanYongYe-Chang
Copy link
Member

/kind feature

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 19, 2023
@RainbowMango RainbowMango added this to the v1.7 milestone Aug 21, 2023
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.

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2023
@karmada-bot karmada-bot merged commit 5135e8f into karmada-io:master Aug 25, 2023
12 checks passed
@zhy76 zhy76 deleted the rbac branch August 25, 2023 09:22
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/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.

None yet

8 participants