Skip to content

Commit 89a218d

Browse files
committed
WIP: KUTTL action
1 parent 187473b commit 89a218d

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/test.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,63 @@ jobs:
5757
5858
- env: { PGO_TEST_TIMEOUT_SCALE: 1.2 }
5959
run: make createnamespaces check-envtest-existing
60+
61+
kuttl-k3d:
62+
runs-on: ubuntu-latest
63+
needs: [go-test]
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
kubernetes: [latest]
68+
steps:
69+
- uses: actions/checkout@v2
70+
- uses: actions/setup-go@v2
71+
with: { go-version: 1.x }
72+
73+
- name: Start k3s
74+
uses: ./.github/actions/k3d
75+
with:
76+
k3s-channel: "${{ matrix.kubernetes }}"
77+
prefetch-images: |
78+
registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:centos8-13.4-4.7.3
79+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-0
80+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:centos8-1.16-0
81+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-14.1-0
82+
83+
- name: Build PGO
84+
run: |
85+
make build-postgres-operator PGO_VERSION=${{ github.sha }}
86+
87+
PGO=$(buildah from scratch)
88+
buildah copy "$PGO" bin/postgres-operator /usr/local/bin/
89+
buildah config --entrypoint '["/usr/local/bin/postgres-operator"]' "$PGO"
90+
buildah commit --rm "$PGO" docker-daemon:localhost/postgres-operator:latest
91+
92+
# Start a Docker container with the working directory mounted.
93+
- name: Start PGO
94+
run: |
95+
kubectl apply -k ./config/namespace; kubectl apply -k ./config/dev
96+
hack/create-kubeconfig.sh postgres-operator pgo
97+
98+
docker run --detach --network host --name 'postgres-operator' \
99+
--workdir '/mnt' --volume "$(pwd):/mnt" \
100+
--env 'KUBECONFIG=hack/.kube/postgres-operator/pgo' \
101+
--env 'RELATED_IMAGE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:centos8-13.4-4.7.3' \
102+
--env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-0' \
103+
--env 'RELATED_IMAGE_PGBOUNCER=registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:centos8-1.16-0' \
104+
--env 'RELATED_IMAGE_POSTGRES_14=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-14.1-0' \
105+
localhost/postgres-operator
106+
107+
- name: Install KUTTL
108+
run: |
109+
KREW="krew-$(uname -s)_$(uname -m)"; KREW="${KREW/x86_/amd}"; KREW="${KREW,,}"
110+
curl --fail --location --silent --show-error \
111+
"https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" |
112+
tar xz --directory hack/tools --wildcards "*${KREW}*"
113+
"hack/tools/${KREW}" install kuttl
114+
115+
- run: |
116+
make check-kuttl PATH="$PATH:$HOME/.krew/bin" && exit
117+
failed=$?
118+
echo '::group::PGO logs'; docker logs 'postgres-operator'; echo '::endgroup::'
119+
exit $failed

0 commit comments

Comments
 (0)