-
Notifications
You must be signed in to change notification settings - Fork 828
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
Introduce --kube-image-mirror-country
and kube-image-registry
to karmadactl init
#1764
Conversation
/assign @lonelyCZ |
/assign @prodanlabs |
9691281
to
93267b7
Compare
@lonelyCZ help to review |
@wuyingjun-lucky: GitHub didn't allow me to request PR reviews from the following users: review, to. Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
Ok, I will review it today. |
pkg/karmadactl/cmdinit/cmdinit.go
Outdated
@@ -18,7 +18,7 @@ const ( | |||
|
|||
// NewCmdInit install karmada on kubernetes | |||
func NewCmdInit(cmdOut io.Writer, parentCommand string) *cobra.Command { | |||
opts := kubernetes.CommandInitOption{} | |||
opts := &kubernetes.CommandInitOption{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using &
?
return imageRepositories["global"] | ||
} | ||
|
||
// get kube api server image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// get kube api server image | |
// get kube-apiserver image |
@@ -71,6 +90,7 @@ type CommandInitOption struct { | |||
CertAndKeyFileData map[string][]byte | |||
RestConfig *rest.Config | |||
KarmadaAPIServerIP []net.IP | |||
FlagSet *pflag.FlagSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlagSet is not recommended as an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lonelyCZ help to review again
I want to know if the user had set the kubeapiserver image manally.
three ways I have thought :
1: paas flagset to option and tell deploy.go if user had set the kubeapiserver image manally ( not recommended)
2: https://github.com/karmada-io/karmada/pull/1764/files#:~:text=flags.StringVarP(%26opts.KarmadaAPIServerImage%2C%20%22karmada%2Dapiserver%2Dimage%22%2C%20%22%22%2C%20%22k8s.gcr.io/kube%2Dapiserver%3Av1.21.7%22%2C%20%22Kubernetes%20apiserver%20image%22)) set apiserver image default value == "" and we use default value to judge user had set the value (code push now )
3: add some options in opts like apiserverset . we set the apiserverset value by visit when flags init
93267b7
to
59ea0d1
Compare
59ea0d1
to
4089506
Compare
Yes, some users have their own image registry.
This is good and easy. We no longer need this default value. |
Ok, please review again @lonelyCZ |
@lonelyCZ |
I think so latter. |
d4e4cea
to
cd36747
Compare
The git commit message format is ok ? |
Thanks, it is ok to keep track of your contributions. |
I just tested it that worked fine. Just a little advice, rank the two new use cases to the front that are second and third.
|
Update pkg/karmadactl/cmdinit/kubernetes/deploy.go Co-authored-by: Zhe Cheng <47743202+lonelyCZ@users.noreply.github.com> Update pkg/karmadactl/cmdinit/cmdinit.go Co-authored-by: Zhe Cheng <47743202+lonelyCZ@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Zhe Cheng <47743202+lonelyCZ@users.noreply.github.com> Signed-off-by: wuyingjun <wuyingjun_yewu@cmss.chinamobile.com>
cd36747
to
78cb729
Compare
|
Thanks, @wuyingjun-lucky /lgtm |
/assign @RainbowMango |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[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 |
--kube-image-mirror-country
and kube-image-registry
to karmadactl init
Signed-off-by: wuyingjun wuyingjun_yewu@cmss.chinamobile.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
support kube-image-mirror-country and kube-image-registry
Which issue(s) this PR fixes:
Fixes #
#1753
Special notes for your reviewer:
Does this PR introduce a user-facing change?: