Skip to content

Commit

Permalink
Merge pull request kubevirt#13637 from lyarwood/hack-move-common-inst…
Browse files Browse the repository at this point in the history
…ancetypes-sync-scripts

chore(hack): Separate common-instancetypes sync scripts
  • Loading branch information
kubevirt-bot authored Jan 10, 2025
2 parents cbd2b40 + 6c26bf7 commit 63723f5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ generate:
hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} ./hack/generate.sh"
SYNC_VENDOR=true hack/dockerized "./hack/bazel-generate.sh && hack/bazel-fmt.sh"
hack/dockerized hack/sync-kubevirtci.sh
hack/dockerized hack/sync-common-instancetypes.sh
hack/dockerized hack/common-instancetypes/sync.sh
./hack/update-generated-api-testdata.sh

generate-verify: generate
Expand Down
10 changes: 10 additions & 0 deletions hack/common-instancetypes/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- sig-compute-approvers
- sig-compute-instancetype-approvers
reviewers:
- sig-compute-reviewers
- sig-compute-instancetype-reviewers
labels:
- sig/compute
- area/instancetype
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

set -ex

source "$(dirname "$0")/common.sh"
source "$(dirname "$0")/config.sh"

TARGET_BRANCH=${1:-"main"}

function latest_version() {
Expand All @@ -24,8 +21,8 @@ version=$(latest_version)
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
sed -i "/^[[:blank:]]*common_instancetypes_version[[:blank:]]*=/s/=.*/=\${COMMON_INSTANCETYPES_VERSION:-\"${version}\"}/" $(dirname "$0")/default.sh
sed -i "/^[[:blank:]]*cluster_instancetypes_sha256[[:blank:]]*=/s/=.*/=\${CLUSTER_INSTANCETYPES_SHA256:-\"${instancetypes_checksum}\"}/" $(dirname "$0")/default.sh
sed -i "/^[[:blank:]]*cluster_preferences_sha256[[:blank:]]*=/s/=.*/=\${CLUSTER_PREFERENCES_SHA256:-\"${preferences_checksum}\"}/" $(dirname "$0")/default.sh

hack/sync-common-instancetypes.sh
$(dirname "$0")/sync.sh
3 changes: 3 additions & 0 deletions hack/common-instancetypes/default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
common_instancetypes_version=${COMMON_INSTANCETYPES_VERSION:-"v1.2.1"}
cluster_instancetypes_sha256=${CLUSTER_INSTANCETYPES_SHA256:-"9271d2073857a5908cd16f9d354cca145482bce5f508c3d38d351c6fa71262d3"}
cluster_preferences_sha256=${CLUSTER_PREFERENCES_SHA256:-"3f637427e5aebbb180cf5d86838f07f24f450119d8d0d83aaf633ef60059de93"}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

set -ex

source $(dirname "$0")/common.sh
source $(dirname "$0")/config.sh
source $(dirname "$0")/default.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"
Expand Down
3 changes: 0 additions & 3 deletions hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ conn_check_dns=${CONN_CHECK_DNS:-""}
migration_network_nic=${MIGRATION_NETWORK_NIC:-"eth1"}
infra_replicas=${KUBEVIRT_INFRA_REPLICAS:-0}
test_image_replicas=${KUBEVIRT_E2E_PARALLEL_NODES:-6}
common_instancetypes_version=${COMMON_INSTANCETYPES_VERSION:-"v1.2.1"}
cluster_instancetypes_sha256=${CLUSTER_INSTANCETYPES_SHA256:-"9271d2073857a5908cd16f9d354cca145482bce5f508c3d38d351c6fa71262d3"}
cluster_preferences_sha256=${CLUSTER_PREFERENCES_SHA256:-"3f637427e5aebbb180cf5d86838f07f24f450119d8d0d83aaf633ef60059de93"}

# try to derive csv_version from docker tag. But it must start with x.y.z, without leading v
default_csv_version="${docker_tag/latest/0.0.0}"
Expand Down

0 comments on commit 63723f5

Please sign in to comment.