Skip to content

Commit

Permalink
Use kustomize for setting opamp bridge image in E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm committed Dec 23, 2023
1 parent dba24a3 commit 37f80c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ add-image-targetallocator: PATCH = [{"op":"add","path":"/spec/template/spec/cont
add-image-targetallocator: manifests kustomize
cd $(KUSTOMIZATION_DIR) && $(KUSTOMIZE) edit add patch --kind Deployment --patch '$(PATCH)'

.PHONY: add-image-opampbridge
add-image-opampbridge: PATCH = [{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--operator-opamp-bridge-image=$(OPERATOROPAMPBRIDGE_IMG)"}]
add-image-opampbridge: manifests kustomize
cd $(KUSTOMIZATION_DIR) && $(KUSTOMIZE) edit add patch --kind Deployment --patch '$(PATCH)'

# Deploy controller in the current Kubernetes context, configured in ~/.kube/config
.PHONY: deploy
deploy: set-image-controller
Expand Down Expand Up @@ -239,8 +244,8 @@ e2e-opampbridge:
$(KUTTL) test --config kuttl-test-opampbridge.yaml

.PHONY: prepare-e2e
prepare-e2e: kuttl set-image-controller add-image-targetallocator container container-target-allocator container-operator-opamp-bridge start-kind cert-manager install-metrics-server install-targetallocator-prometheus-crds load-image-all deploy
OPERATOROPAMPBRIDGE_IMG=$(OPERATOROPAMPBRIDGE_IMG) OPERATOR_IMG=$(IMG) SED_BIN="$(SED)" ./hack/modify-test-images.sh
prepare-e2e: kuttl set-image-controller add-image-targetallocator add-image-opampbridge container container-target-allocator container-operator-opamp-bridge start-kind cert-manager install-metrics-server install-targetallocator-prometheus-crds load-image-all deploy
OPERATOR_IMG=$(IMG) SED_BIN="$(SED)" ./hack/modify-test-images.sh

.PHONY: enable-prometheus-feature-flag
enable-prometheus-feature-flag:
Expand Down Expand Up @@ -456,7 +461,7 @@ reset: kustomize operator-sdk manifests
$(OPERATOR_SDK) bundle validate ./bundle
./hack/ignore-createdAt-bundle.sh
git checkout config/manager/kustomization.yaml
OPERATOR_IMG=local/opentelemetry-operator:e2e TARGETALLOCATOR_IMG=local/opentelemetry-operator-targetallocator:e2e OPERATOROPAMPBRIDGE_IMG=local/opentelemetry-operator-opamp-bridge:e2e DEFAULT_OPERATOR_IMG=$(IMG) DEFAULT_TARGETALLOCATOR_IMG=$(TARGETALLOCATOR_IMG) DEFAULT_OPERATOROPAMPBRIDGE_IMG=$(OPERATOROPAMPBRIDGE_IMG) SED_BIN="$(SED)" ./hack/modify-test-images.sh
OPERATOR_IMG=local/opentelemetry-operator:e2e DEFAULT_OPERATOR_IMG=$(IMG) SED_BIN="$(SED)" ./hack/modify-test-images.sh

# Build the bundle image, used only for local dev purposes
.PHONY: bundle-build
Expand Down
2 changes: 0 additions & 2 deletions hack/modify-test-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

SED_BIN=${SED_BIN:-sed}

DEFAULT_OPERATOROPAMPBRIDGE_IMG=${DEFAULT_OPERATOROPAMPBRIDGE_IMG:-local/opentelemetry-operator-opamp-bridge:e2e}
DEFAULT_OPERATOR_IMG=${DEFAULT_OPERATOR_IMG:-local/opentelemetry-operator:e2e}

${SED_BIN} -i "s#${DEFAULT_OPERATOR_IMG}#${OPERATOR_IMG}#g" tests/e2e-multi-instrumentation/*.yaml

${SED_BIN} -i "s#${DEFAULT_OPERATOROPAMPBRIDGE_IMG}#${OPERATOROPAMPBRIDGE_IMG}#g" tests/e2e-opampbridge/opampbridge/*.yaml
1 change: 0 additions & 1 deletion tests/e2e-opampbridge/opampbridge/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kind: OpAMPBridge
metadata:
name: test
spec:
image: "local/opentelemetry-operator-opamp-bridge:e2e"
endpoint: ws://opamp-server:4320/v1/opamp
capabilities:
AcceptsOpAMPConnectionSettings: true
Expand Down

0 comments on commit 37f80c0

Please sign in to comment.