diff --git a/config/manager/manager.template.yaml b/config/manager/manager.template.yaml index 2c0d06419..712db027f 100644 --- a/config/manager/manager.template.yaml +++ b/config/manager/manager.template.yaml @@ -38,6 +38,8 @@ spec: - name: NODE_LABELLER_IMAGE - name: CPU_PLUGIN_IMAGE - name: OPERATOR_VERSION + - name: TEKTON_TASKS_IMAGE + - name: TEKTON_TASKS_DISK_VIRT_IMAGE image: controller:latest name: manager resources: diff --git a/data/olm-catalog/ssp-operator.clusterserviceversion.yaml b/data/olm-catalog/ssp-operator.clusterserviceversion.yaml index 200685667..d47d7e833 100644 --- a/data/olm-catalog/ssp-operator.clusterserviceversion.yaml +++ b/data/olm-catalog/ssp-operator.clusterserviceversion.yaml @@ -646,6 +646,8 @@ spec: - name: CPU_PLUGIN_IMAGE - name: OPERATOR_VERSION value: 0.14.0 + - name: TEKTON_TASKS_IMAGE + - name: TEKTON_TASKS_DISK_VIRT_IMAGE image: quay.io/kubevirt/ssp-operator:latest livenessProbe: httpGet: diff --git a/data/tekton-tasks/kubevirt-tekton-tasks-kubernetes.yaml b/data/tekton-tasks/kubevirt-tekton-tasks-kubernetes.yaml new file mode 100644 index 000000000..cb241305d --- /dev/null +++ b/data/tekton-tasks/kubevirt-tekton-tasks-kubernetes.yaml @@ -0,0 +1,1047 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: cleanup-vm-task + vmNamespace.params.task.kubevirt.io/type: namespace + secretName.params.task.kubevirt.io/type: execute-in-vm-secret + script.params.task.kubevirt.io/type: script + delete.params.task.kubevirt.io/type: boolean + stop.params.task.kubevirt.io/type: boolean + timeout.params.task.kubevirt.io/type: duration + labels: + task.kubevirt.io/type: cleanup-vm + task.kubevirt.io/category: execute-in-vm + name: cleanup-vm +spec: + params: + - description: Name of a VM to execute the action in. + name: vmName + type: string + - description: Namespace of a VM to execute the action in. (defaults to active namespace) + name: vmNamespace + type: string + default: "" + - description: Stops the VM after executing the commands when set to true. + name: stop + type: string + default: "true" + - description: Deletes the VM after executing the commands when set to true. + name: delete + type: string + default: "false" + - description: Timeout for the command/script (includes potential VM start). The VM will be stopped or deleted accordingly once the timout expires. Should be in a 3h2m1s format. + name: timeout + type: string + default: "30m" + - description: Secret to use when connecting to a VM. + name: secretName + type: string + default: "__empty__" + - description: Command to execute in a VM. + name: command + type: array + default: [] + - description: Arguments of a command. + name: args + type: array + default: [] + - description: Script to execute in a VM. + name: script + type: string + default: "" + steps: + - name: execute-in-vm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--stop' + - $(params.stop) + - '--delete' + - $(params.delete) + - '--timeout' + - $(params.timeout) + - '--' + - $(params.command) + - $(params.args) + env: + - name: COMMAND + value: execute-in-vm + - name: VM_NAME + value: $(params.vmName) + - name: VM_NAMESPACE + value: $(params.vmNamespace) + - name: EXECUTE_SCRIPT + value: $(params.script) + - name: CONNECTION_SECRET_NAME + value: $(params.secretName) + volumeMounts: + - mountPath: /data/connectionsecret/ + name: connectionsecret + readOnly: true + volumes: + - name: connectionsecret + secret: + secretName: $(params.secretName) + optional: true + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cleanup-vm-task +rules: + - verbs: + - get + - list + - watch + - delete + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - update + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - virtualmachines/stop + - virtualmachines/restart + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cleanup-vm-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cleanup-vm-task +roleRef: + kind: ClusterRole + name: cleanup-vm-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: cleanup-vm-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: create-vm-from-manifest-task + manifest.params.task.kubevirt.io/type: resource-yaml + manifest.params.task.kubevirt.io/kind: VirtualMachine + manifest.params.task.kubevirt.io/apiVersion: kubevirt.io/v1 + namespace.params.task.kubevirt.io/type: namespace + dataVolumes.params.task.kubevirt.io/kind: DataVolume + dataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + ownDataVolumes.params.task.kubevirt.io/kind: DataVolume + ownDataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + persistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + persistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + ownPersistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + ownPersistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + startVM.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: create-vm-from-manifest + task.kubevirt.io/category: create-vm + name: create-vm-from-manifest +spec: + params: + - name: manifest + description: YAML manifest of a VirtualMachine resource to be created. + default: "" + type: string + - name: virtctl + description: "Parameters for virtctl create vm command that will be used to create VirtualMachine." + default: "" + type: string + - name: namespace + description: Namespace where to create the VM. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: startVM + description: Set to true or false to start / not start vm after creation. In case of runStrategy is set to Always, startVM flag is ignored. + default: "" + type: string + - name: runStrategy + description: Set runStrategy to VM. If runStrategy is set, vm.spec.running attribute is set to nil. + default: "" + type: string + results: + - name: name + description: The name of a VM that was created. + - name: namespace + description: The namespace of a VM that was created. + steps: + - name: createvm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - create-vm + args: + - "--output=yaml" + env: + - name: VM_MANIFEST + value: $(params.manifest) + - name: VM_NAMESPACE + value: $(params.namespace) + - name: VIRTCTL + value: $(params.virtctl) + - name: START_VM + value: $(params.startVM) + - name: RUN_STRATEGY + value: $(params.runStrategy) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: create-vm-from-manifest-task +rules: + - verbs: + - get + - list + - watch + - create + - update + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - 'update' + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - verbs: + - '*' + apiGroups: + - kubevirt.io + resources: + - virtualmachines/finalizers + - verbs: + - '*' + apiGroups: + - '' + resources: + - persistentvolumeclaims + - verbs: + - '*' + apiGroups: + - cdi.kubevirt.io + resources: + - datavolumes + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: create-vm-from-manifest-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: create-vm-from-manifest-task +roleRef: + kind: ClusterRole + name: create-vm-from-manifest-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: create-vm-from-manifest-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + pvc.params.task.kubevirt.io/kind: PersistentVolumeClaim + pvc.params.task.kubevirt.io/apiVersion: v1 + customizeCommands.params.task.kubevirt.io/type: script + verbose.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: disk-virt-customize + task.kubevirt.io/category: disk-virt-customize + name: disk-virt-customize +spec: + params: + - name: pvc + description: PersistentVolumeClaim to run the the virt-customize script in. PVC should be in the same namespace as taskrun/pipelinerun. + type: string + - name: customizeCommands + description: virt-customize commands in "--commands-from-file" format. + type: string + default: "" + - name: verbose + description: Enable verbose mode and tracing of libguestfs API calls. + type: string + default: 'false' + - name: additionalOptions + description: Additional options to pass to virt-customize. + type: string + default: "" + steps: + - name: run-virt-customize + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + command: + - entrypoint + args: + - '--verbose' + - $(params.verbose) + env: + - name: COMMAND + value: disk-virt-customize + - name: CUSTOMIZE_COMMANDS + value: $(params.customizeCommands) + - name: ADDITIONAL_VIRT_CUSTOMIZE_OPTIONS + value: $(params.additionalOptions) + - name: LIBGUESTFS_BACKEND + value: direct + resources: + limits: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + requests: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + volumeMounts: + - mountPath: /mnt/appliance/ + name: guestfsappliance + - mountPath: /mnt/targetpvc/ + name: targetpvc + volumes: + - name: guestfsappliance + emptyDir: {} + - name: targetpvc + persistentVolumeClaim: + claimName: $(params.pvc) + workspaces: + - name: data01 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data01 + - name: data02 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data02 + - name: data03 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data03 + - name: data04 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data04 + - name: data05 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data05 + - name: data06 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data06 + - name: data07 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data07 + - name: data08 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data08 + - name: data09 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data09 + - name: data10 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data10 +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + pvc.params.task.kubevirt.io/kind: PersistentVolumeClaim + pvc.params.task.kubevirt.io/apiVersion: v1 + sysprepCommands.params.task.kubevirt.io/type: script + verbose.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: disk-virt-sysprep + task.kubevirt.io/category: disk-virt-sysprep + name: disk-virt-sysprep +spec: + params: + - name: pvc + description: PersistentVolumeClaim to run the the virt-sysprep script in. PVC should be in the same namespace as taskrun/pipelinerun. + type: string + - name: sysprepCommands + description: virt-sysprep commands in "--commands-from-file" format. + type: string + default: "" + - name: verbose + description: Enable verbose mode and tracing of libguestfs API calls. + type: string + default: 'false' + - name: additionalOptions + description: Additional options to pass to virt-sysprep. + type: string + default: "" + steps: + - name: run-virt-sysprep + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + command: + - entrypoint + args: + - '--verbose' + - $(params.verbose) + env: + - name: COMMAND + value: disk-virt-sysprep + - name: SYSPREP_COMMANDS + value: $(params.sysprepCommands) + - name: ADDITIONAL_VIRT_SYSPREP_OPTIONS + value: $(params.additionalOptions) + - name: LIBGUESTFS_BACKEND + value: direct + resources: + limits: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + requests: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + volumeMounts: + - mountPath: /mnt/appliance/ + name: guestfsappliance + - mountPath: /mnt/targetpvc/ + name: targetpvc + volumes: + - name: guestfsappliance + emptyDir: {} + - name: targetpvc + persistentVolumeClaim: + claimName: $(params.pvc) + workspaces: + - name: data01 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data01 + - name: data02 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data02 + - name: data03 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data03 + - name: data04 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data04 + - name: data05 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data05 + - name: data06 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data06 + - name: data07 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data07 + - name: data08 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data08 + - name: data09 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data09 + - name: data10 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data10 +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: execute-in-vm-task + vmNamespace.params.task.kubevirt.io/type: namespace + secretName.params.task.kubevirt.io/type: execute-in-vm-secret + script.params.task.kubevirt.io/type: script + labels: + task.kubevirt.io/type: execute-in-vm + task.kubevirt.io/category: execute-in-vm + name: execute-in-vm +spec: + params: + - description: Name of a VM to execute the action in. + name: vmName + type: string + - description: Namespace of a VM to execute the action in. (defaults to active namespace) + name: vmNamespace + type: string + default: "" + - description: Secret to use when connecting to a VM. + name: secretName + type: string + default: "__empty__" + - description: Command to execute in a VM. + name: command + type: array + default: [] + - description: Arguments of a command. + name: args + type: array + default: [] + - description: Script to execute in a VM. + name: script + type: string + default: "" + steps: + - name: execute-in-vm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--' + - $(params.command) + - $(params.args) + env: + - name: COMMAND + value: execute-in-vm + - name: VM_NAME + value: $(params.vmName) + - name: VM_NAMESPACE + value: $(params.vmNamespace) + - name: EXECUTE_SCRIPT + value: $(params.script) + - name: CONNECTION_SECRET_NAME + value: $(params.secretName) + volumeMounts: + - mountPath: /data/connectionsecret/ + name: connectionsecret + readOnly: true + volumes: + - name: connectionsecret + secret: + secretName: $(params.secretName) + optional: true + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: execute-in-vm-task +rules: + - verbs: + - get + - list + - watch + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - update + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - virtualmachines/stop + - virtualmachines/restart + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: execute-in-vm-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: execute-in-vm-task +roleRef: + kind: ClusterRole + name: execute-in-vm-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: execute-in-vm-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: generate-ssh-keys-task + publicKeySecretName.params.task.kubevirt.io/kind: Secret + publicKeySecretName.params.task.kubevirt.io/apiVersion: v1 + publicKeySecretNamespace.params.task.kubevirt.io/type: namespace + privateKeySecretName.params.task.kubevirt.io/kind: Secret + privateKeySecretName.params.task.kubevirt.io/apiVersion: v1 + privateKeySecretNamespace.params.task.kubevirt.io/type: namespace + privateKeyConnectionOptions.params.task.kubevirt.io/type: private-key-options-array + labels: + task.kubevirt.io/type: generate-ssh-keys + task.kubevirt.io/category: generate-ssh-keys + name: generate-ssh-keys +spec: + params: + - name: publicKeySecretName + description: Name of a new or existing secret to append the generated public key to. The name will be generated and new secret created if not specified. + default: "" + type: string + - name: publicKeySecretNamespace + description: Namespace of publicKeySecretName. (defaults to active namespace) + default: "" + type: string + - name: privateKeySecretName + description: Name of a new secret to add the generated private key to. The name will be generated if not specified. The secret uses format of execute-in-vm task. + default: "" + type: string + - name: privateKeySecretNamespace + description: Namespace of privateKeySecretName. (defaults to active namespace) + default: "" + type: string + - name: privateKeyConnectionOptions + description: Additional options to use in SSH client. Please see execute-in-vm task SSH section for more details. Eg ["host-public-key:ssh-rsa AAAAB...", "additional-ssh-options:-p 8022"]. + default: [] + type: array + - name: additionalSSHKeygenOptions + description: Additional options to pass to the ssh-keygen command. + default: "" + type: string + results: + - name: publicKeySecretName + description: The name of a public key secret. + - name: publicKeySecretNamespace + description: The namespace of a public key secret. + - name: privateKeySecretName + description: The name of a private key secret. + - name: privateKeySecretNamespace + description: The namespace of a private key secret. + steps: + - name: generate-ssh-keys + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--' + - $(params.privateKeyConnectionOptions) + env: + - name: COMMAND + value: generate-ssh-keys + - name: PUBLIC_KEY_SECRET_NAME + value: $(params.publicKeySecretName) + - name: PUBLIC_KEY_SECRET_NAMESPACE + value: $(params.publicKeySecretNamespace) + - name: PRIVATE_KEY_SECRET_NAME + value: $(params.privateKeySecretName) + - name: PRIVATE_KEY_SECRET_NAMESPACE + value: $(params.privateKeySecretNamespace) + - name: ADDITIONAL_SSH_KEYGEN_OPTIONS + value: $(params.additionalSSHKeygenOptions) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: generate-ssh-keys-task +rules: + - verbs: + - '*' + apiGroups: + - '' + resources: + - secrets + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: generate-ssh-keys-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: generate-ssh-keys-task +roleRef: + kind: ClusterRole + name: generate-ssh-keys-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: generate-ssh-keys-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: modify-data-object-task + manifest.params.task.kubevirt.io/type: resource-yaml + manifest.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + waitForSuccess.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: modify-data-object + task.kubevirt.io/category: modify-data-object + name: modify-data-object +spec: + description: >- + This task modifies a data object (DataVolume or DataSource). It can optionally wait until CDI imports finish. + params: + - name: manifest + description: YAML manifest of a data object to be created. + type: string + default: '' + - name: namespace + description: Namespace where to create the data object. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: waitForSuccess + description: Set to "true" or "false" if container should wait for Ready condition of the data object. + default: 'false' + type: string + - name: allowReplace + description: Allow replacing an already existing data object (same combination name/namespace). Allowed values true/false + type: string + default: "false" + - name: deleteObject + description: Set to `true` or `false` if task should delete the specified DataVolume, DataSource or PersistentVolumeClaim. If set to 'true' the ds/dv/pvc will be deleted and all other parameters are ignored. + default: 'false' + type: string + - name: deleteObjectKind + description: Kind of the data object to delete. This parameter is used only for Delete operation. + default: "" + type: string + - name: deleteObjectName + description: Name of the data object to delete. This parameter is used only for Delete operation. + default: "" + type: string + results: + - name: name + description: The name of the data object that was created. + - name: namespace + description: The namespace of the data object that was created. + steps: + - name: modify-data-object + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - modify-data-object + args: + - "--output=yaml" + env: + - name: DATA_OBJECT_MANIFEST + value: $(params.manifest) + - name: DATA_OBJECT_NAMESPACE + value: $(params.namespace) + - name: WAIT_FOR_SUCCESS + value: $(params.waitForSuccess) + - name: ALLOW_REPLACE + value: $(params.allowReplace) + - name: DELETE_OBJECT + value: $(params.deleteObject) + - name: DELETE_OBJECT_KIND + value: $(params.deleteObjectKind) + - name: DELETE_OBJECT_NAME + value: $(params.deleteObjectName) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: modify-data-object-task +rules: + - verbs: + - get + - create + - delete + apiGroups: + - cdi.kubevirt.io + resources: + - datavolumes + - datasources + - verbs: + - create + apiGroups: + - "" + resources: + - pods + - verbs: + - get + - delete + apiGroups: + - "" + resources: + - persistentvolumeclaims + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: modify-data-object-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: modify-data-object-task +roleRef: + kind: ClusterRole + name: modify-data-object-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: modify-data-object-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: modify-windows-iso-file-task + labels: + task.kubevirt.io/type: modify-windows-iso-file + task.kubevirt.io/category: modify-windows-iso-file + name: modify-windows-iso-file +spec: + params: + - name: pvcName + description: PersistentVolumeClaim which contains windows iso. + type: string + default: "" + steps: + - name: modify-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + script: | + #!/bin/bash + set -x + + export LIBGUESTFS_PATH=/usr/local/lib/guestfs/appliance + export ISO_FILES_PATH="/tmp/extracted-iso-files" + export EFI_BOOT="${ISO_FILES_PATH}/efi/microsoft/boot" + export TARGET_IMG_FILE_PATH="tmp/target-pvc/disk.img" + + guestfish -a ${TARGET_IMG_FILE_PATH} -m /dev/sda tar-out / - | tar xvf - -C ${ISO_FILES_PATH} -m --no-overwrite-dir --owner=$(id -u) --group=$(id -g) --no-same-permissions + + if [ ! -f ${EFI_BOOT}/efisys_noprompt.bin ] || [ ! -f ${EFI_BOOT}/cdboot_noprompt.efi ]; then + echo "${EFI_BOOT}/efisys_noprompt.bin or ${EFI_BOOT}/cdboot_noprompt.efi not found in the iso file! Exiting" + exit 1 + fi + + chmod u+w "${ISO_FILES_PATH}/efi" "${ISO_FILES_PATH}/efi/microsoft" "${ISO_FILES_PATH}/efi/microsoft/boot" + chmod u+w "${EFI_BOOT}/efisys.bin" "${EFI_BOOT}/cdboot.efi" "${EFI_BOOT}/efisys_noprompt.bin" "${EFI_BOOT}/cdboot_noprompt.efi" + + rm "${EFI_BOOT}/efisys.bin" "${EFI_BOOT}/cdboot.efi" + + mv "${EFI_BOOT}/efisys_noprompt.bin" "${EFI_BOOT}/efisys.bin" + mv "${EFI_BOOT}/cdboot_noprompt.efi" "${EFI_BOOT}/cdboot.efi" + env: + - name: "LIBGUESTFS_BACKEND" + value: "direct" + - name: "HOME" + value: "/usr/local/lib/guestfs/appliance" + resources: + limits: + devices.kubevirt.io/kvm: '1' + requests: + devices.kubevirt.io/kvm: '1' + volumeMounts: + - mountPath: /tmp/target-pvc/ + name: target-pvc + - mountPath: /tmp/extracted-iso-files/ + name: extracted-iso-files + - name: create-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + script: | + #!/bin/bash + set -ex + export ISO_FILES_PATH="/tmp/extracted-iso-files" + export ISO_FILE_PATH="/tmp/iso-file/disk.iso" + + xorriso -as mkisofs -no-emul-boot \ + -e "efi/microsoft/boot/efisys.bin" \ + -boot-load-size 1 \ + -iso-level 4 \ + -J -l -D -N \ + -joliet-long \ + -relaxed-filenames \ + -V "WINDOWS" \ + -o ${ISO_FILE_PATH} ${ISO_FILES_PATH} + volumeMounts: + - mountPath: /tmp/extracted-iso-files/ + name: extracted-iso-files + - mountPath: /tmp/iso-file/ + name: iso-file + - name: convert-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + script: | + #!/bin/bash + set -x + export ISO_FILE_PATH="/tmp/iso-file/disk.iso" + export TARGET_IMG_FILE_PATH="/tmp/target-pvc/disk.img" + + rm ${TARGET_IMG_FILE_PATH} + qemu-img convert -t writeback -p -O raw ${ISO_FILE_PATH} ${TARGET_IMG_FILE_PATH} + volumeMounts: + - mountPath: /tmp/target-pvc/ + name: target-pvc + - mountPath: /tmp/iso-file/ + name: iso-file + volumes: + - name: target-pvc + persistentVolumeClaim: + claimName: "$(params.pvcName)" + - name: extracted-iso-files + emptyDir: + sizeLimit: 12Gi + - name: iso-file + emptyDir: + sizeLimit: 12Gi +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: wait-for-vmi-status-task + vmiNamespace.params.task.kubevirt.io/type: namespace + labels: + task.kubevirt.io/type: wait-for-vmi-status + task.kubevirt.io/category: wait-for-vmi-status + name: wait-for-vmi-status +spec: + params: + - name: vmiName + description: Name of a VirtualMachineInstance to wait for. + type: string + - name: vmiNamespace + description: Namespace of a VirtualMachineInstance to wait for. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: successCondition + default: "" + description: A label selector expression to decide if the VirtualMachineInstance (VMI) is in a success state. Eg. "status.phase == Succeeded". It is evaluated on each VMI update and will result in this task succeeding if true. + - name: failureCondition + default: "" + description: A label selector expression to decide if the VirtualMachineInstance (VMI) is in a failed state. Eg. "status.phase in (Failed, Unknown)". It is evaluated on each VMI update and will result in this task failing if true. + steps: + - name: wait-for-vmi-status + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + env: + - name: COMMAND + value: wait-for-vmi-status + - name: VMI_NAME + value: $(params.vmiName) + - name: VMI_NAMESPACE + value: $(params.vmiNamespace) + - name: SUCCESS_CONDITION + value: $(params.successCondition) + - name: FAILURE_CONDITION + value: $(params.failureCondition) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: wait-for-vmi-status-task +rules: + - verbs: + - get + - list + - watch + apiGroups: + - kubevirt.io + resources: + - virtualmachineinstances + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: wait-for-vmi-status-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: wait-for-vmi-status-task +roleRef: + kind: ClusterRole + name: wait-for-vmi-status-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: wait-for-vmi-status-task diff --git a/data/tekton-tasks/kubevirt-tekton-tasks-okd.yaml b/data/tekton-tasks/kubevirt-tekton-tasks-okd.yaml new file mode 100644 index 000000000..182b7ff65 --- /dev/null +++ b/data/tekton-tasks/kubevirt-tekton-tasks-okd.yaml @@ -0,0 +1,1481 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: cleanup-vm-task + vmNamespace.params.task.kubevirt.io/type: namespace + secretName.params.task.kubevirt.io/type: execute-in-vm-secret + script.params.task.kubevirt.io/type: script + delete.params.task.kubevirt.io/type: boolean + stop.params.task.kubevirt.io/type: boolean + timeout.params.task.kubevirt.io/type: duration + labels: + task.kubevirt.io/type: cleanup-vm + task.kubevirt.io/category: execute-in-vm + name: cleanup-vm +spec: + params: + - description: Name of a VM to execute the action in. + name: vmName + type: string + - description: Namespace of a VM to execute the action in. (defaults to active namespace) + name: vmNamespace + type: string + default: "" + - description: Stops the VM after executing the commands when set to true. + name: stop + type: string + default: "true" + - description: Deletes the VM after executing the commands when set to true. + name: delete + type: string + default: "false" + - description: Timeout for the command/script (includes potential VM start). The VM will be stopped or deleted accordingly once the timout expires. Should be in a 3h2m1s format. + name: timeout + type: string + default: "30m" + - description: Secret to use when connecting to a VM. + name: secretName + type: string + default: "__empty__" + - description: Command to execute in a VM. + name: command + type: array + default: [] + - description: Arguments of a command. + name: args + type: array + default: [] + - description: Script to execute in a VM. + name: script + type: string + default: "" + steps: + - name: execute-in-vm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--stop' + - $(params.stop) + - '--delete' + - $(params.delete) + - '--timeout' + - $(params.timeout) + - '--' + - $(params.command) + - $(params.args) + env: + - name: COMMAND + value: execute-in-vm + - name: VM_NAME + value: $(params.vmName) + - name: VM_NAMESPACE + value: $(params.vmNamespace) + - name: EXECUTE_SCRIPT + value: $(params.script) + - name: CONNECTION_SECRET_NAME + value: $(params.secretName) + volumeMounts: + - mountPath: /data/connectionsecret/ + name: connectionsecret + readOnly: true + volumes: + - name: connectionsecret + secret: + secretName: $(params.secretName) + optional: true + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cleanup-vm-task +rules: + - verbs: + - get + - list + - watch + - delete + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - update + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - virtualmachines/stop + - virtualmachines/restart + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cleanup-vm-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cleanup-vm-task +roleRef: + kind: ClusterRole + name: cleanup-vm-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: cleanup-vm-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + tekton.dev/deprecated: "true" + task.kubevirt.io/associatedServiceAccount: copy-template-task + sourceTemplateName.params.task.kubevirt.io/kind: Template + sourceTemplateName.params.task.kubevirt.io/apiVersion: template.openshift.io/v1 + sourceTemplateNamespace.params.task.kubevirt.io/type: namespace + targetTemplateName.params.task.kubevirt.io/kind: Template + targetTemplateName.params.task.kubevirt.io/apiVersion: template.openshift.io/v1 + targetTemplateNamespace.params.task.kubevirt.io/type: namespace + allowReplace.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: copy-template + task.kubevirt.io/category: copy-template + name: copy-template +spec: + params: + - name: sourceTemplateName + description: Name of an OpenShift template to copy template from. + type: string + - name: sourceTemplateNamespace + description: Namespace of an source OpenShift template to copy template from. (defaults to active namespace) + type: string + default: "" + - name: targetTemplateName + description: Name of an target OpenShift template. + type: string + default: "" + - name: targetTemplateNamespace + description: Namespace of an target OpenShift template to create in. (defaults to active namespace) + type: string + default: "" + - name: allowReplace + description: Allow replacing already existing template (same combination name/namespace). Allowed values true/false + type: string + default: "false" + results: + - name: name + description: The name of a template that was created. + - name: namespace + description: The namespace of a template that was created. + steps: + - name: copytemplate + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - copy-template + args: + - "--output=yaml" + env: + - name: SOURCE_TEMPLATE_NAME + value: $(params.sourceTemplateName) + - name: SOURCE_TEMPLATE_NAMESPACE + value: $(params.sourceTemplateNamespace) + - name: TARGET_TEMPLATE_NAME + value: $(params.targetTemplateName) + - name: TARGET_TEMPLATE_NAMESPACE + value: $(params.targetTemplateNamespace) + - name: ALLOW_REPLACE + value: $(params.allowReplace) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: copy-template-task +rules: + - verbs: + - get + - list + - watch + - create + - update + apiGroups: + - template.openshift.io + resources: + - templates + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: copy-template-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: copy-template-task +roleRef: + kind: ClusterRole + name: copy-template-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: copy-template-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: create-vm-from-manifest-task + manifest.params.task.kubevirt.io/type: resource-yaml + manifest.params.task.kubevirt.io/kind: VirtualMachine + manifest.params.task.kubevirt.io/apiVersion: kubevirt.io/v1 + namespace.params.task.kubevirt.io/type: namespace + dataVolumes.params.task.kubevirt.io/kind: DataVolume + dataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + ownDataVolumes.params.task.kubevirt.io/kind: DataVolume + ownDataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + persistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + persistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + ownPersistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + ownPersistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + startVM.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: create-vm-from-manifest + task.kubevirt.io/category: create-vm + name: create-vm-from-manifest +spec: + params: + - name: manifest + description: YAML manifest of a VirtualMachine resource to be created. + default: "" + type: string + - name: virtctl + description: "Parameters for virtctl create vm command that will be used to create VirtualMachine." + default: "" + type: string + - name: namespace + description: Namespace where to create the VM. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: startVM + description: Set to true or false to start / not start vm after creation. In case of runStrategy is set to Always, startVM flag is ignored. + default: "" + type: string + - name: runStrategy + description: Set runStrategy to VM. If runStrategy is set, vm.spec.running attribute is set to nil. + default: "" + type: string + results: + - name: name + description: The name of a VM that was created. + - name: namespace + description: The namespace of a VM that was created. + steps: + - name: createvm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - create-vm + args: + - "--output=yaml" + env: + - name: VM_MANIFEST + value: $(params.manifest) + - name: VM_NAMESPACE + value: $(params.namespace) + - name: VIRTCTL + value: $(params.virtctl) + - name: START_VM + value: $(params.startVM) + - name: RUN_STRATEGY + value: $(params.runStrategy) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: create-vm-from-manifest-task +rules: + - verbs: + - get + - list + - watch + - create + - update + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - 'update' + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - verbs: + - '*' + apiGroups: + - kubevirt.io + resources: + - virtualmachines/finalizers + - verbs: + - '*' + apiGroups: + - '' + resources: + - persistentvolumeclaims + - verbs: + - '*' + apiGroups: + - cdi.kubevirt.io + resources: + - datavolumes + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: create-vm-from-manifest-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: create-vm-from-manifest-task +roleRef: + kind: ClusterRole + name: create-vm-from-manifest-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: create-vm-from-manifest-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: create-vm-from-template-task + tekton.dev/deprecated: "true" + templateName.params.task.kubevirt.io/type: vm-template-name + templateName.params.task.kubevirt.io/kind: Template + templateName.params.task.kubevirt.io/apiVersion: template.openshift.io/v1 + templateNamespace.params.task.kubevirt.io/type: namespace + templateParams.params.task.kubevirt.io/type: template-params-array + vmNamespace.params.task.kubevirt.io/type: namespace + dataVolumes.params.task.kubevirt.io/kind: DataVolume + dataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + ownDataVolumes.params.task.kubevirt.io/kind: DataVolume + ownDataVolumes.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + persistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + persistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + ownPersistentVolumeClaims.params.task.kubevirt.io/kind: PersistentVolumeClaim + ownPersistentVolumeClaims.params.task.kubevirt.io/apiVersion: v1 + startVM.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: create-vm-from-template + task.kubevirt.io/category: create-vm + name: create-vm-from-template +spec: + params: + - name: templateName + description: Name of an OKD template to create VM from. + type: string + - name: templateNamespace + description: Namespace of an OKD template to create VM from. (defaults to active namespace) + default: "" + type: string + - name: templateParams + description: Template params to pass when processing the template manifest. Each param should have KEY:VAL format. Eg ["NAME:my-vm", "DESC:blue"] + default: [] + type: array + - name: vmNamespace + description: Namespace where to create the VM. (defaults to active namespace) + default: "" + type: string + - name: startVM + description: Set to true or false to start / not start vm after creation. In case of runStrategy is set to Always, startVM flag is ignored. + default: "" + type: string + - name: runStrategy + description: Set runStrategy to VM. If runStrategy is set, vm.spec.running attribute is set to nil. + default: "" + type: string + results: + - name: name + description: The name of a VM that was created. + - name: namespace + description: The namespace of a VM that was created. + steps: + - name: createvm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - create-vm + args: + - "--output=yaml" + - '--template-params' + - $(params.templateParams) + env: + - name: TEMPLATE_NAME + value: $(params.templateName) + - name: TEMPLATE_NAMESPACE + value: $(params.templateNamespace) + - name: VM_NAMESPACE + value: $(params.vmNamespace) + - name: START_VM + value: $(params.startVM) + - name: RUN_STRATEGY + value: $(params.runStrategy) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: create-vm-from-template-task +rules: + - verbs: + - get + - list + - watch + - create + - update + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - '*' + apiGroups: + - kubevirt.io + resources: + - virtualmachines/finalizers + - verbs: + - get + - list + - watch + apiGroups: + - template.openshift.io + resources: + - templates + - verbs: + - create + apiGroups: + - template.openshift.io + resources: + - processedtemplates + - verbs: + - '*' + apiGroups: + - '' + resources: + - persistentvolumeclaims + - verbs: + - '*' + apiGroups: + - cdi.kubevirt.io + resources: + - datavolumes + - verbs: + - 'update' + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: create-vm-from-template-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: create-vm-from-template-task +roleRef: + kind: ClusterRole + name: create-vm-from-template-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: create-vm-from-template-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + pvc.params.task.kubevirt.io/kind: PersistentVolumeClaim + pvc.params.task.kubevirt.io/apiVersion: v1 + customizeCommands.params.task.kubevirt.io/type: script + verbose.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: disk-virt-customize + task.kubevirt.io/category: disk-virt-customize + name: disk-virt-customize +spec: + params: + - name: pvc + description: PersistentVolumeClaim to run the the virt-customize script in. PVC should be in the same namespace as taskrun/pipelinerun. + type: string + - name: customizeCommands + description: virt-customize commands in "--commands-from-file" format. + type: string + default: "" + - name: verbose + description: Enable verbose mode and tracing of libguestfs API calls. + type: string + default: 'false' + - name: additionalOptions + description: Additional options to pass to virt-customize. + type: string + default: "" + steps: + - name: run-virt-customize + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + command: + - entrypoint + args: + - '--verbose' + - $(params.verbose) + env: + - name: COMMAND + value: disk-virt-customize + - name: CUSTOMIZE_COMMANDS + value: $(params.customizeCommands) + - name: ADDITIONAL_VIRT_CUSTOMIZE_OPTIONS + value: $(params.additionalOptions) + - name: LIBGUESTFS_BACKEND + value: direct + resources: + limits: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + requests: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + volumeMounts: + - mountPath: /mnt/appliance/ + name: guestfsappliance + - mountPath: /mnt/targetpvc/ + name: targetpvc + volumes: + - name: guestfsappliance + emptyDir: {} + - name: targetpvc + persistentVolumeClaim: + claimName: $(params.pvc) + workspaces: + - name: data01 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data01 + - name: data02 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data02 + - name: data03 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data03 + - name: data04 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data04 + - name: data05 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data05 + - name: data06 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data06 + - name: data07 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data07 + - name: data08 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data08 + - name: data09 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data09 + - name: data10 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data10 +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + pvc.params.task.kubevirt.io/kind: PersistentVolumeClaim + pvc.params.task.kubevirt.io/apiVersion: v1 + sysprepCommands.params.task.kubevirt.io/type: script + verbose.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: disk-virt-sysprep + task.kubevirt.io/category: disk-virt-sysprep + name: disk-virt-sysprep +spec: + params: + - name: pvc + description: PersistentVolumeClaim to run the the virt-sysprep script in. PVC should be in the same namespace as taskrun/pipelinerun. + type: string + - name: sysprepCommands + description: virt-sysprep commands in "--commands-from-file" format. + type: string + default: "" + - name: verbose + description: Enable verbose mode and tracing of libguestfs API calls. + type: string + default: 'false' + - name: additionalOptions + description: Additional options to pass to virt-sysprep. + type: string + default: "" + steps: + - name: run-virt-sysprep + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + command: + - entrypoint + args: + - '--verbose' + - $(params.verbose) + env: + - name: COMMAND + value: disk-virt-sysprep + - name: SYSPREP_COMMANDS + value: $(params.sysprepCommands) + - name: ADDITIONAL_VIRT_SYSPREP_OPTIONS + value: $(params.additionalOptions) + - name: LIBGUESTFS_BACKEND + value: direct + resources: + limits: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + requests: + devices.kubevirt.io/kvm: '1' + devices.kubevirt.io/tun: '1' + devices.kubevirt.io/vhost-net: '1' + volumeMounts: + - mountPath: /mnt/appliance/ + name: guestfsappliance + - mountPath: /mnt/targetpvc/ + name: targetpvc + volumes: + - name: guestfsappliance + emptyDir: {} + - name: targetpvc + persistentVolumeClaim: + claimName: $(params.pvc) + workspaces: + - name: data01 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data01 + - name: data02 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data02 + - name: data03 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data03 + - name: data04 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data04 + - name: data05 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data05 + - name: data06 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data06 + - name: data07 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data07 + - name: data08 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data08 + - name: data09 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data09 + - name: data10 + description: | + An optional workspace that may contain files or secrets to be + used during the virt-customize run. + optional: true + mountPath: /data10 +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: execute-in-vm-task + vmNamespace.params.task.kubevirt.io/type: namespace + secretName.params.task.kubevirt.io/type: execute-in-vm-secret + script.params.task.kubevirt.io/type: script + labels: + task.kubevirt.io/type: execute-in-vm + task.kubevirt.io/category: execute-in-vm + name: execute-in-vm +spec: + params: + - description: Name of a VM to execute the action in. + name: vmName + type: string + - description: Namespace of a VM to execute the action in. (defaults to active namespace) + name: vmNamespace + type: string + default: "" + - description: Secret to use when connecting to a VM. + name: secretName + type: string + default: "__empty__" + - description: Command to execute in a VM. + name: command + type: array + default: [] + - description: Arguments of a command. + name: args + type: array + default: [] + - description: Script to execute in a VM. + name: script + type: string + default: "" + steps: + - name: execute-in-vm + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--' + - $(params.command) + - $(params.args) + env: + - name: COMMAND + value: execute-in-vm + - name: VM_NAME + value: $(params.vmName) + - name: VM_NAMESPACE + value: $(params.vmNamespace) + - name: EXECUTE_SCRIPT + value: $(params.script) + - name: CONNECTION_SECRET_NAME + value: $(params.secretName) + volumeMounts: + - mountPath: /data/connectionsecret/ + name: connectionsecret + readOnly: true + volumes: + - name: connectionsecret + secret: + secretName: $(params.secretName) + optional: true + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: execute-in-vm-task +rules: + - verbs: + - get + - list + - watch + apiGroups: + - kubevirt.io + resources: + - virtualmachines + - virtualmachineinstances + - verbs: + - update + apiGroups: + - subresources.kubevirt.io + resources: + - virtualmachines/start + - virtualmachines/stop + - virtualmachines/restart + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: execute-in-vm-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: execute-in-vm-task +roleRef: + kind: ClusterRole + name: execute-in-vm-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: execute-in-vm-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: generate-ssh-keys-task + publicKeySecretName.params.task.kubevirt.io/kind: Secret + publicKeySecretName.params.task.kubevirt.io/apiVersion: v1 + publicKeySecretNamespace.params.task.kubevirt.io/type: namespace + privateKeySecretName.params.task.kubevirt.io/kind: Secret + privateKeySecretName.params.task.kubevirt.io/apiVersion: v1 + privateKeySecretNamespace.params.task.kubevirt.io/type: namespace + privateKeyConnectionOptions.params.task.kubevirt.io/type: private-key-options-array + labels: + task.kubevirt.io/type: generate-ssh-keys + task.kubevirt.io/category: generate-ssh-keys + name: generate-ssh-keys +spec: + params: + - name: publicKeySecretName + description: Name of a new or existing secret to append the generated public key to. The name will be generated and new secret created if not specified. + default: "" + type: string + - name: publicKeySecretNamespace + description: Namespace of publicKeySecretName. (defaults to active namespace) + default: "" + type: string + - name: privateKeySecretName + description: Name of a new secret to add the generated private key to. The name will be generated if not specified. The secret uses format of execute-in-vm task. + default: "" + type: string + - name: privateKeySecretNamespace + description: Namespace of privateKeySecretName. (defaults to active namespace) + default: "" + type: string + - name: privateKeyConnectionOptions + description: Additional options to use in SSH client. Please see execute-in-vm task SSH section for more details. Eg ["host-public-key:ssh-rsa AAAAB...", "additional-ssh-options:-p 8022"]. + default: [] + type: array + - name: additionalSSHKeygenOptions + description: Additional options to pass to the ssh-keygen command. + default: "" + type: string + results: + - name: publicKeySecretName + description: The name of a public key secret. + - name: publicKeySecretNamespace + description: The namespace of a public key secret. + - name: privateKeySecretName + description: The name of a private key secret. + - name: privateKeySecretNamespace + description: The namespace of a private key secret. + steps: + - name: generate-ssh-keys + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + args: + - '--' + - $(params.privateKeyConnectionOptions) + env: + - name: COMMAND + value: generate-ssh-keys + - name: PUBLIC_KEY_SECRET_NAME + value: $(params.publicKeySecretName) + - name: PUBLIC_KEY_SECRET_NAMESPACE + value: $(params.publicKeySecretNamespace) + - name: PRIVATE_KEY_SECRET_NAME + value: $(params.privateKeySecretName) + - name: PRIVATE_KEY_SECRET_NAMESPACE + value: $(params.privateKeySecretNamespace) + - name: ADDITIONAL_SSH_KEYGEN_OPTIONS + value: $(params.additionalSSHKeygenOptions) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: generate-ssh-keys-task +rules: + - verbs: + - '*' + apiGroups: + - '' + resources: + - secrets + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: generate-ssh-keys-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: generate-ssh-keys-task +roleRef: + kind: ClusterRole + name: generate-ssh-keys-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: generate-ssh-keys-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: modify-data-object-task + manifest.params.task.kubevirt.io/type: resource-yaml + manifest.params.task.kubevirt.io/apiVersion: cdi.kubevirt.io/v1beta1 + waitForSuccess.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: modify-data-object + task.kubevirt.io/category: modify-data-object + name: modify-data-object +spec: + description: >- + This task modifies a data object (DataVolume or DataSource). It can optionally wait until CDI imports finish. + params: + - name: manifest + description: YAML manifest of a data object to be created. + type: string + default: '' + - name: namespace + description: Namespace where to create the data object. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: waitForSuccess + description: Set to "true" or "false" if container should wait for Ready condition of the data object. + default: 'false' + type: string + - name: allowReplace + description: Allow replacing an already existing data object (same combination name/namespace). Allowed values true/false + type: string + default: "false" + - name: deleteObject + description: Set to `true` or `false` if task should delete the specified DataVolume, DataSource or PersistentVolumeClaim. If set to 'true' the ds/dv/pvc will be deleted and all other parameters are ignored. + default: 'false' + type: string + - name: deleteObjectKind + description: Kind of the data object to delete. This parameter is used only for Delete operation. + default: "" + type: string + - name: deleteObjectName + description: Name of the data object to delete. This parameter is used only for Delete operation. + default: "" + type: string + results: + - name: name + description: The name of the data object that was created. + - name: namespace + description: The namespace of the data object that was created. + steps: + - name: modify-data-object + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - modify-data-object + args: + - "--output=yaml" + env: + - name: DATA_OBJECT_MANIFEST + value: $(params.manifest) + - name: DATA_OBJECT_NAMESPACE + value: $(params.namespace) + - name: WAIT_FOR_SUCCESS + value: $(params.waitForSuccess) + - name: ALLOW_REPLACE + value: $(params.allowReplace) + - name: DELETE_OBJECT + value: $(params.deleteObject) + - name: DELETE_OBJECT_KIND + value: $(params.deleteObjectKind) + - name: DELETE_OBJECT_NAME + value: $(params.deleteObjectName) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: modify-data-object-task +rules: + - verbs: + - get + - create + - delete + apiGroups: + - cdi.kubevirt.io + resources: + - datavolumes + - datasources + - verbs: + - create + apiGroups: + - "" + resources: + - pods + - verbs: + - get + - delete + apiGroups: + - "" + resources: + - persistentvolumeclaims + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: modify-data-object-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: modify-data-object-task +roleRef: + kind: ClusterRole + name: modify-data-object-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: modify-data-object-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + tekton.dev/deprecated: "true" + task.kubevirt.io/associatedServiceAccount: modify-vm-template-task + templateName.params.task.kubevirt.io/kind: Template + templateName.params.task.kubevirt.io/apiVersion: template.openshift.io/v1 + templateNamespace.params.task.kubevirt.io/kind: namespace + cpuSockets.params.task.kubevirt.io/type: number + cpuCores.params.task.kubevirt.io/type: number + cpuThreads.params.task.kubevirt.io/type: number + memory.params.task.kubevirt.io/type: memory + deleteDatavolumeTemplate.params.task.kubevirt.io/type: boolean + deleteTemplateParameters.params.task.kubevirt.io/type: boolean + deleteTemplate.params.task.kubevirt.io/type: boolean + labels: + task.kubevirt.io/type: modify-vm-template + task.kubevirt.io/category: modify-vm-template + name: modify-vm-template +spec: + params: + - name: templateName + description: Name of an OpenShift template. + type: string + - name: templateNamespace + description: Namespace of an source OpenShift template. (defaults to active namespace) + type: string + default: "" + - name: cpuSockets + description: Number of CPU sockets + type: string + default: "0" + - name: cpuCores + description: Number of CPU cores + type: string + default: "0" + - name: cpuThreads + description: Number of CPU threads + type: string + default: "0" + - name: memory + description: Number of memory vm can use + type: string + default: "" + - description: Template labels. If template contains same label, it will be replaced. Each param should have KEY:VAL format. Eg ["key:value", "key:value"]. + name: templateLabels + type: array + default: [] + - description: Template Annotations. If template contains same annotation, it will be replaced. Each param should have KEY:VAL format. Eg ["key:value", "key:value"] + name: templateAnnotations + type: array + default: [] + - description: VM labels. If VM contains same label, it will be replaced. Each param should have KEY:VAL format. Eg ["key:value", "key:value"]. + name: vmLabels + type: array + default: [] + - description: VM annotations. If VM contains same annotation, it will be replaced. Each param should have KEY:VAL format. Eg ["key:value", "key:value"]. + name: vmAnnotations + type: array + default: [] + - description: 'VM disks in json format, replace vm disk if same name, otherwise new disk is appended. Eg [{"name": "test", "cdrom": {"bus": "sata"}}, {"name": "disk2"}]' + name: disks + type: array + default: [] + - name: deleteDisks + description: Set to "true" or "false" if task should delete VM disks. New disks (from disks parameter) are applied, after old disks are deleted. + default: 'false' + type: string + - description: 'VM volumes in json format, replace vm volume if same name, otherwise new volume is appended. Eg [{"name": "virtiocontainerdisk", "containerDisk": {"image": "kubevirt/virtio-container-disk"}}]' + name: volumes + type: array + default: [] + - description: 'Datavolume templates in json format, replace datavolume if same name, otherwise new datavolume is appended. If deleteDatavolumeTemplate is set, first datavolumes are deleted and then datavolumes from this attribute are added. Eg [{"apiVersion": "cdi.kubevirt.io/v1beta1", "kind": "DataVolume", "metadata":{"name": "test1"}, "spec": {"source": {"http": {"url": "test.somenonexisting"}}}}]' + name: datavolumeTemplates + type: array + default: [] + - name: deleteDatavolumeTemplate + description: Set to "true" or "false" if task should delete datavolume template in template and all associated volumes and disks. + default: 'false' + type: string + - name: deleteVolumes + description: Set to "true" or "false" if task should delete VM volumes. New volumes (from volumes parameter) are applied, after old volumes are deleted. + default: 'false' + type: string + - name: templateParameters + description: 'Definition of template parameters. Eg [{"description": "VM name", "name": "NAME"}]' + default: [] + type: array + - name: deleteTemplateParameters + description: Set to "true" or "false" if task should delete template parameters. New parameters (from templateParameters parameter) are applied, after old parameters are deleted. + default: 'false' + type: string + - name: deleteTemplate + description: Set to `true` or `false` if task should delete the specified template. If set to 'true' the template will be deleted and all other parameters are ignored. + default: 'false' + type: string + + results: + - name: name + description: The name of a template that was updated. + - name: namespace + description: The namespace of a template that was updated. + steps: + - name: modifyvmtemplate + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - modify-vm-template + args: + - "--output=yaml" + - "--template-labels" + - $(params.templateLabels) + - "--template-annotations" + - $(params.templateAnnotations) + - "--vm-labels" + - $(params.vmLabels) + - "--vm-annotations" + - $(params.vmAnnotations) + - "--disks" + - $(params.disks) + - "--volumes" + - $(params.volumes) + - "--datavolumeTemplates" + - $(params.datavolumeTemplates) + - "--templateParameters" + - $(params.templateParameters) + env: + - name: TEMPLATE_NAME + value: $(params.templateName) + - name: TEMPLATE_NAMESPACE + value: $(params.templateNamespace) + - name: CPU_SOCKETS + value: $(params.cpuSockets) + - name: CPU_CORES + value: $(params.cpuCores) + - name: CPU_THREADS + value: $(params.cpuThreads) + - name: MEMORY + value: $(params.memory) + - name: DELETE_DATAVOLUME_TEMPLATE + value: $(params.deleteDatavolumeTemplate) + - name: DELETE_DISKS + value: $(params.deleteDisks) + - name: DELETE_VOLUMES + value: $(params.deleteVolumes) + - name: DELETE_TEMPLATE_PARAMETERS + value: $(params.deleteTemplateParameters) + - name: DELETE_TEMPLATE + value: $(params.deleteTemplate) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: modify-vm-template-task +rules: + - verbs: + - get + - list + - patch + - delete + apiGroups: + - template.openshift.io + resources: + - templates + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: modify-vm-template-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: modify-vm-template-task +roleRef: + kind: ClusterRole + name: modify-vm-template-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: modify-vm-template-task +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: modify-windows-iso-file-task + labels: + task.kubevirt.io/type: modify-windows-iso-file + task.kubevirt.io/category: modify-windows-iso-file + name: modify-windows-iso-file +spec: + params: + - name: pvcName + description: PersistentVolumeClaim which contains windows iso. + type: string + default: "" + steps: + - name: modify-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + script: | + #!/bin/bash + set -x + + export LIBGUESTFS_PATH=/usr/local/lib/guestfs/appliance + export ISO_FILES_PATH="/tmp/extracted-iso-files" + export EFI_BOOT="${ISO_FILES_PATH}/efi/microsoft/boot" + export TARGET_IMG_FILE_PATH="tmp/target-pvc/disk.img" + + guestfish -a ${TARGET_IMG_FILE_PATH} -m /dev/sda tar-out / - | tar xvf - -C ${ISO_FILES_PATH} -m --no-overwrite-dir --owner=$(id -u) --group=$(id -g) --no-same-permissions + + if [ ! -f ${EFI_BOOT}/efisys_noprompt.bin ] || [ ! -f ${EFI_BOOT}/cdboot_noprompt.efi ]; then + echo "${EFI_BOOT}/efisys_noprompt.bin or ${EFI_BOOT}/cdboot_noprompt.efi not found in the iso file! Exiting" + exit 1 + fi + + chmod u+w "${ISO_FILES_PATH}/efi" "${ISO_FILES_PATH}/efi/microsoft" "${ISO_FILES_PATH}/efi/microsoft/boot" + chmod u+w "${EFI_BOOT}/efisys.bin" "${EFI_BOOT}/cdboot.efi" "${EFI_BOOT}/efisys_noprompt.bin" "${EFI_BOOT}/cdboot_noprompt.efi" + + rm "${EFI_BOOT}/efisys.bin" "${EFI_BOOT}/cdboot.efi" + + mv "${EFI_BOOT}/efisys_noprompt.bin" "${EFI_BOOT}/efisys.bin" + mv "${EFI_BOOT}/cdboot_noprompt.efi" "${EFI_BOOT}/cdboot.efi" + env: + - name: "LIBGUESTFS_BACKEND" + value: "direct" + - name: "HOME" + value: "/usr/local/lib/guestfs/appliance" + resources: + limits: + devices.kubevirt.io/kvm: '1' + requests: + devices.kubevirt.io/kvm: '1' + volumeMounts: + - mountPath: /tmp/target-pvc/ + name: target-pvc + - mountPath: /tmp/extracted-iso-files/ + name: extracted-iso-files + - name: create-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + script: | + #!/bin/bash + set -ex + export ISO_FILES_PATH="/tmp/extracted-iso-files" + export ISO_FILE_PATH="/tmp/iso-file/disk.iso" + + xorriso -as mkisofs -no-emul-boot \ + -e "efi/microsoft/boot/efisys.bin" \ + -boot-load-size 1 \ + -iso-level 4 \ + -J -l -D -N \ + -joliet-long \ + -relaxed-filenames \ + -V "WINDOWS" \ + -o ${ISO_FILE_PATH} ${ISO_FILES_PATH} + volumeMounts: + - mountPath: /tmp/extracted-iso-files/ + name: extracted-iso-files + - mountPath: /tmp/iso-file/ + name: iso-file + - name: convert-iso-file + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + image: "quay.io/kubevirt/tekton-tasks-disk-virt:v0.15.0" + script: | + #!/bin/bash + set -x + export ISO_FILE_PATH="/tmp/iso-file/disk.iso" + export TARGET_IMG_FILE_PATH="/tmp/target-pvc/disk.img" + + rm ${TARGET_IMG_FILE_PATH} + qemu-img convert -t writeback -p -O raw ${ISO_FILE_PATH} ${TARGET_IMG_FILE_PATH} + volumeMounts: + - mountPath: /tmp/target-pvc/ + name: target-pvc + - mountPath: /tmp/iso-file/ + name: iso-file + volumes: + - name: target-pvc + persistentVolumeClaim: + claimName: "$(params.pvcName)" + - name: extracted-iso-files + emptyDir: + sizeLimit: 12Gi + - name: iso-file + emptyDir: + sizeLimit: 12Gi +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + annotations: + task.kubevirt.io/associatedServiceAccount: wait-for-vmi-status-task + vmiNamespace.params.task.kubevirt.io/type: namespace + labels: + task.kubevirt.io/type: wait-for-vmi-status + task.kubevirt.io/category: wait-for-vmi-status + name: wait-for-vmi-status +spec: + params: + - name: vmiName + description: Name of a VirtualMachineInstance to wait for. + type: string + - name: vmiNamespace + description: Namespace of a VirtualMachineInstance to wait for. (defaults to manifest namespace or active namespace) + default: "" + type: string + - name: successCondition + default: "" + description: A label selector expression to decide if the VirtualMachineInstance (VMI) is in a success state. Eg. "status.phase == Succeeded". It is evaluated on each VMI update and will result in this task succeeding if true. + - name: failureCondition + default: "" + description: A label selector expression to decide if the VirtualMachineInstance (VMI) is in a failed state. Eg. "status.phase in (Failed, Unknown)". It is evaluated on each VMI update and will result in this task failing if true. + steps: + - name: wait-for-vmi-status + image: "quay.io/kubevirt/tekton-tasks:v0.15.0" + command: + - entrypoint + env: + - name: COMMAND + value: wait-for-vmi-status + - name: VMI_NAME + value: $(params.vmiName) + - name: VMI_NAMESPACE + value: $(params.vmiNamespace) + - name: SUCCESS_CONDITION + value: $(params.successCondition) + - name: FAILURE_CONDITION + value: $(params.failureCondition) + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: wait-for-vmi-status-task +rules: + - verbs: + - get + - list + - watch + apiGroups: + - kubevirt.io + resources: + - virtualmachineinstances + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: wait-for-vmi-status-task + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: wait-for-vmi-status-task +roleRef: + kind: ClusterRole + name: wait-for-vmi-status-task + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: wait-for-vmi-status-task diff --git a/hack/csv-generator.go b/hack/csv-generator.go index 0e0a899ae..62dad6a21 100644 --- a/hack/csv-generator.go +++ b/hack/csv-generator.go @@ -36,25 +36,18 @@ import ( ) type generatorFlags struct { - file string - dumpCRDs bool - removeCerts bool - webhookPort int32 - csvVersion string - namespace string - operatorImage string - operatorVersion string - validatorImage string - waitForVMIStatusImage string - modifyVMTemplateImage string - diskVirtSysprepImage string - diskVirtCustomizeImage string - createVMImage string - modifyDataObjectImage string - copyTemplateImage string - cleanupVMImage string - generateSSHKeys string - virtioImage string + file string + dumpCRDs bool + removeCerts bool + webhookPort int32 + csvVersion string + namespace string + operatorImage string + operatorVersion string + validatorImage string + tektonTasksImage string + tektonTasksDiskVirtImage string + virtioImage string } var ( @@ -87,15 +80,8 @@ func init() { rootCmd.Flags().StringVar(&f.operatorImage, "operator-image", "", "Link to operator image (required)") rootCmd.Flags().StringVar(&f.operatorVersion, "operator-version", "", "Operator version (required)") rootCmd.Flags().StringVar(&f.validatorImage, "validator-image", "", "Link to template-validator image") - rootCmd.Flags().StringVar(&f.waitForVMIStatusImage, "wait-for-vmi-status-image", "", "Link to wait-for-vmi-status task image") - rootCmd.Flags().StringVar(&f.modifyVMTemplateImage, "modify-vm-template-image", "", "Link to modify-vm-template task image") - rootCmd.Flags().StringVar(&f.diskVirtSysprepImage, "disk-virt-sysprep-image", "", "Link to disk-virt-sysprep task image") - rootCmd.Flags().StringVar(&f.diskVirtCustomizeImage, "disk-virt-customize-image", "", "Link to disk-virt-customize task image") - rootCmd.Flags().StringVar(&f.createVMImage, "create-vm-image", "", "Link to create-vm task image") - rootCmd.Flags().StringVar(&f.modifyDataObjectImage, "modify-data-object-image", "", "Link to modify-data-object task image") - rootCmd.Flags().StringVar(&f.copyTemplateImage, "copy-template-image", "", "Link to copy-template-image task image") - rootCmd.Flags().StringVar(&f.generateSSHKeys, "generate-ssh-keys", "", "Link to generate-ssh-keys task image") - rootCmd.Flags().StringVar(&f.cleanupVMImage, "cleanup-vm-image", "", "Link to cleanup-vm-image task image") + rootCmd.Flags().StringVar(&f.tektonTasksImage, "tekton-tasks-image", "", "Link to tekton tasks image") + rootCmd.Flags().StringVar(&f.tektonTasksDiskVirtImage, "tekton-tasks-disk-virt-image", "", "Link to tekton tasks disk virt image") rootCmd.Flags().StringVar(&f.virtioImage, "virtio-image", "", "Link to virtio image") rootCmd.Flags().Int32Var(&f.webhookPort, "webhook-port", 0, "Container port for the admission webhook") rootCmd.Flags().BoolVar(&f.removeCerts, "webhook-remove-certs", false, "Remove the webhook certificate volume and mount") @@ -206,78 +192,16 @@ func buildRelatedImages(flags generatorFlags) ([]interface{}, error) { relatedImages = append(relatedImages, relatedImage) } - if flags.cleanupVMImage != "" { - relatedImage, err := buildRelatedImage(flags.cleanupVMImage, "cleanup-vm") + if flags.tektonTasksImage != "" { + relatedImage, err := buildRelatedImage(flags.tektonTasksImage, "tekton-tasks") if err != nil { return nil, err } relatedImages = append(relatedImages, relatedImage) } - if flags.copyTemplateImage != "" { - relatedImage, err := buildRelatedImage(flags.copyTemplateImage, "copy-template") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.generateSSHKeys != "" { - relatedImage, err := buildRelatedImage(flags.generateSSHKeys, "generate-ssh-keys") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.modifyDataObjectImage != "" { - relatedImage, err := buildRelatedImage(flags.modifyDataObjectImage, "modify-data-object") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.createVMImage != "" { - relatedImage, err := buildRelatedImage(flags.createVMImage, "create-vm-from-manifest") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - - relatedImage, err = buildRelatedImage(flags.createVMImage, "create-vm-from-template") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.diskVirtCustomizeImage != "" { - relatedImage, err := buildRelatedImage(flags.diskVirtCustomizeImage, "disk-virt-customize") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.waitForVMIStatusImage != "" { - relatedImage, err := buildRelatedImage(flags.waitForVMIStatusImage, "wait-for-vmi-status") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.modifyVMTemplateImage != "" { - relatedImage, err := buildRelatedImage(flags.modifyVMTemplateImage, "modify-vm-template") - if err != nil { - return nil, err - } - relatedImages = append(relatedImages, relatedImage) - } - - if flags.diskVirtSysprepImage != "" { - relatedImage, err := buildRelatedImage(flags.diskVirtSysprepImage, "disk-virt-sysprep") + if flags.tektonTasksDiskVirtImage != "" { + relatedImage, err := buildRelatedImage(flags.tektonTasksDiskVirtImage, "tekton-tasks-disk-virt") if err != nil { return nil, err } @@ -335,41 +259,13 @@ func updateContainerEnvVars(flags generatorFlags, container v1.Container) []v1.E if flags.operatorVersion != "" { envVariable.Value = flags.operatorVersion } - case common.CleanupVMImageKey: - if flags.cleanupVMImage != "" { - envVariable.Value = flags.cleanupVMImage - } - case common.CopyTemplateImageKey: - if flags.copyTemplateImage != "" { - envVariable.Value = flags.copyTemplateImage - } - case common.ModifyDataObjectImageKey: - if flags.modifyDataObjectImage != "" { - envVariable.Value = flags.modifyDataObjectImage - } - case common.CreateVMImageKey: - if flags.createVMImage != "" { - envVariable.Value = flags.createVMImage - } - case common.DiskVirtCustomizeImageKey: - if flags.diskVirtCustomizeImage != "" { - envVariable.Value = flags.diskVirtCustomizeImage - } - case common.DiskVirtSysprepImageKey: - if flags.diskVirtSysprepImage != "" { - envVariable.Value = flags.diskVirtSysprepImage - } - case common.ModifyVMTemplateImageKey: - if flags.modifyVMTemplateImage != "" { - envVariable.Value = flags.modifyVMTemplateImage - } - case common.WaitForVMISTatusImageKey: - if flags.waitForVMIStatusImage != "" { - envVariable.Value = flags.waitForVMIStatusImage + case common.TektonTasksImageKey: + if flags.tektonTasksImage != "" { + envVariable.Value = flags.tektonTasksImage } - case common.GenerateSSHKeysImageKey: - if flags.generateSSHKeys != "" { - envVariable.Value = flags.generateSSHKeys + case common.TektonTasksDiskVirtImageKey: + if flags.tektonTasksDiskVirtImage != "" { + envVariable.Value = flags.tektonTasksDiskVirtImage } case common.VirtioImageKey: if flags.virtioImage != "" { diff --git a/hack/csv-generator_test.go b/hack/csv-generator_test.go index 9a5c0a57b..1afb0d110 100644 --- a/hack/csv-generator_test.go +++ b/hack/csv-generator_test.go @@ -22,29 +22,17 @@ var _ = Describe("csv generator", func() { namespace: "testOperatorNamespace", operatorVersion: "testOperatorVersion", - operatorImage: "test", - validatorImage: "test", - waitForVMIStatusImage: "testWaitImage", - modifyVMTemplateImage: "testModifyImage", - diskVirtSysprepImage: "testSysprepImage", - diskVirtCustomizeImage: "testCustomizeImage", - createVMImage: "testCreateVMImage", - modifyDataObjectImage: "testDataObjectImage", - copyTemplateImage: "testCopyTemplateImage", - cleanupVMImage: "testCleanupImage", - virtioImage: "testVirtioImage", + operatorImage: "test", + validatorImage: "test", + tektonTasksImage: "testTektonTasksImage", + tektonTasksDiskVirtImage: "testTektonTasksDiskVirtImage", + virtioImage: "testVirtioImage", } envValues := []v1.EnvVar{ {Name: common.TemplateValidatorImageKey}, {Name: common.OperatorVersionKey}, - {Name: common.CleanupVMImageKey}, - {Name: common.CopyTemplateImageKey}, - {Name: common.ModifyDataObjectImageKey}, - {Name: common.CreateVMImageKey}, - {Name: common.DiskVirtCustomizeImageKey}, - {Name: common.DiskVirtSysprepImageKey}, - {Name: common.ModifyVMTemplateImageKey}, - {Name: common.WaitForVMISTatusImageKey}, + {Name: common.TektonTasksImageKey}, + {Name: common.TektonTasksDiskVirtImageKey}, {Name: common.VirtioImageKey}, } @@ -93,29 +81,11 @@ var _ = Describe("csv generator", func() { if envVariable.Name == common.OperatorVersionKey { Expect(envVariable.Value).To(Equal(flags.operatorVersion)) } - if envVariable.Name == common.CleanupVMImageKey { - Expect(envVariable.Value).To(Equal(flags.cleanupVMImage)) + if envVariable.Name == common.TektonTasksImageKey { + Expect(envVariable.Value).To(Equal(flags.tektonTasksImage)) } - if envVariable.Name == common.CopyTemplateImageKey { - Expect(envVariable.Value).To(Equal(flags.copyTemplateImage)) - } - if envVariable.Name == common.ModifyDataObjectImageKey { - Expect(envVariable.Value).To(Equal(flags.modifyDataObjectImage)) - } - if envVariable.Name == common.CreateVMImageKey { - Expect(envVariable.Value).To(Equal(flags.createVMImage)) - } - if envVariable.Name == common.DiskVirtCustomizeImageKey { - Expect(envVariable.Value).To(Equal(flags.diskVirtCustomizeImage)) - } - if envVariable.Name == common.DiskVirtSysprepImageKey { - Expect(envVariable.Value).To(Equal(flags.diskVirtSysprepImage)) - } - if envVariable.Name == common.ModifyVMTemplateImageKey { - Expect(envVariable.Value).To(Equal(flags.modifyVMTemplateImage)) - } - if envVariable.Name == common.WaitForVMISTatusImageKey { - Expect(envVariable.Value).To(Equal(flags.waitForVMIStatusImage)) + if envVariable.Name == common.TektonTasksDiskVirtImageKey { + Expect(envVariable.Value).To(Equal(flags.tektonTasksDiskVirtImage)) } if envVariable.Name == common.VirtioImageKey { Expect(envVariable.Value).To(Equal(flags.virtioImage)) diff --git a/internal/common/environment.go b/internal/common/environment.go index 88edac135..c2492b89b 100644 --- a/internal/common/environment.go +++ b/internal/common/environment.go @@ -16,76 +16,27 @@ import ( ) const ( - OperatorVersionKey = "OPERATOR_VERSION" - TemplateValidatorImageKey = "VALIDATOR_IMAGE" - CleanupVMImageKey = "CLEANUP_VM_IMG" - CopyTemplateImageKey = "COPY_TEMPLATE_IMG" - ModifyDataObjectImageKey = "MODIFY_DATA_OBJECT_IMG" - CreateVMImageKey = "CREATE_VM_IMG" - DiskVirtCustomizeImageKey = "DISK_VIRT_CUSTOMIZE_IMG" - DiskVirtSysprepImageKey = "DISK_VIRT_SYSPREP_IMG" - ModifyVMTemplateImageKey = "MODIFY_VM_TEMPLATE_IMG" - WaitForVMISTatusImageKey = "WAIT_FOR_VMI_STATUS_IMG" - VirtioImageKey = "VIRTIO_IMG" - GenerateSSHKeysImageKey = "GENERATE_SSH_KEYS_IMG" + OperatorVersionKey = "OPERATOR_VERSION" + TemplateValidatorImageKey = "VALIDATOR_IMAGE" + TektonTasksImageKey = "TEKTON_TASKS_IMG" + TektonTasksDiskVirtImageKey = "TEKTON_TASKS_DISK_VIRT_IMG" + VirtioImageKey = "VIRTIO_IMG" - DefaultWaitForVMIStatusIMG = "quay.io/kubevirt/tekton-task-wait-for-vmi-status:" + TektonTasksVersion - DeafultModifyVMTemplateIMG = "quay.io/kubevirt/tekton-task-modify-vm-template:" + TektonTasksVersion - DeafultDiskVirtSysprepIMG = "quay.io/kubevirt/tekton-task-disk-virt-sysprep:" + TektonTasksVersion - DeafultDiskVirtCustomizeIMG = "quay.io/kubevirt/tekton-task-disk-virt-customize:" + TektonTasksVersion - DeafultCreateVMIMG = "quay.io/kubevirt/tekton-task-create-vm:" + TektonTasksVersion - DeafultModifyDataObjectIMG = "quay.io/kubevirt/tekton-task-modify-data-object:" + TektonTasksVersion - DeafultCopyTemplateIMG = "quay.io/kubevirt/tekton-task-copy-template:" + TektonTasksVersion - DeafultCleanupVMIMG = "quay.io/kubevirt/tekton-task-execute-in-vm:" + TektonTasksVersion - GenerateSSHKeysIMG = "quay.io/kubevirt/tekton-task-generate-ssh-keys:" + TektonTasksVersion - DefaultVirtioIMG = "quay.io/kubevirt/virtio-container-disk:v0.59.0" + DefaultTektonTasksIMG = "quay.io/kubevirt/tekton-tasks:" + TektonTasksVersion + DeafultTektonTasksDiskVirtIMG = "quay.io/kubevirt/tekton-tasks-disk-virt:" + TektonTasksVersion + DefaultVirtioIMG = "quay.io/kubevirt/virtio-container-disk:v0.59.0" defaultOperatorVersion = "devel" ) // GetSSHKeysStatusImage returns generate-ssh-keys task image url -func GetSSHKeysStatusImage() string { - return EnvOrDefault(GenerateSSHKeysImageKey, GenerateSSHKeysIMG) -} - -// GetWaitForVMIStatusImage returns wait-for-vmi-status task image url -func GetWaitForVMIStatusImage() string { - return EnvOrDefault(WaitForVMISTatusImageKey, DefaultWaitForVMIStatusIMG) -} - -// GetModifyVMTemplateImage returns modify-vm-template task image url -func GetModifyVMTemplateImage() string { - return EnvOrDefault(ModifyVMTemplateImageKey, DeafultModifyVMTemplateIMG) +func GetTektonTasksImage() string { + return EnvOrDefault(TektonTasksImageKey, DefaultTektonTasksIMG) } // GetDiskVirtSysprepImage returns disk-virt-sysprep task image url -func GetDiskVirtSysprepImage() string { - return EnvOrDefault(DiskVirtSysprepImageKey, DeafultDiskVirtSysprepIMG) -} - -// GetDiskVirtCustomizeImage returns disk-virt-customize task image url -func GetDiskVirtCustomizeImage() string { - return EnvOrDefault(DiskVirtCustomizeImageKey, DeafultDiskVirtCustomizeIMG) -} - -// GetCreateVMImage returns create-vm-from-manifest task image url -func GetCreateVMImage() string { - return EnvOrDefault(CreateVMImageKey, DeafultCreateVMIMG) -} - -// GetModifyDataObjectImage returns modify-data-object task image url -func GetModifyDataObjectImage() string { - return EnvOrDefault(ModifyDataObjectImageKey, DeafultModifyDataObjectIMG) -} - -// GetCopyTemplatemage returns copy-template task image url -func GetCopyTemplateImage() string { - return EnvOrDefault(CopyTemplateImageKey, DeafultCopyTemplateIMG) -} - -// GetCleanupVMImage returns cleanup-vm task image url -func GetCleanupVMImage() string { - return EnvOrDefault(CleanupVMImageKey, DeafultCleanupVMIMG) +func GetTektonTasksDiskVirtImage() string { + return EnvOrDefault(TektonTasksDiskVirtImageKey, DeafultTektonTasksDiskVirtIMG) } // GetVirtioImage returns virtio image url diff --git a/internal/common/environment_test.go b/internal/common/environment_test.go index 6749ea9ff..0e220f1ae 100644 --- a/internal/common/environment_test.go +++ b/internal/common/environment_test.go @@ -22,123 +22,28 @@ var _ = Describe("environments", func() { Expect(res).To(Equal(defaultOperatorVersion), "OPERATOR_VERSION should equal") }) - It("should return correct value for CLEANUP_VM_IMG when variable is set", func() { - os.Setenv(CleanupVMImageKey, testURL) - res := GetCleanupVMImage() - Expect(res).To(Equal(testURL), "CLEANUP_VM_IMG should equal") - os.Unsetenv(CleanupVMImageKey) + It("should return correct value for TEKTON_TASKS_IMG when variable is set", func() { + os.Setenv(TektonTasksImageKey, testURL) + res := GetTektonTasksImage() + Expect(res).To(Equal(testURL), "TEKTON_TASKS_IMG should equal") + os.Unsetenv(TektonTasksImageKey) }) - It("should return correct value for CLEANUP_VM_IMG when variable is not set", func() { - res := GetCleanupVMImage() - Expect(res).To(Equal(DeafultCleanupVMIMG), "CLEANUP_VM_IMG should equal") + It("should return correct value for TEKTON_TASKS_IMG when variable is not set", func() { + res := GetTektonTasksImage() + Expect(res).To(Equal(DefaultTektonTasksIMG), "TEKTON_TASKS_IMG should equal") }) - It("should return correct value for COPY_TEMPLATE_IMG when variable is set", func() { - os.Setenv(CopyTemplateImageKey, testURL) - res := GetCopyTemplateImage() - Expect(res).To(Equal(testURL), "COPY_TEMPLATE_IMG should equal") - os.Unsetenv(CopyTemplateImageKey) + It("should return correct value for TEKTON_TASKS_DISK_VIRT_IMG when variable is set", func() { + os.Setenv(TektonTasksDiskVirtImageKey, testURL) + res := GetTektonTasksDiskVirtImage() + Expect(res).To(Equal(testURL), "TEKTON_TASKS_DISK_VIRT_IMG should equal") + os.Unsetenv(TektonTasksDiskVirtImageKey) }) - It("should return correct value for COPY_TEMPLATE_IMG when variable is not set", func() { - res := GetCopyTemplateImage() - Expect(res).To(Equal(DeafultCopyTemplateIMG), "COPY_TEMPLATE_IMG should equal") + It("should return correct value for TEKTON_TASKS_DISK_VIRT_IMG when variable is not set", func() { + res := GetTektonTasksDiskVirtImage() + Expect(res).To(Equal(DeafultTektonTasksDiskVirtIMG), "TEKTON_TASKS_DISK_VIRT_IMG should equal") }) - It("should return correct value for MODIFY_DATA_OBJECT_IMG when variable is set", func() { - os.Setenv(ModifyDataObjectImageKey, testURL) - res := GetModifyDataObjectImage() - Expect(res).To(Equal(testURL), "MODIFY_DATA_OBJECT_IMG should equal") - os.Unsetenv(ModifyDataObjectImageKey) - }) - - It("should return correct value for MODIFY_DATA_OBJECT_IMG when variable is not set", func() { - res := GetModifyDataObjectImage() - Expect(res).To(Equal(DeafultModifyDataObjectIMG), "MODIFY_DATA_OBJECT_IMG should equal") - }) - - It("should return correct value for CREATE_VM_IMG when variable is set", func() { - os.Setenv(CreateVMImageKey, testURL) - res := GetCreateVMImage() - Expect(res).To(Equal(testURL), "CREATE_VM_IMG should equal") - os.Unsetenv(CreateVMImageKey) - }) - - It("should return correct value for CREATE_VM_IMG when variable is not set", func() { - res := GetCreateVMImage() - Expect(res).To(Equal(DeafultCreateVMIMG), "CREATE_VM_IMG should equal") - }) - - It("should return correct value for DISK_VIRT_CUSTOMIZE_IMG when variable is set", func() { - os.Setenv(DiskVirtCustomizeImageKey, testURL) - res := GetDiskVirtCustomizeImage() - Expect(res).To(Equal(testURL), "DISK_VIRT_CUSTOMIZE_IMG should equal") - os.Unsetenv(DiskVirtCustomizeImageKey) - }) - - It("should return correct value for DISK_VIRT_CUSTOMIZE_IMG when variable is not set", func() { - res := GetDiskVirtCustomizeImage() - Expect(res).To(Equal(DeafultDiskVirtCustomizeIMG), "DISK_VIRT_CUSTOMIZE_IMG should equal") - }) - - It("should return correct value for DISK_VIRT_SYSPREP_IMG when variable is set", func() { - os.Setenv(DiskVirtSysprepImageKey, testURL) - res := GetDiskVirtSysprepImage() - Expect(res).To(Equal(testURL), "DISK_VIRT_SYSPREP_IMG should equal") - os.Unsetenv(DiskVirtSysprepImageKey) - }) - - It("should return correct value for DISK_VIRT_SYSPREP_IMG when variable is not set", func() { - res := GetDiskVirtSysprepImage() - Expect(res).To(Equal(DeafultDiskVirtSysprepIMG), "DISK_VIRT_SYSPREP_IMG should equal") - }) - - It("should return correct value for MODIFY_VM_TEMPLATE_IMG when variable is set", func() { - os.Setenv(ModifyVMTemplateImageKey, testURL) - res := GetModifyVMTemplateImage() - Expect(res).To(Equal(testURL), "MODIFY_VM_TEMPLATE_IMG should equal") - os.Unsetenv(ModifyVMTemplateImageKey) - }) - - It("should return correct value for MODIFY_VM_TEMPLATE_IMG when variable is not set", func() { - res := GetModifyVMTemplateImage() - Expect(res).To(Equal(DeafultModifyVMTemplateIMG), "MODIFY_VM_TEMPLATE_IMG should equal") - }) - - It("should return correct value for WAIT_FOR_VMI_STATUS_IMG when variable is set", func() { - os.Setenv(WaitForVMISTatusImageKey, testURL) - res := GetWaitForVMIStatusImage() - Expect(res).To(Equal(testURL), "WAIT_FOR_VMI_STATUS_IMG should equal") - os.Unsetenv(WaitForVMISTatusImageKey) - }) - - It("should return correct value for WAIT_FOR_VMI_STATUS_IMG when variable is not set", func() { - res := GetWaitForVMIStatusImage() - Expect(res).To(Equal(DefaultWaitForVMIStatusIMG), "WAIT_FOR_VMI_STATUS_IMG should equal") - }) - - It("should return correct value for VIRTIO_IMG when variable is set", func() { - os.Setenv(VirtioImageKey, testURL) - res := GetVirtioImage() - Expect(res).To(Equal(testURL), "VIRTIO_IMG should equal") - os.Unsetenv(VirtioImageKey) - }) - - It("should return correct value for VIRTIO_IMG when variable is not set", func() { - res := GetVirtioImage() - Expect(res).To(Equal(DefaultVirtioIMG), "VIRTIO_IMG should equal") - }) - - It("should return correct value for GENERATE_SSH_KEYS_IMG when variable is set", func() { - os.Setenv(GenerateSSHKeysImageKey, testURL) - res := GetSSHKeysStatusImage() - Expect(res).To(Equal(testURL), "GENERATE_SSH_KEYS_IMG should equal") - os.Unsetenv(GenerateSSHKeysImageKey) - }) - - It("should return correct value for GENERATE_SSH_KEYS_IMG when variable is not set", func() { - res := GetSSHKeysStatusImage() - Expect(res).To(Equal(GenerateSSHKeysIMG), "GENERATE_SSH_KEYS_IMG should equal") - }) }) diff --git a/internal/operands/tekton-tasks/tekton-tasks.go b/internal/operands/tekton-tasks/tekton-tasks.go index daf93c5b3..8dc07ec74 100644 --- a/internal/operands/tekton-tasks/tekton-tasks.go +++ b/internal/operands/tekton-tasks/tekton-tasks.go @@ -49,18 +49,18 @@ const ( ) var AllowedTasks = map[string]func() string{ - createVMFromManifestTaskName: common.GetCreateVMImage, - cleanVMTaskName: common.GetCleanupVMImage, - copyTemplateTaskName: common.GetCopyTemplateImage, - modifyDataObjectTaskName: common.GetModifyDataObjectImage, - createVMFromTemplateTaskName: common.GetCreateVMImage, - diskVirtCustomizeTaskName: common.GetDiskVirtCustomizeImage, - diskVirtSysprepTaskName: common.GetDiskVirtSysprepImage, - modifyTemplateTaskName: common.GetModifyVMTemplateImage, - waitForVMITaskName: common.GetWaitForVMIStatusImage, - generateSSHKeysTaskName: common.GetSSHKeysStatusImage, - executeInVMTaskName: common.GetCleanupVMImage, - modifyWindowsVMIsoFileName: common.GetCleanupVMImage, + createVMFromManifestTaskName: common.GetTektonTasksImage, + cleanVMTaskName: common.GetTektonTasksImage, + copyTemplateTaskName: common.GetTektonTasksImage, + modifyDataObjectTaskName: common.GetTektonTasksImage, + createVMFromTemplateTaskName: common.GetTektonTasksImage, + diskVirtCustomizeTaskName: common.GetTektonTasksDiskVirtImage, + diskVirtSysprepTaskName: common.GetTektonTasksDiskVirtImage, + modifyTemplateTaskName: common.GetTektonTasksImage, + waitForVMITaskName: common.GetTektonTasksImage, + generateSSHKeysTaskName: common.GetTektonTasksImage, + executeInVMTaskName: common.GetTektonTasksImage, + modifyWindowsVMIsoFileName: common.GetTektonTasksImage, } func init() {