Skip to content

Commit 8e572a9

Browse files
committed
Fix duplicate --max-pods arguments in KUBELET_EXTRA_ARGS
Fixes #7946
1 parent 5f55c80 commit 8e572a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/nodebootstrap/managed_al2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func makeMaxPodsScript(maxPods int) string {
9191
script := `#!/bin/sh
9292
set -ex
9393
`
94-
script += fmt.Sprintf(`sed -i 's/KUBELET_EXTRA_ARGS=$2/KUBELET_EXTRA_ARGS="$2 --max-pods=%d"/' /etc/eks/bootstrap.sh`, maxPods)
94+
script += fmt.Sprintf(`sed -i 's/KUBELET_EXTRA_ARGS=$2/KUBELET_EXTRA_ARGS="$(echo "$2" | sed "s/--max-pods=[0-9]*//" | sed "s/ */ /g" | sed "s/^ *//" | sed "s/ *$//") --max-pods=%d"/' /etc/eks/bootstrap.sh`, maxPods)
9595
return script
9696
}
9797

pkg/nodebootstrap/managed_al2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Content-Type: charset="us-ascii"
109109
110110
#!/bin/sh
111111
set -ex
112-
sed -i 's/KUBELET_EXTRA_ARGS=$2/KUBELET_EXTRA_ARGS="$2 --max-pods=142"/' /etc/eks/bootstrap.sh
112+
sed -i 's/KUBELET_EXTRA_ARGS=$2/KUBELET_EXTRA_ARGS="$(echo "$2" | sed "s/--max-pods=[0-9]*//" | sed "s/ */ /g" | sed "s/^ *//" | sed "s/ *$//") --max-pods=142"/' /etc/eks/bootstrap.sh
113113
--//--
114114
`,
115115
}),

0 commit comments

Comments
 (0)