From fe7248a81b895e490f0a303b50a4a18aabc2848f Mon Sep 17 00:00:00 2001 From: Alex Vulaj Date: Tue, 24 Nov 2026 10:00:45 -0500 Subject: [PATCH 1/3] Skip image tag lookup when operator deployment is disabled --- cmd/deploy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/deploy.go b/cmd/deploy.go index a0a9a5e0..d6556cc2 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -271,6 +271,8 @@ func runDeploy(cmd *cobra.Command, args []string) error { if deploySettings.Roxie.Version != "" { log.Dimf("Using main image tag %s", deploySettings.Roxie.Version) + } else if deploySettings.Operator.SkipDeploymentEnabled() { + log.Dim("Skipping main image tag lookup because operator deployment is disabled") } else { mainImageTag, err := helpers.LookupMainImageTag(ctx, deploySettings.Roxie.ImageRegistry) if err != nil { From 184d9aee002c8039d92e47196616addedef3ad08 Mon Sep 17 00:00:00 2001 From: Alex Vulaj Date: Tue, 24 Nov 2026 10:39:44 -0500 Subject: [PATCH 2/3] Skip image tag lookup only when unused --- cmd/deploy.go | 20 ++++++++++++- cmd/deploy_test.go | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index d6556cc2..4eb01470 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -236,6 +236,24 @@ this flag can be used to tell roxie how to pre-load images for the current clust return cmd } +// canSkipMainImageTagLookup reports whether no requested deployment behavior needs the main tag. +func canSkipMainImageTagLookup(components component.Component, config deployer.Config) bool { + if !config.Operator.SkipDeploymentEnabled() { + return false + } + if components.IncludesCentral() && !config.Central.EarlyReadinessEnabled() && config.CentralVersion() == "" { + return false + } + if components.IncludesSensor() && !config.SecuredCluster.EarlyReadinessEnabled() && config.SecuredClusterVersion() == "" { + return false + } + if config.Roxie.ClusterType.IsLocal() && !config.Roxie.KonfluxImagesEnabled() && + (config.CentralVersion() == "" || config.SecuredClusterVersion() == "") { + return false + } + return true +} + func runDeploy(cmd *cobra.Command, args []string) error { if !dryRun { if err := env.Initialize(); err != nil { @@ -271,7 +289,7 @@ func runDeploy(cmd *cobra.Command, args []string) error { if deploySettings.Roxie.Version != "" { log.Dimf("Using main image tag %s", deploySettings.Roxie.Version) - } else if deploySettings.Operator.SkipDeploymentEnabled() { + } else if canSkipMainImageTagLookup(components, deploySettings) { log.Dim("Skipping main image tag lookup because operator deployment is disabled") } else { mainImageTag, err := helpers.LookupMainImageTag(ctx, deploySettings.Roxie.ImageRegistry) diff --git a/cmd/deploy_test.go b/cmd/deploy_test.go index afc6cda4..966c1e24 100644 --- a/cmd/deploy_test.go +++ b/cmd/deploy_test.go @@ -352,6 +352,76 @@ roxie: } } +func TestCanSkipMainImageTagLookup(t *testing.T) { + tests := []struct { + name string + components component.Component + configure func(*deployer.Config) + want bool + }{ + { + name: "skip when operator is disabled and no other consumer needs the tag", + components: component.Central, + configure: func(config *deployer.Config) { + config.Operator.SkipDeployment = new(true) + }, + want: true, + }, + { + name: "do not skip when operator deployment is enabled", + components: component.Central, + want: false, + }, + { + name: "keep tag for central early-readiness validation", + components: component.Central, + configure: func(config *deployer.Config) { + config.Operator.SkipDeployment = new(true) + config.Central.EarlyReadiness = new(false) + }, + want: false, + }, + { + name: "keep tag for secured-cluster early-readiness validation", + components: component.SecuredCluster, + configure: func(config *deployer.Config) { + config.Operator.SkipDeployment = new(true) + config.SecuredCluster.EarlyReadiness = new(false) + }, + want: false, + }, + { + name: "keep tag for local image preloading", + components: component.Central, + configure: func(config *deployer.Config) { + config.Operator.SkipDeployment = new(true) + config.Roxie.ClusterType = types.ClusterTypeKind + }, + want: false, + }, + { + name: "skip local image preload when all operator versions are configured", + components: component.Central, + configure: func(config *deployer.Config) { + config.Operator.SkipDeployment = new(true) + config.Operator.Version = imagetag.MainTag("4.10.0") + config.Roxie.ClusterType = types.ClusterTypeKind + }, + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + config := deployer.DefaultConfig() + if tt.configure != nil { + tt.configure(&config) + } + assert.Equal(t, tt.want, canSkipMainImageTagLookup(tt.components, config)) + }) + } +} + // TestNewDeployCmd_ConfigMergePreservesEnvVars verifies that spec.customize.envVars // from multiple --config files and --set expressions are merged by name rather // than silently replaced. Overlapping names should use the last-specified value; From 6781439d79e826e364265d95a317fd2e11b4ca7b Mon Sep 17 00:00:00 2001 From: Alex Vulaj Date: Tue, 24 Nov 2026 10:53:07 -0500 Subject: [PATCH 3/3] Resolve cluster type before skipping tag lookup --- cmd/deploy.go | 17 ++++++++++++----- cmd/deploy_test.go | 10 ++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index 4eb01470..9a324a88 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -254,6 +254,16 @@ func canSkipMainImageTagLookup(components component.Component, config deployer.C return true } +func ensureClusterType(config *deployer.Config, detect func() types.ClusterType) { + if config.Roxie.ClusterType != "" { + return + } + + clusterType := detect() + log.Dimf("Detected cluster type: %v", clusterType) + config.Roxie.ClusterType = clusterType +} + func runDeploy(cmd *cobra.Command, args []string) error { if !dryRun { if err := env.Initialize(); err != nil { @@ -283,6 +293,7 @@ func runDeploy(cmd *cobra.Command, args []string) error { if err != nil { return err } + ensureClusterType(&deploySettings, env.GetAutoDetectedClusterType) ctx, cancel := context.WithTimeout(context.Background(), computeDeployContextTimeout(components, deploySettings)) defer cancel() @@ -485,11 +496,7 @@ func retrieveClusterConfigForComponents( } func configureConfig(components component.Component, deploySettings *deployer.Config) error { - if deploySettings.Roxie.ClusterType == "" { - clusterType := env.GetAutoDetectedClusterType() - log.Dimf("Detected cluster type: %v", clusterType) - deploySettings.Roxie.ClusterType = clusterType - } + ensureClusterType(deploySettings, env.GetAutoDetectedClusterType) clusterType := deploySettings.Roxie.ClusterType centralDeployLocally := components.IncludesCentral() && clusterType.IsLocal() sensorDeployLocally := components.IncludesSensor() && clusterType.IsLocal() diff --git a/cmd/deploy_test.go b/cmd/deploy_test.go index 966c1e24..6dc97e51 100644 --- a/cmd/deploy_test.go +++ b/cmd/deploy_test.go @@ -422,6 +422,16 @@ func TestCanSkipMainImageTagLookup(t *testing.T) { } } +func TestCanSkipMainImageTagLookupWithAutoDetectedLocalCluster(t *testing.T) { + config := deployer.DefaultConfig() + config.Operator.SkipDeployment = new(true) + ensureClusterType(&config, func() types.ClusterType { + return types.ClusterTypeKind + }) + + assert.False(t, canSkipMainImageTagLookup(component.Central, config)) +} + // TestNewDeployCmd_ConfigMergePreservesEnvVars verifies that spec.customize.envVars // from multiple --config files and --set expressions are merged by name rather // than silently replaced. Overlapping names should use the last-specified value;