diff --git a/cmd/topo/health.go b/cmd/topo/health.go index 5fbc20d0..bd8136a3 100644 --- a/cmd/topo/health.go +++ b/cmd/topo/health.go @@ -76,6 +76,10 @@ func init() { } func resolveSkipVersionChecks(cmd *cobra.Command) bool { + if env.IsVarTruthy(disableSelfUpgradeEnvVar) { + return true + } + if !cmd.Flags().Changed(skipVersionChecksFlag) { return env.IsVarTruthy(skipVersionChecksEnvVar) } diff --git a/cmd/topo/upgrade.go b/cmd/topo/upgrade.go index c234ac36..5d5cfe4e 100644 --- a/cmd/topo/upgrade.go +++ b/cmd/topo/upgrade.go @@ -11,6 +11,8 @@ import ( "github.com/spf13/cobra" ) +const disableSelfUpgradeEnvVar = "TOPO_DISABLE_SELF_UPGRADE" + var upgradeCmd = &cobra.Command{ Use: "upgrade", Short: "Upgrade topo to the latest version", @@ -55,7 +57,6 @@ func init() { } func isSelfUpgradeDisabled() bool { - const disableSelfUpgradeEnvVar = "TOPO_DISABLE_SELF_UPGRADE" if env.IsVarTruthy(disableSelfUpgradeEnvVar) { return true }