mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-08 10:52:03 +01:00
oem/azure: dynamically determine storage endpoint
Apparently this differs between clouds.
This commit is contained in:
parent
b6c6c89bbc
commit
f221bcf20e
@ -1,4 +1,3 @@
|
|||||||
AZURE_ENVIRONMENT=AzureCloud
|
|
||||||
REGIONS=(
|
REGIONS=(
|
||||||
"West Europe"
|
"West Europe"
|
||||||
"North Europe"
|
"North Europe"
|
||||||
@ -24,11 +23,25 @@ REGIONS=(
|
|||||||
"UK South 2"
|
"UK South 2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
getAzureEnvironment() {
|
||||||
|
azure account show --json | \
|
||||||
|
jq '.[0].environmentName' --raw-output
|
||||||
|
}
|
||||||
|
|
||||||
getManagementEndpoint() {
|
getManagementEndpoint() {
|
||||||
azure account env show --environment=$AZURE_ENVIRONMENT --json | \
|
azure account env show --environment=$(getAzureEnvironment) --json | \
|
||||||
jq '.managementEndpointUrl' --raw-output
|
jq '.managementEndpointUrl' --raw-output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStorageEndpointPrefix() {
|
||||||
|
azure account env show --environment=$(getAzureEnvironment) --json | \
|
||||||
|
jq '.storageEndpointSuffix' --raw-output
|
||||||
|
}
|
||||||
|
|
||||||
|
getBlobStorageEndpoint() {
|
||||||
|
echo "blob$(getStorageEndpointPrefix)"
|
||||||
|
}
|
||||||
|
|
||||||
getSubscriptionId() {
|
getSubscriptionId() {
|
||||||
azure account show --json | \
|
azure account show --json | \
|
||||||
jq '.[0].id' --raw-output
|
jq '.[0].id' --raw-output
|
||||||
|
|||||||
@ -61,7 +61,7 @@ azure storage blob copy start \
|
|||||||
|
|
||||||
echo "Creating Azure image from blob..."
|
echo "Creating Azure image from blob..."
|
||||||
azure vm image create \
|
azure vm image create \
|
||||||
--blob-url="https://coreos.blob.core.windows.net/publish/coreos-${VERSION}-${LGROUP}.vhd" \
|
--blob-url="https://coreos.$(getBlobStorageEndpoint)/publish/coreos-${VERSION}-${LGROUP}.vhd" \
|
||||||
--os="linux" \
|
--os="linux" \
|
||||||
--label="CoreOS ${UGROUP}" \
|
--label="CoreOS ${UGROUP}" \
|
||||||
"CoreOS-${UGROUP}-${VERSION}"
|
"CoreOS-${UGROUP}-${VERSION}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user