Skip to content

Commit

Permalink
Add a hidden ignored --disable-upgrade-check flag (#708)
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed May 10, 2024
1 parent b9a9e2e commit b061291
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var applyCommand = &cli.Command{
redactFlag,
retryIntervalFlag,
retryTimeoutFlag,
ignoredUpgradeCheckFlag,
analyticsFlag,
},
Before: actions(initLogging, initConfig, initManager, displayLogo, initAnalytics, displayCopyright, warnOldCache),
Expand Down
17 changes: 13 additions & 4 deletions cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ import (
"gopkg.in/yaml.v2"
)

type ctxConfigKey struct{}
type ctxManagerKey struct{}
type ctxLogFileKey struct{}
type (
ctxConfigKey struct{}
ctxManagerKey struct{}
ctxLogFileKey struct{}
)

var (
debugFlag = &cli.BoolFlag{
Expand Down Expand Up @@ -72,6 +74,13 @@ var (
EnvVars: []string{"DISABLE_TELEMETRY"},
}

ignoredUpgradeCheckFlag = &cli.BoolFlag{
Name: "disable-upgrade-check",
Usage: "Do not check for a k0sctl upgrade",
EnvVars: []string{"DISABLE_UPGRADE_CHECK"},
Hidden: true,
}

concurrencyFlag = &cli.IntFlag{
Name: "concurrency",
Usage: "Maximum number of hosts to configure in parallel, set to 0 for unlimited",
Expand Down Expand Up @@ -288,7 +297,7 @@ func LogFile() (*os.File, error) {
}
}

logFile, err := os.OpenFile(fn, os.O_RDWR|os.O_CREATE|os.O_APPEND|os.O_SYNC, 0600)
logFile, err := os.OpenFile(fn, os.O_RDWR|os.O_CREATE|os.O_APPEND|os.O_SYNC, 0o600)
if err != nil {
return nil, fmt.Errorf("Failed to open log %s: %s", fn, err.Error())
}
Expand Down
1 change: 1 addition & 0 deletions cmd/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var resetCommand = &cli.Command{
redactFlag,
retryIntervalFlag,
retryTimeoutFlag,
ignoredUpgradeCheckFlag,
analyticsFlag,
&cli.BoolFlag{
Name: "force",
Expand Down

0 comments on commit b061291

Please sign in to comment.