Skip to content

Commit

Permalink
chore: enable setting catalog version without "v" prefix
Browse files Browse the repository at this point in the history
this commit allows to set REMOVE_CATALOG_VERSION_PREFIX env variable,
which will remove "v" prefix from version in catalog version - e.g. 0.19.0
when true vs v0.19.0 when false.

This will help in DS where OCP catalog removes v from version.
This commit also replaces all version variables from catalog version
and replaces it with catalog_version which can hold version with or
without v prefix
Signed-off-by: Karel Simon <[email protected]>
  • Loading branch information
ksimon1 committed Mar 20, 2024
1 parent 470b96e commit 4d9a6a1
Show file tree
Hide file tree
Showing 29 changed files with 50 additions and 48 deletions.
2 changes: 2 additions & 0 deletions scripts/ansible/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ sa_name: "{{ role_name }}"
role_binding_name: "{{ role_name }}"
default_file_mode: "0644"
version: "{{ lookup('env','RELEASE_VERSION')| default('latest', true) }}"
remove_catalog_version_prefix: "{{ lookup('env','REMOVE_CATALOG_VERSION_PREFIX')| default(false, true) | bool}}"
catalog_version: "{{ version[1:] if remove_catalog_version_prefix else version }}"

windows10: windows10
windows11: windows11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: windows-bios-installer
spec:
description: >-
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand Down Expand Up @@ -187,7 +187,7 @@ spec:
- name: name
value: create-vm-from-manifest
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: create-vm-from-manifest
Expand Down Expand Up @@ -220,7 +220,7 @@ spec:
- name: name
value: wait-for-vmi-status
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: wait-for-vmi-status
Expand Down Expand Up @@ -248,7 +248,7 @@ spec:
- name: name
value: cleanup-vm
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: cleanup-vm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: windows-customize
spec:
description: >-
Expand Down Expand Up @@ -76,7 +76,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
- name: name
value: create-vm-from-manifest
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: create-vm-from-manifest
Expand Down Expand Up @@ -184,7 +184,7 @@ spec:
- name: name
value: wait-for-vmi-status
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: wait-for-vmi-status
Expand Down Expand Up @@ -212,7 +212,7 @@ spec:
- name: name
value: cleanup-vm
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: cleanup-vm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
---
apiVersion: tekton.dev/v1
kind: PipelineRun
Expand Down Expand Up @@ -44,7 +44,7 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
---
apiVersion: tekton.dev/v1
kind: PipelineRun
Expand All @@ -70,4 +70,4 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: windows-efi-installer
spec:
description: >-
Expand Down Expand Up @@ -99,7 +99,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand All @@ -124,7 +124,7 @@ spec:
- name: name
value: modify-windows-iso-file
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-windows-iso-file
Expand All @@ -143,7 +143,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand Down Expand Up @@ -230,7 +230,7 @@ spec:
- name: name
value: create-vm-from-manifest
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: create-vm-from-manifest
Expand Down Expand Up @@ -260,7 +260,7 @@ spec:
- name: name
value: wait-for-vmi-status
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: wait-for-vmi-status
Expand Down Expand Up @@ -307,7 +307,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand All @@ -334,7 +334,7 @@ spec:
- name: name
value: cleanup-vm
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: cleanup-vm
Expand Down Expand Up @@ -363,7 +363,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand Down Expand Up @@ -391,7 +391,7 @@ spec:
- name: name
value: modify-data-object
- name: version
value: {{ version }}
value: {{ catalog_version }}
{% else %}
kind: Task
name: modify-data-object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
taskRunSpecs:
- pipelineTaskName: "modify-windows-iso-file"
podTemplate:
Expand Down Expand Up @@ -56,7 +56,7 @@ spec:
- name: name
value: {{ item.pipeline_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
taskRunSpecs:
- pipelineTaskName: "modify-windows-iso-file"
podTemplate:
Expand Down
2 changes: 1 addition & 1 deletion templates/cleanup-vm/examples/cleanup-vm-taskrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: vmName
value: vm-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: sourceTemplateName
value: source-vm-template-example
Expand Down
2 changes: 1 addition & 1 deletion templates/copy-template/manifests/copy-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: manifest
value: |
Expand Down
2 changes: 1 addition & 1 deletion templates/create-vm-from-manifest/manifests/create-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
tekton.dev/deprecated: "true"
{% endif %}
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: templateName
value: vm-template-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: pvc
value: example-pvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: pvc
value: example-pvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: vmName
value: vm-example
Expand Down
2 changes: 1 addition & 1 deletion templates/execute-in-vm/manifests/execute-in-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: publicKeySecretName
value: my-client-public-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: waitForSuccess
value: 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: name
value: {{ task_name }}
- name: version
value: {{ version }}
value: {{ catalog_version }}
params:
- name: templateName
value: vm-template-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
- url: {{ recommendation_url }}
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: {{ version }}
app.kubernetes.io/version: {{ catalog_version }}
name: {{ task_name }}
spec:
description: >-
Expand Down
Loading

0 comments on commit 4d9a6a1

Please sign in to comment.