Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit bdbb2c9

Browse files
paride5745raffis
andauthored
feat: update controller DK-3725 (#13)
* update versions * update README * fix new version change * update config * updating github actions * rollback to k8s 0.25.5 * make lint happy * update path and goreleaser * fixing test cluster cleanup * wrong position * fix kafka release name * updating kafka version * revert * adding dockerfile.release * installing zookeeper before kafka * revert zookeeper * switching to bitnami/kafka * switching kafka-client to bitnami/kafka * bitnami kafka has a different name * checking * revert * moving tests to makefile * make test * no need for profiles * do not rebuild the docker image * bump versions * bumo ginkgo * not valid decorator in ginkgo/v2 * bump version * ci: update ci pipelines --------- Co-authored-by: Raffael Sahli <raffael.sahli@doodle.com>
1 parent 6905ba4 commit bdbb2c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1570
-1487
lines changed

.github/workflows/chart.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/e2e.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

.github/workflows/main.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
14+
- name: Setup Go
15+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
16+
with:
17+
go-version: 1.20.x
18+
- name: Restore Go cache
19+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
20+
with:
21+
path: ~/go/pkg/mod
22+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
23+
restore-keys: |
24+
${{ runner.os }}-go-
25+
- name: Tests
26+
run: make test
27+
- name: Send go coverage report
28+
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 #v1.6.0
29+
with:
30+
path-to-profile: coverage.out

.github/workflows/pr-build.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: pr-build
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
profiles: ${{ steps.profiles.outputs.matrix }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
18+
- name: Setup Go
19+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 #v3.5.0
20+
with:
21+
go-version: 1.20.x
22+
- name: Restore Go cache
23+
uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d #v3.2.2
24+
with:
25+
path: ~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
- name: fmt
30+
run: make fmt
31+
- name: vet
32+
run: make vet
33+
- name: lint
34+
run: make lint
35+
- name: test
36+
run: make test
37+
- name: build
38+
run: make build
39+
- name: Send go coverage report
40+
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 #v1.6.0
41+
with:
42+
path-to-profile: coverage.out
43+
- name: Check if working tree is dirty
44+
run: |
45+
if [[ $(git diff --stat) != '' ]]; then
46+
git --no-pager diff
47+
echo 'run <make test> and commit changes'
48+
exit 1
49+
fi
50+
- name: Build container image
51+
run: |
52+
make docker-build
53+
- name: Create image tarball
54+
run: |
55+
docker save --output k8skafka-controller-container.tar k8skafka-controller:latest
56+
- name: Upload image
57+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
58+
with:
59+
name: k8skafka-controller-container
60+
path: k8skafka-controller-container.tar
61+
- id: profiles
62+
name: Determine test profiles
63+
run: |
64+
profiles=$(ls config/tests/cases | jq -R -s -c 'split("\n")[:-1]')
65+
echo $profiles
66+
echo "::set-output name=matrix::$profiles"
67+
68+
e2e-tests:
69+
runs-on: ubuntu-latest
70+
needs:
71+
- build
72+
strategy:
73+
matrix:
74+
profile: ${{ fromJson(needs.build.outputs.profiles) }}
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3
78+
- name: Setup Kubernetes
79+
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
80+
with:
81+
version: v0.17.0
82+
- name: Download k8skafka-controller container
83+
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2
84+
with:
85+
name: k8skafka-controller-container
86+
path: /tmp
87+
- name: Load images
88+
run: |
89+
docker load --input /tmp/k8skafka-controller-container.tar
90+
docker image ls -a
91+
- name: Setup Kustomize
92+
uses: imranismail/setup-kustomize@6691bdeb1b0a3286fb7f70fd1423c10e81e5375f # v2.0.0
93+
94+
- name: Run test
95+
run: |
96+
make kind-test TEST_PROFILE=${{ matrix.profile }}
97+
- name: Debug failure
98+
if: failure()
99+
run: |
100+
kubectl -n kube-system describe pods
101+
kubectl -n k8skafka-system describe pods
102+
kubectl -n k8skafka-system get all
103+
kubectl -n k8skafka-system logs deploy/k8skafka-controller
104+
kubectl -n k8skafka-system get postgresqlusers -o yaml
105+
kubectl -n k8skafka-system get postgresqldatabases -o yaml
106+
kubectl -n k8skafka-system get mongodbusers -o yaml
107+
kubectl -n k8skafka-system get mongodbdatabases -o yaml

.github/workflows/pr-chart.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pr-chart
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
16+
with:
17+
version: v3.4.0
18+
19+
- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 #v4.4.0
20+
with:
21+
python-version: 3.7
22+
23+
- name: Set up chart-testing
24+
uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec #v2.3.1
25+
26+
- name: Run chart-testing (list-changed)
27+
id: list-changed
28+
run: |
29+
changed=$(ct list-changed --target-branch=master --chart-dirs chart)
30+
if [[ -n "$changed" ]]; then
31+
echo "::set-output name=changed::true"
32+
fi
33+
34+
- name: Run chart-testing (lint)
35+
run: ct lint --target-branch=master --chart-dirs chart
36+
37+
- name: Create kind cluster
38+
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 #v1.5.0
39+
if: steps.list-changed.outputs.changed == 'true'
40+
41+
- name: Run chart-testing (install)
42+
run: ct install --target-branch=master --chart-dirs chart

.github/workflows/pr-label.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pr-label
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
size-label:
8+
runs-on: ubuntu-latest
9+
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
10+
steps:
11+
- name: size-label
12+
uses: "pascalgn/size-label-action@1619680c5ac1ef360b944bb56a57587ba4aa2af8"
13+
env:
14+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/rebase.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout the latest code
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
1616
with:
1717
fetch-depth: 0
1818
- name: Automatic Rebase
19-
uses: cirrus-actions/rebase@1.3.1
19+
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 #1.8
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)