Skip to content

Commit

Permalink
test(e2e): disable trivy server Service sessionAffinity (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb authored Jan 16, 2023
1 parent d7c8185 commit a9d7256
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply --server-side -f -
$(KUSTOMIZE) build config/e2e-test | kubectl apply --server-side -f -
for w in statefulset/trivy deployment/image-scanner-controller-manager; do \
if ! kubectl rollout status $$w -n $(K8S_NAMESPACE) --timeout=2m; then \
kubectl get events -n $(K8S_NAMESPACE); \
Expand All @@ -149,7 +149,7 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build config/e2e-test | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-dependencies
deploy-dependencies: kustomize ## Install operator dependent software not part of standard K8s
Expand Down
14 changes: 14 additions & 0 deletions config/e2e-test/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../default
# FIXME: Somehow sessionAffinity does not work when running e2e tests in some environments
patches:
# Disable trivy server sessionAffinity; not really needed when running a single replica
- target:
kind: Service
name: trivy
patch: |-
- op: remove
path: /spec/sessionAffinity

0 comments on commit a9d7256

Please sign in to comment.