Skip to content

Commit 089e8da

Browse files
amisskiiadrianriobo
authored andcommitted
tkn infra-azure-windows-desktop task: add support for spot excluded regions parameter
Signed-off-by: Anton Misskii <amisskii@redhat.com>
1 parent a2760d8 commit 089e8da

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

tkn/infra-azure-windows-desktop.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ spec:
9999
- name: spot-eviction-tolerance
100100
description: 'if spot is enable we can define the minimum tolerance level of eviction. Allowed value are: lowest, low, medium, high or highest'
101101
default: 'lowest'
102+
- name: spot-excluded-regions
103+
description: Comma-separated list of zone IDs to exclude from spot selection
104+
default: ""
102105
- name: spot-increase-rate
103106
description: 'Percentage to be added on top of the current calculated spot price to increase chances to get the machine'
104107
default: '30'
@@ -213,8 +216,11 @@ spec:
213216
cmd+="--memory $(params.memory) "
214217
if [[ $(params.nested-virt) == "true" ]]; then cmd+="--nested-virt "; fi
215218
if [[ -n $(params.compute-sizes) ]]; then cmd+="--compute-sizes $(params.compute-sizes) "; fi
216-
if [[ $(params.spot) == "true" ]]; then
217-
cmd+="--spot --spot-eviction-tolerance $(params.spot-eviction-tolerance) --spot-increase-rate $(params.spot-increase-rate) "
219+
if [[ "$(params.spot)" == "true" ]]; then
220+
cmd+="--spot "
221+
cmd+="--spot-increase-rate '$(params.spot-increase-rate)' "
222+
cmd+="--spot-eviction-tolerance '$(params.spot-eviction-tolerance)' "
223+
cmd+="--spot-excluded-regions '$(params.spot-excluded-regions)' "
218224
fi
219225
cmd+="--tags $(params.tags) "
220226
fi

tkn/template/infra-azure-windows-desktop.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ spec:
9999
- name: spot-eviction-tolerance
100100
description: 'if spot is enable we can define the minimum tolerance level of eviction. Allowed value are: lowest, low, medium, high or highest'
101101
default: 'lowest'
102+
- name: spot-excluded-regions
103+
description: Comma-separated list of zone IDs to exclude from spot selection
104+
default: ""
102105
- name: spot-increase-rate
103106
description: 'Percentage to be added on top of the current calculated spot price to increase chances to get the machine'
104107
default: '30'
@@ -213,8 +216,11 @@ spec:
213216
cmd+="--memory $(params.memory) "
214217
if [[ $(params.nested-virt) == "true" ]]; then cmd+="--nested-virt "; fi
215218
if [[ -n $(params.compute-sizes) ]]; then cmd+="--compute-sizes $(params.compute-sizes) "; fi
216-
if [[ $(params.spot) == "true" ]]; then
217-
cmd+="--spot --spot-eviction-tolerance $(params.spot-eviction-tolerance) --spot-increase-rate $(params.spot-increase-rate) "
219+
if [[ "$(params.spot)" == "true" ]]; then
220+
cmd+="--spot "
221+
cmd+="--spot-increase-rate '$(params.spot-increase-rate)' "
222+
cmd+="--spot-eviction-tolerance '$(params.spot-eviction-tolerance)' "
223+
cmd+="--spot-excluded-regions '$(params.spot-excluded-regions)' "
218224
fi
219225
cmd+="--tags $(params.tags) "
220226
fi

0 commit comments

Comments
 (0)