Skip to content

Commit

Permalink
fix: start kube-mgtm during e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Ievgenii Shepeliuk <[email protected]>
  • Loading branch information
eshepelyuk committed Feb 11, 2022
1 parent 39177f1 commit c67c3de
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ jobs:
skipClusterCreation: true
- run: |
just k3d
just up
just _up-e2e
- run: |
kubectl get all -A
14 changes: 8 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ export VERSION := "0.0.0-" + COMMIT
default:
@just --list

@skaffold-ctx:
@_skaffold-ctx:
skaffold config set default-repo localhost:5000 -k k3d-kube-mgmt

# build docker image and pack helm chart
@build: skaffold-ctx
@build: _skaffold-ctx
skaffold build -t {{VERSION}} --file-output=skaffold.json
helm package charts/opa --version {{VERSION}} --app-version {{VERSION}}

# same as build but also pushes `latest` tag
build-latest: build
_build-latest: build
#!/usr/bin/env bash
set -euxo pipefail
LATEST="$(jq -r .builds[0].imageName skaffold.json):latest"
Expand All @@ -31,7 +30,7 @@ build-latest: build
test: test-helm test-e2e

# (re) create local k8s cluster using k3d
@k3d: && skaffold-ctx
@k3d: && _skaffold-ctx
k3d cluster delete kube-mgmt || true
k3d cluster create --config ./test/e2e/k3d.yaml

Expand All @@ -40,9 +39,12 @@ test: test-helm test-e2e
skaffold render -a skaffold.json

# deploy chart to local k8s
@up: skaffold-ctx
@up: _skaffold-ctx
skaffold run

_up-e2e: _skaffold-ctx
skaffold run -p e2e

# delete chart from local k8s
@down:
skaffold delete || true
Expand Down
15 changes: 15 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,18 @@ profiles:
mgmt.image: openpolicyagent/kube-mgmt
imageStrategy:
helm: {}
- name: e2e
deploy:
helm:
releases:
- name: opa
chartPath: charts/opa
wait: true
upgradeOnChange: false
skipBuildDependencies: true
valuesFiles:
- test/e2e/values-e2e.yaml
artifactOverrides:
mgmt.image: openpolicyagent/kube-mgmt
imageStrategy:
helm: {}
2 changes: 2 additions & 0 deletions test/e2e/values-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mgmt:
enabled: true

0 comments on commit c67c3de

Please sign in to comment.