@@ -180,6 +180,7 @@ func (cfg renderConfig) validate(lane signoffLane) error {
180180}
181181
182182func renderToolConfig (cfg renderConfig , lane signoffLane ) string {
183+ rancherDistro := rancherDistroForLane (cfg .RancherDistro , lane )
183184 return fmt .Sprintf (`rancher:
184185 mode: auto
185186 version: %s
@@ -211,7 +212,7 @@ tf_vars:
211212 aws_route53_fqdn: %s
212213` ,
213214 yamlQuote (strings .TrimPrefix (lane .InstallRancher , "v" )),
214- yamlQuote (cfg . RancherDistro ),
215+ yamlQuote (rancherDistro ),
215216 yamlQuote (cfg .BootstrapPassword ),
216217 cfg .AutoApprove ,
217218 cfg .PreloadImages ,
@@ -232,6 +233,17 @@ tf_vars:
232233 )
233234}
234235
236+ func rancherDistroForLane (configured string , lane signoffLane ) string {
237+ configured = strings .TrimSpace (configured )
238+ if strings .EqualFold (configured , "auto" ) && strings .TrimSpace (lane .UpgradeToRancher ) != "" {
239+ // Keep the upgrade on one distribution. Otherwise auto mode installs the
240+ // released baseline from Prime but resolves prerelease targets from the
241+ // community repos, carrying Prime's system registry into the RC webhook.
242+ return "community"
243+ }
244+ return configured
245+ }
246+
235247func renderEnvOutput (plan signoffPlan , lane signoffLane ) (string , error ) {
236248 var b strings.Builder
237249 if err := writeGitHubEnvLine (& b , "TF_STATE_KEY" , lane .TerraformStateKey ); err != nil {
0 commit comments