-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: change default destination sync type to azure for azure
- Loading branch information
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
HERE="$(dirname "$(readlink -f "${0}")")" | ||
ROOT="$(readlink -f "${HERE}/../../../")" | ||
|
||
# shellcheck source=scripts/migration/lib.sh | ||
source "${ROOT}/scripts/migration/lib.sh" | ||
|
||
log_info "configuring object storage sync type on Azure" | ||
if [[ "${CK8S_CLUSTER}" =~ ^(sc|both)$ ]]; then | ||
cloud_provider=$(yq_dig sc .global.ck8sCloudProvider) | ||
if [[ "${cloud_provider}" != "azure" ]]; then | ||
log_info "not running on Azure, skipping" | ||
exit 0 | ||
fi | ||
|
||
if yq_check sc .objectStorage.sync.enabled true; then | ||
if yq_null sc .objectStorage.sync.destinationType; then | ||
log_info "objectStorage sync is enabled, will keep previous default destinationType: s3" | ||
yq_add sc .objectStorage.sync.destinationType "\"s3\"" | ||
else | ||
log_info "sync destinationType already has an override, skipping" | ||
fi | ||
else | ||
log_info "object storage sync is not enabled, will use new default destinationType: azure" | ||
fi | ||
fi |