Skip to content

Commit

Permalink
Fix version replacement for assets (#752)
Browse files Browse the repository at this point in the history
* Fix how versions are replaced during publishing of assets. Since we need to generate istio-manager.yaml multiple times we are now using the same approach as in api-gatgeway.

* Add missing module-version for integration tests
  • Loading branch information
triffer authored Apr 18, 2024
1 parent a5b62d6 commit b9c9fcd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ k6_script_auth_gen.js
summary.html

# common labels template result files of make target module-version
config/default/kustomization.yaml-e
config/default/kustomization.yaml

# ignore generated files for istiooperator tests
internal/istiooperator/test/merged-istio-operator.yaml
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate-integration-test-manifest
generate-integration-test-manifest: manifests kustomize
generate-integration-test-manifest: manifests kustomize module-version
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default -o tests/integration/steps/operator_generated_manifest.yaml

Expand Down Expand Up @@ -244,8 +244,4 @@ gardener-aws-integration-test:

.PHONY: module-version
module-version:
ifeq ($(OS_TYPE), Darwin)
sed -i'.bak' -e 's/VERSION/$(VERSION)/g' config/default/kustomization.yaml
else
sed -i 's/VERSION/$(VERSION)/g' config/default/kustomization.yaml
endif
sed 's/VERSION/$(VERSION)/g' config/default/kustomization.template.yaml > config/default/kustomization.yaml
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/publish_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GITHUB_AUTH_HEADER="Authorization: Bearer ${GITHUB_TOKEN}"
IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:${RELEASE_TAG}"
VERSION="${RELEASE_TAG}"

IMG="${IMG}" make generate-manifests
IMG="${IMG}" VERSION="${VERSION}" make generate-manifests
curl -f -L \
-X POST \
-H "Accept: application/vnd.github+json" \
Expand All @@ -26,7 +26,7 @@ curl -f -L \
--data-binary @"istio-manager.yaml" \
${GITHUB_URL}/releases/${RELEASE_ID}/assets?name=istio-manager.yaml

IMG="${IMG}-experimental" make generate-manifests
IMG="${IMG}-experimental" VERSION="${VERSION}-experimental" make generate-manifests
curl -f -L \
-X POST \
-H "Accept: application/vnd.github+json" \
Expand Down

0 comments on commit b9c9fcd

Please sign in to comment.