Skip to content

Commit

Permalink
Merge branch 'fluxcd:main' into libgit2-proxy-support
Browse files Browse the repository at this point in the history
  • Loading branch information
racdev authored Jan 17, 2022
2 parents 9ddfd4c + be57586 commit 8e2219b
Show file tree
Hide file tree
Showing 18 changed files with 1,735 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG GO_VERSION=1.17.5
ARG XX_VERSION=1.1.0

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

FROM tonistiigi/xx:${XX_VERSION} AS xx
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2
Expand Down
121 changes: 41 additions & 80 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ on:
- main

jobs:
kind:

kind-linux-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Restore Go cache
uses: actions/cache@v1
with:
Expand All @@ -26,93 +31,49 @@ jobs:
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup envtest
uses: fluxcd/pkg/actions/envtest@main
with:
version: "1.19.2"
- name: Setup Helm
uses: fluxcd/pkg/actions/helm@main
- name: Run tests
uses: ./.github/actions/run-tests
env:
GOROOT:
GOPATH: /github/home/go
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
git --no-pager diff
echo 'run make test and commit changes'
exit 1
fi
- name: Build container image
run: make docker-build IMG=test/source-controller TAG=latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load
- name: Load test image
run: kind load docker-image test/source-controller:latest
- name: Deploy controller
run: make dev-deploy IMG=test/source-controller TAG=latest
- name: Run smoke tests
run: |
kubectl -n source-system apply -f ./config/samples
kubectl -n source-system rollout status deploy/source-controller --timeout=1m
kubectl -n source-system wait gitrepository/gitrepository-sample --for=condition=ready --timeout=1m
kubectl -n source-system wait helmrepository/helmrepository-sample --for=condition=ready --timeout=1m
kubectl -n source-system wait helmchart/helmchart-sample --for=condition=ready --timeout=1m
kubectl -n source-system delete -f ./config/samples
- name: Run HelmChart values file tests
run: |
kubectl -n source-system apply -f ./config/testdata/helmchart-valuesfile
kubectl -n source-system wait helmchart/podinfo --for=condition=ready --timeout=5m
kubectl -n source-system wait helmchart/podinfo-git --for=condition=ready --timeout=5m
kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile
- name: Setup Minio
- name: Verify
run: make verify
- name: Run E2E tests
env:
MINIO_VER: ${{ 'v6.3.1' }}
run: |
kubectl create ns minio
helm repo add minio https://helm.min.io/
helm upgrade --wait -i minio minio/minio \
--version $MINIO_VER \
--namespace minio \
--set accessKey=myaccesskey \
--set secretKey=mysecretkey \
--set resources.requests.memory=128Mi \
--set persistence.enable=false
kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null &
sleep 2
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc alias set minio http://localhost:9000 myaccesskey mysecretkey --api S3v4
kubectl -n source-system apply -f ./config/testdata/minio/secret.yaml
- name: Run Bucket tests
run: |
./mc mb minio/podinfo
./mc mirror ./config/testdata/minio/manifests/ minio/podinfo
CREATE_CLUSTER: false
run: make e2e

kubectl -n source-system apply -f ./config/testdata/bucket/source.yaml
kubectl -n source-system wait bucket/podinfo --for=condition=ready --timeout=1m
- name: Run HelmChart from Bucket tests
run: |
./mc mb minio/charts
./mc mirror ./controllers/testdata/charts/helmchart/ minio/charts/helmchart
kubectl -n source-system apply -f ./config/testdata/helmchart-from-bucket/source.yaml
kubectl -n source-system wait bucket/charts --for=condition=ready --timeout=1m
kubectl -n source-system wait helmchart/helmchart-bucket --for=condition=ready --timeout=1m
- name: Run large Git repo tests
kind-linux-arm64:
# Hosted on Equinix
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
runs-on: [self-hosted, Linux, ARM64, equinix]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Prepare
id: prep
run: |
kubectl -n source-system apply -f ./config/testdata/git/large-repo.yaml
kubectl -n source-system wait gitrepository/large-repo-go-git --for=condition=ready --timeout=2m
kubectl -n source-system wait gitrepository/large-repo-libgit2 --for=condition=ready --timeout=2m
- name: Logs
echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
- name: Setup Kubernetes Kind
run: |
kubectl -n source-system logs deploy/source-controller
- name: Debug failure
if: failure()
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
- name: Run e2e tests
env:
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
CREATE_CLUSTER: false
BUILD_PLATFORM: linux/arm64
MINIO_TAG: RELEASE.2020-09-17T04-49-20Z-arm64
run: make e2e
- name: Cleanup
if: always()
run: |
kubectl -n kube-system describe pods
kubectl -n source-system describe pods
kubectl -n source-system get gitrepositories -oyaml
kubectl -n source-system get helmrepositories -oyaml
kubectl -n source-system get helmcharts -oyaml
kubectl -n source-system get all
kubectl -n source-system logs deploy/source-controller
kubectl -n minio get all
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
rm /tmp/${{ steps.prep.outputs.CLUSTER }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
# Dependency directories (remove the comment below to include it)
# vendor/
bin/
testbin/
config/release/

# Exclude all libgit2 related files
hack/libgit2/

# Exclude temporary build files
build/
Loading

0 comments on commit 8e2219b

Please sign in to comment.