-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CR-15313-invalid-tunnel-url #632
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | ||
* [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION=v0.1.0 | ||
VERSION=v0.1.1 | ||
|
||
OUT_DIR=dist | ||
YEAR?=$(shell date +"%Y") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,17 +201,6 @@ func NewRuntimeInstallCommand() *cobra.Command { | |
return fmt.Errorf("invalid access-mode %s, must be one of: ingress|tunnel", accessMode) | ||
} | ||
|
||
if installationOpts.AccessMode == platmodel.AccessModeTunnel { | ||
installationOpts.featuresToInstall = append(installationOpts.featuresToInstall, runtime.InstallFeatureIngressless) | ||
accountId, err := cfConfig.GetCurrentContext().GetAccountId(ctx) | ||
if err != nil { | ||
return fmt.Errorf("failed creating ingressHost for tunnel: %w", err) | ||
} | ||
|
||
installationOpts.TunnelSubdomain = fmt.Sprintf("%s-%s", accountId, installationOpts.RuntimeName) | ||
installationOpts.IngressHost = fmt.Sprintf("https://%s.%s", installationOpts.TunnelSubdomain, installationOpts.TunnelDomain) | ||
} | ||
|
||
err := runtimeInstallCommandPreRunHandler(cmd, installationOpts) | ||
handleCliStep(reporter.InstallPhasePreCheckFinish, "Finished pre installation checks", err, true, false) | ||
if err != nil { | ||
|
@@ -222,21 +211,22 @@ func NewRuntimeInstallCommand() *cobra.Command { | |
return util.DecorateErrorWithDocsLink(fmt.Errorf("pre installation error: %w", err), store.Get().RequirementsLink) | ||
} | ||
|
||
if installationOpts.runtimeDef == "" { | ||
installationOpts.runtimeDef = runtime.GetRuntimeDefURL(installationOpts.versionStr) | ||
} | ||
|
||
finalParameters = map[string]string{ | ||
"Codefresh context": cfConfig.CurrentContext, | ||
"Kube context": installationOpts.kubeContext, | ||
"Runtime name": installationOpts.RuntimeName, | ||
"Repository URL": installationOpts.InsCloneOpts.Repo, | ||
"Ingress host": installationOpts.IngressHost, | ||
"Ingress class": installationOpts.IngressClass, | ||
"Internal ingress host": installationOpts.InternalIngressHost, | ||
"Installing demo resources": strconv.FormatBool(installationOpts.InstallDemoResources), | ||
} | ||
|
||
if installationOpts.AccessMode == platmodel.AccessModeTunnel { | ||
finalParameters["Tunnel URL"] = installationOpts.IngressHost | ||
} else { | ||
finalParameters["Ingress host"] = installationOpts.IngressHost | ||
finalParameters["Internal ingress host"] = installationOpts.InternalIngressHost | ||
} | ||
|
||
if err := getApprovalFromUser(ctx, finalParameters, "runtime install"); err != nil { | ||
return err | ||
} | ||
|
@@ -339,6 +329,14 @@ func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, opts *RuntimeInstall | |
if opts.AccessMode == platmodel.AccessModeTunnel { | ||
handleCliStep(reporter.InstallStepPreCheckEnsureIngressClass, "-skipped (ingressless)-", err, true, false) | ||
handleCliStep(reporter.InstallStepPreCheckEnsureIngressHost, "-skipped (ingressless)-", err, true, false) | ||
opts.featuresToInstall = append(opts.featuresToInstall, runtime.InstallFeatureIngressless) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. create tunnel ingressHost after runtimeName was supplied by user |
||
accountId, err := cfConfig.GetCurrentContext().GetAccountId(ctx) | ||
if err != nil { | ||
return fmt.Errorf("failed creating ingressHost for tunnel: %w", err) | ||
} | ||
|
||
opts.TunnelSubdomain = fmt.Sprintf("%s-%s", accountId, opts.RuntimeName) | ||
opts.IngressHost = fmt.Sprintf("https://%s.%s", opts.TunnelSubdomain, opts.TunnelDomain) | ||
} else { | ||
err = ensureRoutingControllerSupported(ctx, opts) | ||
handleCliStep(reporter.InstallStepPreCheckEnsureIngressClass, "Getting ingress class", err, true, false) | ||
|
@@ -387,6 +385,10 @@ func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, opts *RuntimeInstall | |
log.G(ctx).Infof("using repo '%s' as shared config repo for this account", sharedConfigRepo) | ||
} | ||
|
||
if opts.runtimeDef == "" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just feels better located in here |
||
opts.runtimeDef = runtime.GetRuntimeDefURL(opts.versionStr) | ||
} | ||
|
||
opts.Insecure = true // installs argo-cd in insecure mode, we need this so that the eventsource can talk to the argocd-server with http | ||
opts.CommonConfig = &runtime.CommonConfig{CodefreshBaseURL: cfConfig.GetCurrentContext().URL} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
display the correct summary