Skip to content

Commit

Permalink
fix: set boot source labels for DVs created by windows pipelines
Browse files Browse the repository at this point in the history
Set default instanceType and preferences labels to result DVs created
by windows pipelines. With this fix, DVs will have default preferences
when user triggers pipeline.

Signed-off-by: Karel Simon <ksimon@redhat.com>
  • Loading branch information
ksimon1 committed Jan 23, 2024
1 parent 3c7c91d commit 98e82a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions data/tekton-pipelines/windows-bios-installer-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ spec:
description: Namespace of the base DataVolume which is created.
type: string
default: kubevirt-os-images
- default: windows.10
description: Name of the preference which will be used for this DV by default.
name: defaultPreferenceLabel
type: string
- default: virtualmachineclusterpreference
description: Kind of the preference which will be used for this DV by default. Possible values - virtualmachineclusterpreference, virtualmachinepreference
name: defaultPreferenceKindLabel
type: string
- default: u1.large
description: Name of the instance type which will be used for this DV by default.
name: defaultInstancetypeLabel
type: string
- default: virtualmachineclusterinstancetype
description: Kind of the instance type which will be used for this DV by default. Possible values - virtualmachineclusterinstancetype, virtualmachineinstancetype
name: defaultInstancetypeKindLabel
type: string
tasks:
- name: create-vm-root-disk
taskRef:
Expand All @@ -55,6 +71,11 @@ spec:
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
labels:
"instancetype.kubevirt.io/default-instancetype-kind": $(params.defaultInstancetypeKindLabel)
"instancetype.kubevirt.io/default-instancetype": $(params.defaultInstancetypeLabel)
"instancetype.kubevirt.io/default-preference-kind": $(params.defaultPreferenceKindLabel)
"instancetype.kubevirt.io/default-preference": $(params.defaultPreferenceLabel)
name: $(params.baseDvName)
namespace: $(params.baseDvNamespace)
spec:
Expand Down
21 changes: 21 additions & 0 deletions data/tekton-pipelines/windows-efi-installer-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ spec:
description: Name of Windows ISO datavolume
name: isoDVName
type: string
- default: windows.11.virtio
description: Name of the preference which will be used for this DV by default.
name: defaultPreferenceLabel
type: string
- default: virtualmachineclusterpreference
description: Kind of the preference which will be used for this DV by default. Possible values - virtualmachineclusterpreference, virtualmachinepreference
name: defaultPreferenceKindLabel
type: string
- default: u1.large
description: Name of the instance type which will be used for this DV by default.
name: defaultInstancetypeLabel
type: string
- default: virtualmachineclusterinstancetype
description: Kind of the instance type which will be used for this DV by default. Possible values - virtualmachineclusterinstancetype, virtualmachineinstancetype
name: defaultInstancetypeKindLabel
type: string
tasks:
- name: import-win-iso
params:
Expand Down Expand Up @@ -180,6 +196,11 @@ spec:
metadata:
annotations:
"cdi.kubevirt.io/storage.bind.immediate.requested": "true"
labels:
"instancetype.kubevirt.io/default-instancetype-kind": $(params.defaultInstancetypeKindLabel)
"instancetype.kubevirt.io/default-instancetype": $(params.defaultInstancetypeLabel)
"instancetype.kubevirt.io/default-preference-kind": $(params.defaultPreferenceKindLabel)
"instancetype.kubevirt.io/default-preference": $(params.defaultPreferenceLabel)
name: $(params.baseDvName)
namespace: $(params.baseDvNamespace)
spec:
Expand Down

0 comments on commit 98e82a7

Please sign in to comment.