@@ -201,17 +201,6 @@ func NewRuntimeInstallCommand() *cobra.Command {
201201 return fmt .Errorf ("invalid access-mode %s, must be one of: ingress|tunnel" , accessMode )
202202 }
203203
204- if installationOpts .AccessMode == platmodel .AccessModeTunnel {
205- installationOpts .featuresToInstall = append (installationOpts .featuresToInstall , runtime .InstallFeatureIngressless )
206- accountId , err := cfConfig .GetCurrentContext ().GetAccountId (ctx )
207- if err != nil {
208- return fmt .Errorf ("failed creating ingressHost for tunnel: %w" , err )
209- }
210-
211- installationOpts .TunnelSubdomain = fmt .Sprintf ("%s-%s" , accountId , installationOpts .RuntimeName )
212- installationOpts .IngressHost = fmt .Sprintf ("https://%s.%s" , installationOpts .TunnelSubdomain , installationOpts .TunnelDomain )
213- }
214-
215204 err := runtimeInstallCommandPreRunHandler (cmd , installationOpts )
216205 handleCliStep (reporter .InstallPhasePreCheckFinish , "Finished pre installation checks" , err , true , false )
217206 if err != nil {
@@ -222,21 +211,22 @@ func NewRuntimeInstallCommand() *cobra.Command {
222211 return util .DecorateErrorWithDocsLink (fmt .Errorf ("pre installation error: %w" , err ), store .Get ().RequirementsLink )
223212 }
224213
225- if installationOpts .runtimeDef == "" {
226- installationOpts .runtimeDef = runtime .GetRuntimeDefURL (installationOpts .versionStr )
227- }
228-
229214 finalParameters = map [string ]string {
230215 "Codefresh context" : cfConfig .CurrentContext ,
231216 "Kube context" : installationOpts .kubeContext ,
232217 "Runtime name" : installationOpts .RuntimeName ,
233218 "Repository URL" : installationOpts .InsCloneOpts .Repo ,
234- "Ingress host" : installationOpts .IngressHost ,
235219 "Ingress class" : installationOpts .IngressClass ,
236- "Internal ingress host" : installationOpts .InternalIngressHost ,
237220 "Installing demo resources" : strconv .FormatBool (installationOpts .InstallDemoResources ),
238221 }
239222
223+ if installationOpts .AccessMode == platmodel .AccessModeTunnel {
224+ finalParameters ["Tunnel URL" ] = installationOpts .IngressHost
225+ } else {
226+ finalParameters ["Ingress host" ] = installationOpts .IngressHost
227+ finalParameters ["Internal ingress host" ] = installationOpts .InternalIngressHost
228+ }
229+
240230 if err := getApprovalFromUser (ctx , finalParameters , "runtime install" ); err != nil {
241231 return err
242232 }
@@ -339,6 +329,14 @@ func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, opts *RuntimeInstall
339329 if opts .AccessMode == platmodel .AccessModeTunnel {
340330 handleCliStep (reporter .InstallStepPreCheckEnsureIngressClass , "-skipped (ingressless)-" , err , true , false )
341331 handleCliStep (reporter .InstallStepPreCheckEnsureIngressHost , "-skipped (ingressless)-" , err , true , false )
332+ opts .featuresToInstall = append (opts .featuresToInstall , runtime .InstallFeatureIngressless )
333+ accountId , err := cfConfig .GetCurrentContext ().GetAccountId (ctx )
334+ if err != nil {
335+ return fmt .Errorf ("failed creating ingressHost for tunnel: %w" , err )
336+ }
337+
338+ opts .TunnelSubdomain = fmt .Sprintf ("%s-%s" , accountId , opts .RuntimeName )
339+ opts .IngressHost = fmt .Sprintf ("https://%s.%s" , opts .TunnelSubdomain , opts .TunnelDomain )
342340 } else {
343341 err = ensureRoutingControllerSupported (ctx , opts )
344342 handleCliStep (reporter .InstallStepPreCheckEnsureIngressClass , "Getting ingress class" , err , true , false )
@@ -387,6 +385,10 @@ func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, opts *RuntimeInstall
387385 log .G (ctx ).Infof ("using repo '%s' as shared config repo for this account" , sharedConfigRepo )
388386 }
389387
388+ if opts .runtimeDef == "" {
389+ opts .runtimeDef = runtime .GetRuntimeDefURL (opts .versionStr )
390+ }
391+
390392 opts .Insecure = true // installs argo-cd in insecure mode, we need this so that the eventsource can talk to the argocd-server with http
391393 opts .CommonConfig = & runtime.CommonConfig {CodefreshBaseURL : cfConfig .GetCurrentContext ().URL }
392394
0 commit comments