Skip to content

Commit 1353d86

Browse files
committed
Expose status sub-command on all platforms
Signed-off-by: Kimmo Lehto <[email protected]>
1 parent aa58d71 commit 1353d86

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

cmd/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/k0sproject/k0s/cmd/kubeconfig"
1616
"github.com/k0sproject/k0s/cmd/kubectl"
1717
"github.com/k0sproject/k0s/cmd/start"
18+
"github.com/k0sproject/k0s/cmd/status"
1819
"github.com/k0sproject/k0s/cmd/stop"
1920
"github.com/k0sproject/k0s/cmd/sysinfo"
2021
"github.com/k0sproject/k0s/cmd/token"
@@ -46,6 +47,7 @@ func NewRootCmd() *cobra.Command {
4647
cmd.AddCommand(kubectl.NewK0sKubectlCmd())
4748
cmd.AddCommand(start.NewStartCmd())
4849
cmd.AddCommand(stop.NewStopCmd())
50+
cmd.AddCommand(status.NewStatusCmd())
4951
cmd.AddCommand(sysinfo.NewSysinfoCmd())
5052
cmd.AddCommand(token.NewTokenCmd())
5153
cmd.AddCommand(validate.NewValidateCmd()) // hidden+deprecated

cmd/root_linux.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/k0sproject/k0s/cmd/keepalived"
1010
"github.com/k0sproject/k0s/cmd/reset"
1111
"github.com/k0sproject/k0s/cmd/restore"
12-
"github.com/k0sproject/k0s/cmd/status"
1312

1413
"github.com/spf13/cobra"
1514
)
@@ -20,5 +19,4 @@ func addPlatformSpecificCommands(root *cobra.Command) {
2019
root.AddCommand(keepalived.NewKeepalivedSetStateCmd()) // hidden
2120
root.AddCommand(reset.NewResetCmd())
2221
root.AddCommand(restore.NewRestoreCmd())
23-
root.AddCommand(status.NewStatusCmd())
2422
}

cmd/status/status.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build unix
2-
31
// SPDX-FileCopyrightText: 2021 k0s authors
42
// SPDX-License-Identifier: Apache-2.0
53

@@ -51,7 +49,7 @@ func NewStatusCmd() *cobra.Command {
5149

5250
pflags := cmd.PersistentFlags()
5351
debugFlags.AddToFlagSet(pflags)
54-
pflags.String("status-socket", "", "Full file path to the socket file. (default: <rundir>/status.sock)")
52+
pflags.String("status-socket", "", "Full path to the k0s status socket (default: <rundir>/status.sock, converted to a named pipe on Windows)")
5553

5654
cmd.AddCommand(NewStatusSubCmdComponents())
5755

0 commit comments

Comments
 (0)