Skip to content

Commit b061291

Browse files
authored
Add a hidden ignored --disable-upgrade-check flag (#708)
Signed-off-by: Kimmo Lehto <[email protected]>
1 parent b9a9e2e commit b061291

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

cmd/apply.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ var applyCommand = &cli.Command{
5555
redactFlag,
5656
retryIntervalFlag,
5757
retryTimeoutFlag,
58+
ignoredUpgradeCheckFlag,
5859
analyticsFlag,
5960
},
6061
Before: actions(initLogging, initConfig, initManager, displayLogo, initAnalytics, displayCopyright, warnOldCache),

cmd/flags.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ import (
2727
"gopkg.in/yaml.v2"
2828
)
2929

30-
type ctxConfigKey struct{}
31-
type ctxManagerKey struct{}
32-
type ctxLogFileKey struct{}
30+
type (
31+
ctxConfigKey struct{}
32+
ctxManagerKey struct{}
33+
ctxLogFileKey struct{}
34+
)
3335

3436
var (
3537
debugFlag = &cli.BoolFlag{
@@ -72,6 +74,13 @@ var (
7274
EnvVars: []string{"DISABLE_TELEMETRY"},
7375
}
7476

77+
ignoredUpgradeCheckFlag = &cli.BoolFlag{
78+
Name: "disable-upgrade-check",
79+
Usage: "Do not check for a k0sctl upgrade",
80+
EnvVars: []string{"DISABLE_UPGRADE_CHECK"},
81+
Hidden: true,
82+
}
83+
7584
concurrencyFlag = &cli.IntFlag{
7685
Name: "concurrency",
7786
Usage: "Maximum number of hosts to configure in parallel, set to 0 for unlimited",
@@ -288,7 +297,7 @@ func LogFile() (*os.File, error) {
288297
}
289298
}
290299

291-
logFile, err := os.OpenFile(fn, os.O_RDWR|os.O_CREATE|os.O_APPEND|os.O_SYNC, 0600)
300+
logFile, err := os.OpenFile(fn, os.O_RDWR|os.O_CREATE|os.O_APPEND|os.O_SYNC, 0o600)
292301
if err != nil {
293302
return nil, fmt.Errorf("Failed to open log %s: %s", fn, err.Error())
294303
}

cmd/reset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var resetCommand = &cli.Command{
2121
redactFlag,
2222
retryIntervalFlag,
2323
retryTimeoutFlag,
24+
ignoredUpgradeCheckFlag,
2425
analyticsFlag,
2526
&cli.BoolFlag{
2627
Name: "force",

0 commit comments

Comments
 (0)