@@ -347,11 +347,15 @@ func runDeploy(cmd *cobra.Command, args []string) error {
347347}
348348
349349func configureConfig (log * logger.Logger , components component.Component , deploySettings * deployer.Config ) error {
350- clusterType := env .GetCurrentClusterType ()
351- log .Dimf ("Detected cluster type: %v" , clusterType )
352- defaults , err := clusterdefaults .ApplyClusterDefaults (clusterType , deploySettings )
350+ if deploySettings .Roxie .ClusterType == types .ClusterTypeUnknown {
351+ clusterType := env .GetCurrentClusterType ()
352+ log .Dimf ("Detected cluster type: %v" , clusterType )
353+ deploySettings .Roxie .ClusterType = clusterType
354+ }
355+ clusterType := deploySettings .Roxie .ClusterType
356+ defaults , err := clusterdefaults .ApplyClusterDefaults (deploySettings )
353357 if err != nil {
354- return fmt . Errorf ( "applying defaults for cluster type %v: %w" , clusterType , err )
358+ return err
355359 }
356360 if verbose {
357361 log .Dimf ("Applying the following defaults based on detected cluster type %v:" , clusterType )
@@ -409,6 +413,8 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
409413 return errors .New ("running without a controlling terminal requires --envrc to be set" )
410414 }
411415
416+ clusterType := deploySettings .Roxie .ClusterType
417+
412418 if env .RunningInRoxieContainer {
413419 // For running containerized we have specific requirements.
414420 if deploySettings .Central .PortForwardingEnabled () {
@@ -419,7 +425,7 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
419425 }
420426
421427 // On infra OpenShift we already get image pull secrets for Quay automatically.
422- if clusterType := env . GetCurrentClusterType (); clusterType != types .ClusterTypeInfraOpenShift4 {
428+ if clusterType != types .ClusterTypeInfraOpenShift4 {
423429 if os .Getenv ("REGISTRY_USERNAME" ) == "" || os .Getenv ("REGISTRY_PASSWORD" ) == "" {
424430 return fmt .Errorf ("containerized mode requires REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables for clusters of type %s" , clusterType )
425431 }
@@ -437,7 +443,6 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
437443 if deploySettings .Operator .DeployViaOlm {
438444 return errors .New ("using Konflux images while deploying operator via OLM is not supported" )
439445 }
440- clusterType := env .GetCurrentClusterType ()
441446 if ! clusterType .IsOpenShift () {
442447 return fmt .Errorf ("--konflux flag is only supported on OpenShift 4 clusters (current cluster type: %s)" , clusterType .String ())
443448 }
0 commit comments