Skip to content

Commit b14b004

Browse files
theakshaypantzakisk
authored andcommitted
fix(cli): respect forceInstallGosmee in bootstrap
When --force-install-gosmee flag is set, skip OpenShift route detection and unconditionally install the gosmee forwarder, regardless of the platform. Updated the docs to make this change more clear and explicit. Jira: https://issues.redhat.com/browse/SRVKP-9062 Signed-off-by: Akshay Pant <akshay.akshaypant@gmail.com>
1 parent 212a4f5 commit b14b004

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

docs/content/docs/guide/cli.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,14 @@ option to install a webhook forwarder called
124124
[gosmee](https://github.com/chmouel/gosmee). This forwarder enables connectivity
125125
between the Pipelines-as-Code controller and GitHub without requiring an
126126
internet connection. In this scenario, it will set up a forwarding URL on
127-
<https://hook.pipelinesascode.com> and set it up on GitHub. For OpenShift, it
128-
will not prompt you unless you explicitly specify the `--force-gosmee` flag
129-
(which can be useful if you are running [OpenShift Local](https://developers.redhat.com/products/openshift-local/overview) for instance).
127+
<https://hook.pipelinesascode.com> and set it up on GitHub.
128+
129+
On OpenShift, the bootstrap command automatically detects and uses OpenShift
130+
Routes (as described above), and will not prompt you to use gosmee. If you need
131+
to use gosmee instead (for example, when running [OpenShift
132+
Local](https://developers.redhat.com/products/openshift-local/overview)), you
133+
can explicitly specify the `--force-gosmee` flag to bypass the OpenShift Route
134+
detection and force the use of gosmee.
130135

131136
gosmee should not be used in production environments, but it can be useful for
132137
testing.

pkg/cmd/tknpac/bootstrap/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func install(ctx context.Context, run *params.Run, opts *bootstrapOpts) error {
111111
func createSecret(ctx context.Context, run *params.Run, opts *bootstrapOpts) error {
112112
var err error
113113

114-
if opts.RouteName == "" {
114+
if opts.RouteName == "" && !opts.forceInstallGosmee {
115115
opts.RouteName, _ = DetectOpenShiftRoute(ctx, run, opts.targetNamespace)
116116
if opts.RouteName != "" {
117117
opts.autoDetectedRoute = true

pkg/cmd/tknpac/bootstrap/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func installPac(ctx context.Context, run *params.Run, opts *bootstrapOpts) error
181181

182182
fmt.Fprintf(opts.ioStreams.Out, "✓ Pipelines-as-Code %s has been installed\n", latestVersion)
183183

184-
if (!isOpenShift && opts.RouteName == "") || opts.forceInstallGosmee {
184+
if opts.forceInstallGosmee {
185185
if err := installGosmeeForwarder(ctx, opts); err != nil {
186186
return err
187187
}

0 commit comments

Comments
 (0)