forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#10309 from lyarwood/virt-operator-common-…
…instancetypes virt-operator: Deploy common-instancetypes
- Loading branch information
Showing
20 changed files
with
3,125 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
source $(dirname "$0")/common.sh | ||
source $(dirname "$0")/config.sh | ||
|
||
function latest_version() { | ||
local org="$1" | ||
local repo="$2" | ||
|
||
curl --fail -s "https://api.github.com/repos/${org}/${repo}/releases/latest" | | ||
jq -r '.tag_name' | ||
} | ||
|
||
function checksum() { | ||
local version="$1" | ||
local file="$2" | ||
|
||
curl -L "https://github.com/kubevirt/common-instancetypes/releases/download/${version}/CHECKSUMS.sha256" | | ||
grep "${file}" | cut -d " " -f 1 | ||
} | ||
|
||
version=$(latest_version "kubevirt" "common-instancetypes") | ||
instancetypes_checksum=$(checksum "${version}" "common-clusterinstancetypes-bundle-${version}.yaml") | ||
preferences_checksum=$(checksum "${version}" "common-clusterpreferences-bundle-${version}.yaml") | ||
|
||
sed -i "/^[[:blank:]]*common_instancetypes_version[[:blank:]]*=/s/=.*/=\${COMMON_INSTANCETYPES_VERSION:-\"${version}\"}/" hack/config-default.sh | ||
sed -i "/^[[:blank:]]*cluster_instancetypes_sha256[[:blank:]]*=/s/=.*/=\${CLUSTER_INSTANCETYPES_SHA256:-\"${instancetypes_checksum}\"}/" hack/config-default.sh | ||
sed -i "/^[[:blank:]]*cluster_preferences_sha256[[:blank:]]*=/s/=.*/=\${CLUSTER_PREFERENCES_SHA256:-\"${preferences_checksum}\"}/" hack/config-default.sh | ||
|
||
hack/sync-common-instancetypes.sh |
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,20 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
source $(dirname "$0")/common.sh | ||
source $(dirname "$0")/config.sh | ||
|
||
_common_instancetypes_base_url="https://github.com/kubevirt/common-instancetypes/releases/download" | ||
_cluster_instancetypes_path="pkg/virt-operator/resource/generate/components/data/common-clusterinstancetypes-bundle.yaml" | ||
_cluster_preferences_path="pkg/virt-operator/resource/generate/components/data/common-clusterpreferences-bundle.yaml" | ||
|
||
curl \ | ||
-L "${_common_instancetypes_base_url}/${common_instancetypes_version}/common-clusterinstancetypes-bundle-${common_instancetypes_version}.yaml" \ | ||
-o "${_cluster_instancetypes_path}" | ||
echo "${cluster_instancetypes_sha256} ${_cluster_instancetypes_path}" | sha256sum --check --strict | ||
|
||
curl \ | ||
-L "${_common_instancetypes_base_url}/${common_instancetypes_version}/common-clusterpreferences-bundle-${common_instancetypes_version}.yaml" \ | ||
-o "${_cluster_preferences_path}" | ||
echo "${cluster_preferences_sha256} ${_cluster_preferences_path}" | sha256sum --check --strict |
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
Oops, something went wrong.