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

[Backport release-v1.4] fix: yurtadm join ignorePreflightErrors could not set all #1954

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/yurtadm/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func runConfigPrintActionDefaults(out io.Writer, configBytesProc func() (string,

func getDefaultNodeConfigBytes() (string, error) {
KubeadmJoinDiscoveryFilePath := filepath.Join(constants.KubeletWorkdir, constants.KubeadmJoinDiscoveryFileName)
ignoreErrors := sets.String{}
ignoreErrors := sets.NewString(constants.KubeletConfFileAvailableError, constants.ManifestsDirAvailableError)
name, err := edgenode.GetHostname("")
if err != nil {
return "", err
Expand Down
3 changes: 3 additions & 0 deletions pkg/yurtadm/cmd/join/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ func newJoinData(args []string, opt *joinOptions) (*joinData, error) {
for i := range opt.ignorePreflightErrors {
ignoreErrors.Insert(opt.ignorePreflightErrors[i])
}
if !ignoreErrors.Has("all") {
ignoreErrors.Insert(yurtconstants.KubeletConfFileAvailableError, yurtconstants.ManifestsDirAvailableError)
}

// Either use specified nodename or get hostname from OS envs
name, err := edgenode.GetHostname(opt.nodeName)
Expand Down
5 changes: 3 additions & 2 deletions pkg/yurtadm/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ const (
// StaticPods flag set the specified static pods on this node want to install
StaticPods = "static-pods"

KubeletConfFileAvailableError = "FileAvailable--etc-kubernetes-kubelet.conf"
ManifestsDirAvailableError = "DirAvailable--etc-kubernetes-manifests"

DefaultServerAddr = "https://127.0.0.1:6443"
ServerHealthzServer = "127.0.0.1:10267"
ServerHealthzURLPath = "/v1/healthz"
Expand Down Expand Up @@ -178,8 +181,6 @@ nodeRegistration:
criSocket: {{.criSocket}}
name: {{.name}}
ignorePreflightErrors:
- FileAvailable--etc-kubernetes-kubelet.conf
- DirAvailable--etc-kubernetes-manifests
{{- range $index, $value := .ignorePreflightErrors}}
- {{$value}}
{{- end}}
Expand Down