From 9115abc7d04b665d9c36210590363b96477a96df Mon Sep 17 00:00:00 2001 From: Karel Simon Date: Wed, 20 Mar 2024 18:50:39 +0100 Subject: [PATCH] chore: enable setting catalog version without "v" prefix 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 --- scripts/ansible/common.yaml | 2 ++ .../manifests/windows-bios-installer.yaml | 10 +++++----- .../pipelineruns/pipelineruns.yaml | 2 +- .../manifests/windows-customize.yaml | 10 +++++----- .../pipelineruns/pipelineruns.yaml | 6 +++--- .../manifests/windows-efi-installer.yaml | 20 +++++++++---------- .../pipelineruns/pipelineruns.yaml | 4 ++-- .../examples/cleanup-vm-taskrun.yaml | 2 +- .../examples/copy-template-taskrun.yaml | 2 +- .../manifests/copy-template.yaml | 2 +- .../create-vm-from-manifest-taskrun.yaml | 2 +- .../manifests/create-vm.yaml | 2 +- .../create-vm-from-template-taskrun.yaml | 2 +- .../examples/disk-virt-customize-taskrun.yaml | 2 +- .../manifests/disk-virt-customize.yaml | 2 +- .../examples/disk-virt-sysprep-taskrun.yaml | 2 +- .../manifests/disk-virt-sysprep.yaml | 2 +- .../examples/execute-in-vm-taskrun.yaml | 2 +- .../manifests/execute-in-vm.yaml | 2 +- .../examples/generate-ssh-keys-taskrun.yaml | 2 +- .../manifests/generate-ssh-keys.yaml | 2 +- .../examples/modify-data-object-taskrun.yaml | 2 +- .../manifests/modify-data-object.yaml | 2 +- .../examples/modify-vm-template-taskrun.yaml | 2 +- .../manifests/modify-vm-template.yaml | 2 +- .../modify-windows-iso-file-taskrun.yaml | 2 +- .../manifests/modify-windows-iso-file.yaml | 2 +- .../examples/wait-for-vmi-status-taskrun.yaml | 2 +- .../manifests/wait-for-vmi-status.yaml | 2 +- 29 files changed, 50 insertions(+), 48 deletions(-) diff --git a/scripts/ansible/common.yaml b/scripts/ansible/common.yaml index f28fe6e58..55282ee92 100644 --- a/scripts/ansible/common.yaml +++ b/scripts/ansible/common.yaml @@ -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) | bool}}" +catalog_version: "{{ version[1:] if remove_catalog_version_prefix else version }}" windows10: windows10 windows11: windows11 diff --git a/templates-pipelines/windows-bios-installer/manifests/windows-bios-installer.yaml b/templates-pipelines/windows-bios-installer/manifests/windows-bios-installer.yaml index 649cba858..b6215f188 100644 --- a/templates-pipelines/windows-bios-installer/manifests/windows-bios-installer.yaml +++ b/templates-pipelines/windows-bios-installer/manifests/windows-bios-installer.yaml @@ -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: >- @@ -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 @@ -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 @@ -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 @@ -248,7 +248,7 @@ spec: - name: name value: cleanup-vm - name: version - value: {{ version }} + value: {{ catalog_version }} {% else %} kind: Task name: cleanup-vm diff --git a/templates-pipelines/windows-bios-installer/pipelineruns/pipelineruns.yaml b/templates-pipelines/windows-bios-installer/pipelineruns/pipelineruns.yaml index 315d86673..7445e25ac 100644 --- a/templates-pipelines/windows-bios-installer/pipelineruns/pipelineruns.yaml +++ b/templates-pipelines/windows-bios-installer/pipelineruns/pipelineruns.yaml @@ -19,4 +19,4 @@ spec: - name: name value: {{ item.pipeline_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} diff --git a/templates-pipelines/windows-customize/manifests/windows-customize.yaml b/templates-pipelines/windows-customize/manifests/windows-customize.yaml index f6a13fe37..2ec8b22a9 100644 --- a/templates-pipelines/windows-customize/manifests/windows-customize.yaml +++ b/templates-pipelines/windows-customize/manifests/windows-customize.yaml @@ -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: >- @@ -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 @@ -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 @@ -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 @@ -212,7 +212,7 @@ spec: - name: name value: cleanup-vm - name: version - value: {{ version }} + value: {{ catalog_version }} {% else %} kind: Task name: cleanup-vm diff --git a/templates-pipelines/windows-customize/pipelineruns/pipelineruns.yaml b/templates-pipelines/windows-customize/pipelineruns/pipelineruns.yaml index 4f8b2886c..0a195cd25 100644 --- a/templates-pipelines/windows-customize/pipelineruns/pipelineruns.yaml +++ b/templates-pipelines/windows-customize/pipelineruns/pipelineruns.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ item.pipeline_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} --- apiVersion: tekton.dev/v1 kind: PipelineRun @@ -44,7 +44,7 @@ spec: - name: name value: {{ item.pipeline_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} --- apiVersion: tekton.dev/v1 kind: PipelineRun @@ -70,4 +70,4 @@ spec: - name: name value: {{ item.pipeline_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} diff --git a/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml b/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml index 56881855a..7c78e05f9 100644 --- a/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml +++ b/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml @@ -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: >- @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -334,7 +334,7 @@ spec: - name: name value: cleanup-vm - name: version - value: {{ version }} + value: {{ catalog_version }} {% else %} kind: Task name: cleanup-vm @@ -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 @@ -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 diff --git a/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml b/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml index 21d414bf4..aff1e5b35 100644 --- a/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml +++ b/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml @@ -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: @@ -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: diff --git a/templates/cleanup-vm/examples/cleanup-vm-taskrun.yaml b/templates/cleanup-vm/examples/cleanup-vm-taskrun.yaml index e821cdf2e..eed7b78eb 100644 --- a/templates/cleanup-vm/examples/cleanup-vm-taskrun.yaml +++ b/templates/cleanup-vm/examples/cleanup-vm-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: vmName value: vm-example diff --git a/templates/copy-template/examples/copy-template-taskrun.yaml b/templates/copy-template/examples/copy-template-taskrun.yaml index 2d32f313d..c187a02cd 100644 --- a/templates/copy-template/examples/copy-template-taskrun.yaml +++ b/templates/copy-template/examples/copy-template-taskrun.yaml @@ -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 diff --git a/templates/copy-template/manifests/copy-template.yaml b/templates/copy-template/manifests/copy-template.yaml index e485ef24e..489b66ea1 100644 --- a/templates/copy-template/manifests/copy-template.yaml +++ b/templates/copy-template/manifests/copy-template.yaml @@ -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: >- diff --git a/templates/create-vm-from-manifest/examples/create-vm-from-manifest-taskrun.yaml b/templates/create-vm-from-manifest/examples/create-vm-from-manifest-taskrun.yaml index b6055e59b..8e80cc46e 100644 --- a/templates/create-vm-from-manifest/examples/create-vm-from-manifest-taskrun.yaml +++ b/templates/create-vm-from-manifest/examples/create-vm-from-manifest-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: manifest value: | diff --git a/templates/create-vm-from-manifest/manifests/create-vm.yaml b/templates/create-vm-from-manifest/manifests/create-vm.yaml index 52029879b..db9403998 100644 --- a/templates/create-vm-from-manifest/manifests/create-vm.yaml +++ b/templates/create-vm-from-manifest/manifests/create-vm.yaml @@ -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: >- diff --git a/templates/create-vm-from-template/examples/create-vm-from-template-taskrun.yaml b/templates/create-vm-from-template/examples/create-vm-from-template-taskrun.yaml index d6994430c..edd225b32 100644 --- a/templates/create-vm-from-template/examples/create-vm-from-template-taskrun.yaml +++ b/templates/create-vm-from-template/examples/create-vm-from-template-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: templateName value: vm-template-example diff --git a/templates/disk-virt-customize/examples/disk-virt-customize-taskrun.yaml b/templates/disk-virt-customize/examples/disk-virt-customize-taskrun.yaml index 380f24014..9aefb685d 100644 --- a/templates/disk-virt-customize/examples/disk-virt-customize-taskrun.yaml +++ b/templates/disk-virt-customize/examples/disk-virt-customize-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: pvc value: example-pvc diff --git a/templates/disk-virt-customize/manifests/disk-virt-customize.yaml b/templates/disk-virt-customize/manifests/disk-virt-customize.yaml index e455603a4..4afdbb44b 100644 --- a/templates/disk-virt-customize/manifests/disk-virt-customize.yaml +++ b/templates/disk-virt-customize/manifests/disk-virt-customize.yaml @@ -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: >- diff --git a/templates/disk-virt-sysprep/examples/disk-virt-sysprep-taskrun.yaml b/templates/disk-virt-sysprep/examples/disk-virt-sysprep-taskrun.yaml index e55c149ba..38ad495bf 100644 --- a/templates/disk-virt-sysprep/examples/disk-virt-sysprep-taskrun.yaml +++ b/templates/disk-virt-sysprep/examples/disk-virt-sysprep-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: pvc value: example-pvc diff --git a/templates/disk-virt-sysprep/manifests/disk-virt-sysprep.yaml b/templates/disk-virt-sysprep/manifests/disk-virt-sysprep.yaml index 4a6bf114a..b5f2c08e9 100644 --- a/templates/disk-virt-sysprep/manifests/disk-virt-sysprep.yaml +++ b/templates/disk-virt-sysprep/manifests/disk-virt-sysprep.yaml @@ -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: >- diff --git a/templates/execute-in-vm/examples/execute-in-vm-taskrun.yaml b/templates/execute-in-vm/examples/execute-in-vm-taskrun.yaml index bad326627..c5e4eb994 100644 --- a/templates/execute-in-vm/examples/execute-in-vm-taskrun.yaml +++ b/templates/execute-in-vm/examples/execute-in-vm-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: vmName value: vm-example diff --git a/templates/execute-in-vm/manifests/execute-in-vm.yaml b/templates/execute-in-vm/manifests/execute-in-vm.yaml index a8a3a0714..22ceb5c4b 100644 --- a/templates/execute-in-vm/manifests/execute-in-vm.yaml +++ b/templates/execute-in-vm/manifests/execute-in-vm.yaml @@ -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: >- diff --git a/templates/generate-ssh-keys/examples/generate-ssh-keys-taskrun.yaml b/templates/generate-ssh-keys/examples/generate-ssh-keys-taskrun.yaml index 509f568f9..72c45ef16 100644 --- a/templates/generate-ssh-keys/examples/generate-ssh-keys-taskrun.yaml +++ b/templates/generate-ssh-keys/examples/generate-ssh-keys-taskrun.yaml @@ -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 diff --git a/templates/generate-ssh-keys/manifests/generate-ssh-keys.yaml b/templates/generate-ssh-keys/manifests/generate-ssh-keys.yaml index 79f40fdf7..09b26ed98 100644 --- a/templates/generate-ssh-keys/manifests/generate-ssh-keys.yaml +++ b/templates/generate-ssh-keys/manifests/generate-ssh-keys.yaml @@ -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: >- diff --git a/templates/modify-data-object/examples/modify-data-object-taskrun.yaml b/templates/modify-data-object/examples/modify-data-object-taskrun.yaml index bfbac4a5e..322789fd9 100644 --- a/templates/modify-data-object/examples/modify-data-object-taskrun.yaml +++ b/templates/modify-data-object/examples/modify-data-object-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: waitForSuccess value: 'true' diff --git a/templates/modify-data-object/manifests/modify-data-object.yaml b/templates/modify-data-object/manifests/modify-data-object.yaml index ed038df07..bffd5e60b 100644 --- a/templates/modify-data-object/manifests/modify-data-object.yaml +++ b/templates/modify-data-object/manifests/modify-data-object.yaml @@ -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: >- diff --git a/templates/modify-vm-template/examples/modify-vm-template-taskrun.yaml b/templates/modify-vm-template/examples/modify-vm-template-taskrun.yaml index 3f8c19d9d..99c554918 100644 --- a/templates/modify-vm-template/examples/modify-vm-template-taskrun.yaml +++ b/templates/modify-vm-template/examples/modify-vm-template-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: templateName value: vm-template-example diff --git a/templates/modify-vm-template/manifests/modify-vm-template.yaml b/templates/modify-vm-template/manifests/modify-vm-template.yaml index e6f1bc259..74d3be5ec 100644 --- a/templates/modify-vm-template/manifests/modify-vm-template.yaml +++ b/templates/modify-vm-template/manifests/modify-vm-template.yaml @@ -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: >- diff --git a/templates/modify-windows-iso-file/examples/modify-windows-iso-file-taskrun.yaml b/templates/modify-windows-iso-file/examples/modify-windows-iso-file-taskrun.yaml index 5e8f8bff7..048688681 100644 --- a/templates/modify-windows-iso-file/examples/modify-windows-iso-file-taskrun.yaml +++ b/templates/modify-windows-iso-file/examples/modify-windows-iso-file-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: pvcName value: w11 diff --git a/templates/modify-windows-iso-file/manifests/modify-windows-iso-file.yaml b/templates/modify-windows-iso-file/manifests/modify-windows-iso-file.yaml index 74c575796..05ba3bf86 100644 --- a/templates/modify-windows-iso-file/manifests/modify-windows-iso-file.yaml +++ b/templates/modify-windows-iso-file/manifests/modify-windows-iso-file.yaml @@ -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: >- diff --git a/templates/wait-for-vmi-status/examples/wait-for-vmi-status-taskrun.yaml b/templates/wait-for-vmi-status/examples/wait-for-vmi-status-taskrun.yaml index e3c20f93f..d62892b92 100644 --- a/templates/wait-for-vmi-status/examples/wait-for-vmi-status-taskrun.yaml +++ b/templates/wait-for-vmi-status/examples/wait-for-vmi-status-taskrun.yaml @@ -16,7 +16,7 @@ spec: - name: name value: {{ task_name }} - name: version - value: {{ version }} + value: {{ catalog_version }} params: - name: vmiName value: example-vm diff --git a/templates/wait-for-vmi-status/manifests/wait-for-vmi-status.yaml b/templates/wait-for-vmi-status/manifests/wait-for-vmi-status.yaml index 249d5a4d6..7cfee0949 100644 --- a/templates/wait-for-vmi-status/manifests/wait-for-vmi-status.yaml +++ b/templates/wait-for-vmi-status/manifests/wait-for-vmi-status.yaml @@ -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: >-