From 3dc4832b06b7fab17b3311098f72044f00c1f6f7 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Thu, 16 Jul 2026 13:59:16 +0100 Subject: [PATCH 1/2] Skip version checks when self-upgrade is disabled --- cmd/topo/health.go | 9 ++++++++- cmd/topo/upgrade.go | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/topo/health.go b/cmd/topo/health.go index 5fbc20d0..be36b21d 100644 --- a/cmd/topo/health.go +++ b/cmd/topo/health.go @@ -17,7 +17,10 @@ const ( skipVersionChecksFlag = "skip-version-checks" ) -const skipVersionChecksEnvVar = "TOPO_SKIP_VERSION_CHECKS" +const ( + skipVersionChecksEnvVar = "TOPO_SKIP_VERSION_CHECKS" + disableSelfUpgradeEnvVar = "TOPO_DISABLE_SELF_UPGRADE" +) var healthCmd = &cobra.Command{ Use: "health", @@ -76,6 +79,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..904fedb6 100644 --- a/cmd/topo/upgrade.go +++ b/cmd/topo/upgrade.go @@ -55,7 +55,6 @@ func init() { } func isSelfUpgradeDisabled() bool { - const disableSelfUpgradeEnvVar = "TOPO_DISABLE_SELF_UPGRADE" if env.IsVarTruthy(disableSelfUpgradeEnvVar) { return true } From cfddf4a7a38ac8c28d209797164b76a614a3c494 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Thu, 16 Jul 2026 14:24:51 +0100 Subject: [PATCH 2/2] Keep self-upgrade environment constant with upgrade command --- cmd/topo/health.go | 5 +---- cmd/topo/upgrade.go | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/topo/health.go b/cmd/topo/health.go index be36b21d..bd8136a3 100644 --- a/cmd/topo/health.go +++ b/cmd/topo/health.go @@ -17,10 +17,7 @@ const ( skipVersionChecksFlag = "skip-version-checks" ) -const ( - skipVersionChecksEnvVar = "TOPO_SKIP_VERSION_CHECKS" - disableSelfUpgradeEnvVar = "TOPO_DISABLE_SELF_UPGRADE" -) +const skipVersionChecksEnvVar = "TOPO_SKIP_VERSION_CHECKS" var healthCmd = &cobra.Command{ Use: "health", diff --git a/cmd/topo/upgrade.go b/cmd/topo/upgrade.go index 904fedb6..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",