diff --git a/docs/content/docs/guide/cli.md b/docs/content/docs/guide/cli.md index 8429ff8f51..2cbcae07d4 100644 --- a/docs/content/docs/guide/cli.md +++ b/docs/content/docs/guide/cli.md @@ -124,9 +124,14 @@ option to install a webhook forwarder called [gosmee](https://github.com/chmouel/gosmee). This forwarder enables connectivity between the Pipelines-as-Code controller and GitHub without requiring an internet connection. In this scenario, it will set up a forwarding URL on - and set it up on GitHub. For OpenShift, it -will not prompt you unless you explicitly specify the `--force-gosmee` flag -(which can be useful if you are running [OpenShift Local](https://developers.redhat.com/products/openshift-local/overview) for instance). + and set it up on GitHub. + +On OpenShift, the bootstrap command automatically detects and uses OpenShift +Routes (as described above), and will not prompt you to use gosmee. If you need +to use gosmee instead (for example, when running [OpenShift +Local](https://developers.redhat.com/products/openshift-local/overview)), you +can explicitly specify the `--force-gosmee` flag to bypass the OpenShift Route +detection and force the use of gosmee. gosmee should not be used in production environments, but it can be useful for testing. diff --git a/pkg/cmd/tknpac/bootstrap/bootstrap.go b/pkg/cmd/tknpac/bootstrap/bootstrap.go index 243fb6915d..fe4c3d01d1 100644 --- a/pkg/cmd/tknpac/bootstrap/bootstrap.go +++ b/pkg/cmd/tknpac/bootstrap/bootstrap.go @@ -111,7 +111,7 @@ func install(ctx context.Context, run *params.Run, opts *bootstrapOpts) error { func createSecret(ctx context.Context, run *params.Run, opts *bootstrapOpts) error { var err error - if opts.RouteName == "" { + if opts.RouteName == "" && !opts.forceInstallGosmee { opts.RouteName, _ = DetectOpenShiftRoute(ctx, run, opts.targetNamespace) if opts.RouteName != "" { opts.autoDetectedRoute = true diff --git a/pkg/cmd/tknpac/bootstrap/install.go b/pkg/cmd/tknpac/bootstrap/install.go index a04aa5a2ff..e3efaccfa2 100644 --- a/pkg/cmd/tknpac/bootstrap/install.go +++ b/pkg/cmd/tknpac/bootstrap/install.go @@ -181,7 +181,7 @@ func installPac(ctx context.Context, run *params.Run, opts *bootstrapOpts) error fmt.Fprintf(opts.ioStreams.Out, "✓ Pipelines-as-Code %s has been installed\n", latestVersion) - if (!isOpenShift && opts.RouteName == "") || opts.forceInstallGosmee { + if opts.forceInstallGosmee { if err := installGosmeeForwarder(ctx, opts); err != nil { return err }