-
Story
-
Resolution: Done
-
Major
-
Pipelines 1.9.0
-
None
-
False
-
None
-
False
-
Add a PaC template variable to get the current namespace
-
-
Story (Required)
As a PaC user trying to use a Repository and PipelineRun yaml to deploy an application to the internal OpenShift image registry, I do not want hard code my namespace.
Background (Required)
When the user created a PipelineRun yaml to use this as a Pipeline-as-Code this should be cluster and namespace agnostic so that it can be reused and tested easily on different clusters (and in different namespaces).
Esp. when using it together with the internal OpenShift image registry is required to pass an image registry like this:
- name: IMAGE_NAME
value: 'image-registry.openshift-image-registry.svc:5000/cjerolim-dev/nodeinfo-pac'
Out of scope
There is no need to change the one Repository per git repo-rule at the moment.
Approach (Required)
Pass the PipelineRun namespace (and maybe name?) as template variable so that the image registry URL can be changed to:
- name: IMAGE_NAME
value: 'image-registry.openshift-image-registry.svc:5000/{{ namespace }}/{{ pipeline_run_name }}'
Dependencies
None/unknown
Acceptance Criteria (Mandatory)
- Allow the user to use a {{ namespace }} (or pipeline_run_namespace) variable in the PipelineRun yaml.
- Allow the user to use a {{ pipeline_run_name }} variable in the PipelineRun yaml.
INVEST Checklist
Dependencies identified
Blockers noted and expected delivery timelines set
Design is implementable
Acceptance criteria agreed upon
Story estimated
Legend
Unknown
Verified
Unsatisfied
Done Checklist
- Code is completed, reviewed, documented and checked in
- Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
- Continuous Delivery pipeline(s) is able to proceed with new code included
- Customer facing documentation, API docs etc. are produced/updated, reviewed and published
- Acceptance criteria are met