kabanero-io / kabanero-pipelines

Default Kabanero Pipelines. This repo will be archived soon.
Apache License 2.0
14 stars 18 forks source link

build-push-promote-task succeeds despite no GitOps repo url passed #403

Closed ianpartridge closed 4 years ago

ianpartridge commented 4 years ago

If the user does not configure a gitops-map ConfigMap, no $GITOPS_REPOSITORY_URL is passed to the promote step of build-push-promote-task. This is expected.

However, the Task still passes with this log:

[INFO] Gitops repo url = 
[INFO] No gitops repo configured.  service promote not executed.

This is because here we do not exit 1 afterwards:

https://github.com/kabanero-io/kabanero-pipelines/blob/af27cdca83f582f6dbc5bafd3154a7a480ffdc4a/pipelines/incubator/events/build-push-promote-task.yaml#L299

Is this intentional? I would have thought that if someone is using the promote pipeline they would be expecting a promote to actually happen, and if it doesn't happen because they haven't configured a GitOps repo URL, the pipeline should fail.

ianpartridge commented 4 years ago

Note that if you do have a gitops-map, but do not have a gitops-token, the pipeline fails with

[ERROR] Secret 'gitops-token' with the token to access gitops repo was not configured. Please configure secret and try again.

This is what I would expect.

kvijai82 commented 4 years ago

@ianpartridge we are using that as the mechanism for the user to tell us they are doing gitops. Remember that the same pipelines can be used without doing a promote. We probably have to redesign this whole thing in the next release anyways to allow a better and more flexible way for the users to specify a gitops repo.

ianpartridge commented 4 years ago

Remember that the same pipelines can be used without doing a promote.

Ah I'd forgotten that, thanks!