Skip to content

Commit 8e2219b

Browse files
authored
Merge branch 'fluxcd:main' into libgit2-proxy-support
2 parents 9ddfd4c + be57586 commit 8e2219b

18 files changed

+1735
-168
lines changed

.github/actions/run-tests/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.17.5
33
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6-
ARG LIBGIT2_TAG=libgit2-1.1.1-1
6+
ARG LIBGIT2_TAG=libgit2-1.1.1-3
77

88
FROM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2

.github/workflows/e2e.yaml

+41-80
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ on:
77
- main
88

99
jobs:
10-
kind:
10+
11+
kind-linux-amd64:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v2
16+
- name: Setup Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.17.x
1520
- name: Restore Go cache
1621
uses: actions/cache@v1
1722
with:
@@ -26,93 +31,49 @@ jobs:
2631
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
2732
- name: Setup Kustomize
2833
uses: fluxcd/pkg/actions/kustomize@main
29-
- name: Setup envtest
30-
uses: fluxcd/pkg/actions/envtest@main
31-
with:
32-
version: "1.19.2"
3334
- name: Setup Helm
3435
uses: fluxcd/pkg/actions/helm@main
3536
- name: Run tests
3637
uses: ./.github/actions/run-tests
3738
env:
39+
GOROOT:
3840
GOPATH: /github/home/go
39-
- name: Check if working tree is dirty
40-
run: |
41-
if [[ $(git diff --stat) != '' ]]; then
42-
git --no-pager diff
43-
echo 'run make test and commit changes'
44-
exit 1
45-
fi
46-
- name: Build container image
47-
run: make docker-build IMG=test/source-controller TAG=latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load
48-
- name: Load test image
49-
run: kind load docker-image test/source-controller:latest
50-
- name: Deploy controller
51-
run: make dev-deploy IMG=test/source-controller TAG=latest
52-
- name: Run smoke tests
53-
run: |
54-
kubectl -n source-system apply -f ./config/samples
55-
kubectl -n source-system rollout status deploy/source-controller --timeout=1m
56-
kubectl -n source-system wait gitrepository/gitrepository-sample --for=condition=ready --timeout=1m
57-
kubectl -n source-system wait helmrepository/helmrepository-sample --for=condition=ready --timeout=1m
58-
kubectl -n source-system wait helmchart/helmchart-sample --for=condition=ready --timeout=1m
59-
kubectl -n source-system delete -f ./config/samples
60-
- name: Run HelmChart values file tests
61-
run: |
62-
kubectl -n source-system apply -f ./config/testdata/helmchart-valuesfile
63-
kubectl -n source-system wait helmchart/podinfo --for=condition=ready --timeout=5m
64-
kubectl -n source-system wait helmchart/podinfo-git --for=condition=ready --timeout=5m
65-
kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile
66-
- name: Setup Minio
41+
- name: Verify
42+
run: make verify
43+
- name: Run E2E tests
6744
env:
68-
MINIO_VER: ${{ 'v6.3.1' }}
69-
run: |
70-
kubectl create ns minio
71-
helm repo add minio https://helm.min.io/
72-
helm upgrade --wait -i minio minio/minio \
73-
--version $MINIO_VER \
74-
--namespace minio \
75-
--set accessKey=myaccesskey \
76-
--set secretKey=mysecretkey \
77-
--set resources.requests.memory=128Mi \
78-
--set persistence.enable=false
79-
kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null &
80-
sleep 2
81-
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
82-
chmod +x mc
83-
./mc alias set minio http://localhost:9000 myaccesskey mysecretkey --api S3v4
84-
kubectl -n source-system apply -f ./config/testdata/minio/secret.yaml
85-
- name: Run Bucket tests
86-
run: |
87-
./mc mb minio/podinfo
88-
./mc mirror ./config/testdata/minio/manifests/ minio/podinfo
45+
CREATE_CLUSTER: false
46+
run: make e2e
8947

90-
kubectl -n source-system apply -f ./config/testdata/bucket/source.yaml
91-
kubectl -n source-system wait bucket/podinfo --for=condition=ready --timeout=1m
92-
- name: Run HelmChart from Bucket tests
93-
run: |
94-
./mc mb minio/charts
95-
./mc mirror ./controllers/testdata/charts/helmchart/ minio/charts/helmchart
96-
97-
kubectl -n source-system apply -f ./config/testdata/helmchart-from-bucket/source.yaml
98-
kubectl -n source-system wait bucket/charts --for=condition=ready --timeout=1m
99-
kubectl -n source-system wait helmchart/helmchart-bucket --for=condition=ready --timeout=1m
100-
- name: Run large Git repo tests
48+
kind-linux-arm64:
49+
# Hosted on Equinix
50+
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
51+
runs-on: [self-hosted, Linux, ARM64, equinix]
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v2
55+
- name: Setup Go
56+
uses: actions/setup-go@v2
57+
with:
58+
go-version: 1.17.x
59+
- name: Prepare
60+
id: prep
10161
run: |
102-
kubectl -n source-system apply -f ./config/testdata/git/large-repo.yaml
103-
kubectl -n source-system wait gitrepository/large-repo-go-git --for=condition=ready --timeout=2m
104-
kubectl -n source-system wait gitrepository/large-repo-libgit2 --for=condition=ready --timeout=2m
105-
- name: Logs
62+
echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
63+
echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
64+
- name: Setup Kubernetes Kind
10665
run: |
107-
kubectl -n source-system logs deploy/source-controller
108-
- name: Debug failure
109-
if: failure()
66+
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
67+
- name: Run e2e tests
68+
env:
69+
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
70+
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
71+
CREATE_CLUSTER: false
72+
BUILD_PLATFORM: linux/arm64
73+
MINIO_TAG: RELEASE.2020-09-17T04-49-20Z-arm64
74+
run: make e2e
75+
- name: Cleanup
76+
if: always()
11077
run: |
111-
kubectl -n kube-system describe pods
112-
kubectl -n source-system describe pods
113-
kubectl -n source-system get gitrepositories -oyaml
114-
kubectl -n source-system get helmrepositories -oyaml
115-
kubectl -n source-system get helmcharts -oyaml
116-
kubectl -n source-system get all
117-
kubectl -n source-system logs deploy/source-controller
118-
kubectl -n minio get all
78+
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
79+
rm /tmp/${{ steps.prep.outputs.CLUSTER }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
1616
bin/
17+
testbin/
1718
config/release/
1819

1920
# Exclude all libgit2 related files
2021
hack/libgit2/
22+
23+
# Exclude temporary build files
24+
build/

0 commit comments

Comments
 (0)