Skip to content

Commit

Permalink
Use "true" as value for "--enable-worker"
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Dec 2, 2024
1 parent a256577 commit 3b02c56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (h *Host) K0sInstallFlags() (Flags, error) {

switch h.Role {
case "controller+worker":
flags.AddUnlessExist("--enable-worker")
flags.AddUnlessExist("--enable-worker=true")
if h.NoTaints {
flags.AddUnlessExist("--no-taints")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ func TestK0sInstallCommand(t *testing.T) {
h.Metadata.IsK0sLeader = true
cmd, err = h.K0sInstallCommand()
require.NoError(t, err)
require.Equal(t, `k0s install controller --data-dir=/tmp/k0s --enable-worker --config=from-configurer`, cmd)
require.Equal(t, `k0s install controller --data-dir=/tmp/k0s --enable-worker=true --config=from-configurer`, cmd)

h.Metadata.IsK0sLeader = false
cmd, err = h.K0sInstallCommand()
require.NoError(t, err)
require.Equal(t, `k0s install controller --data-dir=/tmp/k0s --enable-worker --token-file=from-configurer --config=from-configurer`, cmd)
require.Equal(t, `k0s install controller --data-dir=/tmp/k0s --enable-worker=true --token-file=from-configurer --config=from-configurer`, cmd)

h.Role = "worker"
h.PrivateAddress = "10.0.0.9"
Expand Down

0 comments on commit 3b02c56

Please sign in to comment.