-
Notifications
You must be signed in to change notification settings - Fork 68
Add preflight checks #250
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
Add preflight checks #250
Conversation
Signed-off-by: Bowen Zhu <Promacanthus@gmail.com>
Signed-off-by: Bowen Zhu <Promacanthus@gmail.com>
|
@yue9944882 @ycyaoxdu Please review it when you have time. |
|
/assign @ycyaoxdu |
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.
My Apology for the delay, and thanks a lot for contributing! @promacanthus
preflight is not a command to use, so we can not just put it into pkg/cmd, since it is used in command init, shall we make it a subdirectory of pkg/cmd/init?
| name: ocm-hub | ||
| current-context: ocm-hub | ||
| users: | ||
| - name: user-admin No newline at end of file |
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.
No new line at end of file
| name: ocm-hub | ||
| current-context: ocm-hub | ||
| users: | ||
| - name: user-admin No newline at end of file |
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.
No new line at end of file
| func (f *ClusteradmFlags) AddFlags(flags *pflag.FlagSet) { | ||
| flags.BoolVar(&f.DryRun, "dry-run", false, "If set the generated resources will be displayed but not applied") | ||
| flags.IntVar(&f.Timeout, "timeout", 300, "extend timeout from 300 secounds ") | ||
| flags.StringVar(&f.Context, "context", "", "The name of the kubeconfig context to use") |
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.
kubectl have already provide a flag --context to specify which context to use, maybe you can't use the flag context here? wondering whether this will override the kubectl flag? or do we need to do something to handle this?
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.
kubectlhave already provide a flag--contextto specify which context to use, maybe you can't use the flagcontexthere? wondering whether this will override the kubectl flag? or do we need to do something to handle this?
I did not think about that before. I think we can get context from kubectl flag --context.
Agreed with you, I will move it into |
Signed-off-by: Bowen Zhu <Promacanthus@gmail.com>
ycyaoxdu
left a comment
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.
/lgtm
|
looks good to me, any suggestions? @qiujian16 |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Promacanthus, qiujian16, ycyaoxdu 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 |
When we install a cluster by
kubeadm, the deployment tool will create thecluster-infoConfigMap in thekube-publicnamespace.However, in some cases, there is no
cluster-infoConfigMap in thekube-publicnamespace.Under this scenario, the loss of ConfigMap will fail to register managed cluster to hub, and got the following error message.
can not find the cluster in the cluster-infoTo resolve this problem, we can do some preflight checks, and print some useful information.
This commit adds two preflight checks:
cluster-infoConfigMap exists in thekube-publicnamespace or not.Signed-off-by: Bowen Zhu Promacanthus@gmail.com