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 taint uses factory to access cluster #2610

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

helen-frank
Copy link
Contributor

@helen-frank helen-frank commented Oct 3, 2022

What type of PR is this?
/kind feature

Which issue(s) this PR fixes:
Fixes #
Part of#2349
Special notes for your reviewer:
Test

go run ./cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config taint clusters kind-multi-node1 bar:NoSchedule
cluster/kind-multi-node1 tainted

kubectl --kubeconfig /etc/karmada/karmada-apiserver.config get clusters kind-multi-node1 -oyaml | grep -C 5 taints                                         
    namespace: karmada-cluster
  secretRef:
    name: kind-multi-node1
    namespace: karmada-cluster
  syncMode: Push
  taints:
  - effect: NoSchedule
    key: bar
status:
  apiEnablements:
  - groupVersion: admissionregistration.k8s.io/v1

go run ./cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config taint clusters kind-multi-node1 bar:NoSchedule-                                                       
cluster/kind-multi-node1 untainted

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 3, 2022
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 3, 2022
@helen-frank helen-frank force-pushed the feature/taintFactory branch 2 times, most recently from 5f347b5 to 3a795f1 Compare October 3, 2022 10:46
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2022

Codecov Report

Merging #2610 (2f34d1f) into master (05be79f) will increase coverage by 0.02%.
The diff coverage is 7.14%.

❗ Current head 2f34d1f differs from pull request most recent head 222663e. Consider uploading reports for the commit 222663e to get more accurate results

@@            Coverage Diff             @@
##           master    #2610      +/-   ##
==========================================
+ Coverage   23.81%   23.84%   +0.02%     
==========================================
  Files         184      184              
  Lines       18502    18488      -14     
==========================================
+ Hits         4407     4408       +1     
+ Misses      13749    13735      -14     
+ Partials      346      345       -1     
Flag Coverage Δ
unittests 23.84% <7.14%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
pkg/karmadactl/karmadactl.go 0.00% <0.00%> (ø)
pkg/karmadactl/taint.go 43.12% <7.69%> (+2.68%) ⬆️
pkg/search/proxy/store/util.go 53.80% <0.00%> (-1.17%) ⬇️
pkg/util/serviceaccount.go 50.00% <0.00%> (+4.16%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

flags.BoolVar(&o.overwrite, "overwrite", o.overwrite, "If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.")
flags.BoolVar(&o.DryRun, "dry-run", false, "Run the command in dry-run mode, without making any server requests.")
flags.StringVar(defaultConfigFlags.KubeConfig, "kubeconfig", *defaultConfigFlags.KubeConfig, "Path to the kubeconfig file to use for CLI requests.")
Copy link
Member

Choose a reason for hiding this comment

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

As @jwcesign comment on https://github.com/karmada-io/karmada/pull/2611/files
Can we extract these duplicated codes ? @carlory

@wuyingjun-lucky
Copy link
Member

It works well on my side
image

@carlory
Copy link
Member

carlory commented Oct 10, 2022

thanks, I will review it tomorrow.

@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 16, 2022
@helen-frank helen-frank reopened this Oct 16, 2022
@helen-frank helen-frank force-pushed the feature/taintFactory branch 2 times, most recently from ed161ed to 3a795f1 Compare October 16, 2022 16:42
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 16, 2022
@karmada-bot karmada-bot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Oct 16, 2022
@lonelyCZ
Copy link
Member

Hi, @helen-frank , please rebase it.

/assign

Signed-off-by: helen <helenfrank@protonmail.com>
@helen-frank
Copy link
Contributor Author

/cc @lonelyCZ

@lonelyCZ
Copy link
Member

Thanks @helen-frank , It works fine in my env.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2022
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lonelyCZ

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 Oct 24, 2022
@karmada-bot karmada-bot merged commit 5a1addf into karmada-io:master Oct 24, 2022
@helen-frank helen-frank deleted the feature/taintFactory branch October 24, 2022 02:59
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

6 participants