@@ -17,7 +17,6 @@ limitations under the License.
17
17
package cloudinit
18
18
19
19
import (
20
- "fmt"
21
20
"strings"
22
21
23
22
"github.com/pkg/errors"
@@ -54,27 +53,21 @@ func (a *runCmd) Commands() ([]provisioning.Cmd, error) {
54
53
return cmds , nil
55
54
}
56
55
57
- // ignorePreflightErrors are preflight errors that fail in CAPD and thus we have to ignore them.
58
- const ignorePreflightErrors = "SystemVerification,Swap,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables"
59
-
60
56
func hackKubeadmIgnoreErrors (c provisioning.Cmd ) provisioning.Cmd {
61
57
// case kubeadm commands are defined as a string
62
58
if c .Cmd == "/bin/sh" && len (c .Args ) >= 2 {
63
59
if c .Args [0 ] == "-c" {
64
- c .Args [1 ] = strings .Replace (c .Args [1 ], "kubeadm init" , fmt . Sprintf ( "kubeadm init --ignore-preflight-errors=%s" , ignorePreflightErrors ) , 1 )
65
- c .Args [1 ] = strings .Replace (c .Args [1 ], "kubeadm join" , fmt . Sprintf ( "kubeadm join --ignore-preflight-errors=%s" , ignorePreflightErrors ) , 1 )
60
+ c .Args [1 ] = strings .Replace (c .Args [1 ], "kubeadm init" , "kubeadm init --ignore-preflight-errors=all" , 1 )
61
+ c .Args [1 ] = strings .Replace (c .Args [1 ], "kubeadm join" , "kubeadm join --ignore-preflight-errors=all" , 1 )
66
62
}
67
63
}
68
64
69
65
// case kubeadm commands are defined as a list
70
66
if c .Cmd == "kubeadm" && len (c .Args ) >= 1 {
71
67
if c .Args [0 ] == "init" || c .Args [0 ] == "join" {
72
- // make space
73
- c .Args = append (c .Args , "" )
74
- // shift elements
75
- copy (c .Args [2 :], c .Args [1 :])
76
- // insert the additional arg
77
- c .Args [1 ] = fmt .Sprintf ("--ignore-preflight-errors=%s" , ignorePreflightErrors )
68
+ c .Args = append (c .Args , "" ) // make space
69
+ copy (c .Args [2 :], c .Args [1 :]) // shift elements
70
+ c .Args [1 ] = "--ignore-preflight-errors=all" // insert the additional arg
78
71
}
79
72
}
80
73
0 commit comments