@@ -32,10 +32,6 @@ TARGET_REGIONS="${TARGET_REGIONS:-}"
32
32
function publish-flatcar-sig-image-version-from-vhd() {
33
33
login
34
34
35
- if sig-image-version-exists; then
36
- return
37
- fi
38
-
39
35
get-target-regions
40
36
ensure-vhd-uri-exists
41
37
ensure-resource-group
@@ -45,13 +41,18 @@ function publish-flatcar-sig-image-version-from-vhd() {
45
41
STORAGE_ACCOUNT_ID=" /subscriptions/${AZURE_SUBSCRIPTION_ID} /resourceGroups/${VHD_STORAGE_RESOURCE_GROUP_NAME} /providers/Microsoft.Storage/storageAccounts/${VHD_STORAGE_ACCOUNT_NAME} "
46
42
VHD_URI=" https://${VHD_STORAGE_ACCOUNT_NAME} .blob.core.windows.net/${VHD_STORAGE_CONTAINER_NAME} /flatcar-linux-${FLATCAR_GALLERY_VERSION} -${FLATCAR_CHANNEL} -${FLATCAR_ARCH} .vhd"
47
43
48
- az sig image-version create \
49
- --resource-group " ${SIG_RESOURCE_GROUP} " \
50
- --gallery-name " ${FLATCAR_GALLERY_NAME} " \
51
- --gallery-image-definition " ${FLATCAR_GALLERY_IMAGE_NAME} " \
52
- --gallery-image-version " ${FLATCAR_GALLERY_VERSION} " \
53
- --os-vhd-storage-account " ${STORAGE_ACCOUNT_ID} " \
54
- --os-vhd-uri " ${VHD_URI} " \
44
+ if ! sig-image-version-exists; then
45
+ echo " Creating SIG image version ${FLATCAR_GALLERY_VERSION} "
46
+ az sig image-version create \
47
+ --resource-group " ${SIG_RESOURCE_GROUP} " \
48
+ --gallery-name " ${FLATCAR_GALLERY_NAME} " \
49
+ --gallery-image-definition " ${FLATCAR_GALLERY_IMAGE_NAME} " \
50
+ --gallery-image-version " ${FLATCAR_GALLERY_VERSION} " \
51
+ --os-vhd-storage-account " ${STORAGE_ACCOUNT_ID} " \
52
+ --os-vhd-uri " ${VHD_URI} "
53
+ else
54
+ echo " SIG image version ${FLATCAR_GALLERY_VERSION} already exists, skipping creation"
55
+ fi
55
56
56
57
sig-image-version-update-regions
57
58
}
@@ -63,6 +64,7 @@ function get-target-regions() {
63
64
64
65
echo " Fetching target regions"
65
66
TARGET_REGIONS=$( az account list-locations -o json | jq -r ' .[] | select( .metadata.regionType != "Logical" ) | .name' | sort | grep -v -E " (${BLACKLISTED_TARGET_REGIONS// / |} )" | tr ' \n' ' ' )
67
+ TARGET_REGIONS=" westindia westeurope"
66
68
}
67
69
68
70
function ensure-vhd-uri-exists() {
@@ -134,7 +136,7 @@ function sig-image-version-update-regions() {
134
136
--gallery-name " ${FLATCAR_GALLERY_NAME} " \
135
137
--gallery-image-definition " ${FLATCAR_GALLERY_IMAGE_NAME} " \
136
138
--gallery-image-version " ${FLATCAR_GALLERY_VERSION} " \
137
- --target-regions " ${TARGET_REGIONS} "
139
+ --target-regions ${TARGET_REGIONS}
138
140
}
139
141
140
142
function ensure-image-definition() {
0 commit comments