diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8e6bd56..8e80a5a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -22,7 +22,7 @@ jobs: kubernetes: - v1.29.0 flux: - - v2.2 + - v2.2.2 runs-on: ubuntu-latest permissions: contents: read @@ -32,6 +32,8 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Flux uses: fluxcd/flux2/action@5c5c15ea212b8f029a110f9975851d25c8272695 #v2.2.2 + with: + version: ${{ matrix.flux }} - name: Setup Kubernetes uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 with: @@ -53,6 +55,9 @@ jobs: - name: Verify images run: kubectl -n flux-system get deployments.apps -o yaml | grep ${{ matrix.variant }} - name: Setup cluster reconciliation + env: + FLUX_VERSION: ${{ matrix.flux }} + shell: bash run: | flux create source git flux-system \ --url=${{ github.event.repository.html_url }} \ @@ -62,10 +67,11 @@ jobs: --ignore-paths="clusters/**/flux-system/" flux create kustomization flux-system \ --source=flux-system \ - --path=./tests/${{ matrix.flux }}/clusters/kind + --path=./tests/${FLUX_VERSION:0:4}/clusters/kind - name: Verify cluster reconciliation run: | kubectl -n flux-system wait kustomization/sources --for=condition=ready --timeout=2m + kubectl -n flux-system wait kustomization/appliers --for=condition=ready --timeout=2m - name: Verify managed resources run: | flux tree kustomization flux-system diff --git a/tests/v2.2/appliers/helm-sync.yaml b/tests/v2.2/appliers/helm-sync.yaml new file mode 100644 index 0000000..e0918f3 --- /dev/null +++ b/tests/v2.2/appliers/helm-sync.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: podinfo + namespace: appliers +spec: + type: oci + interval: 10m + url: oci://ghcr.io/stefanprodan/charts +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: podinfo + namespace: appliers +spec: + interval: 10m + timeout: 2m + chart: + spec: + chart: podinfo + version: ">1.0.0" + sourceRef: + kind: HelmRepository + name: podinfo + interval: 50m + releaseName: podinfo-helm + install: + crds: CreateReplace + remediation: + retries: 3 + upgrade: + remediation: + retries: 3 + test: + enable: false + driftDetection: + mode: enabled + ignore: + - paths: ["/spec/replicas"] + target: + kind: Deployment + values: + replicaCount: 2 diff --git a/tests/v2.2/appliers/kustomize-sync.yaml b/tests/v2.2/appliers/kustomize-sync.yaml new file mode 100644 index 0000000..11a53fc --- /dev/null +++ b/tests/v2.2/appliers/kustomize-sync.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: OCIRepository +metadata: + name: podinfo + namespace: appliers +spec: + interval: 10m + url: oci://ghcr.io/stefanprodan/manifests/podinfo + ref: + semver: ">1.0.0" + ignore: | + # exclude all + /* + # include deployment and service + !deployment.yaml + !service.yaml +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: podinfo + namespace: appliers +spec: + interval: 10m + wait: true + timeout: 2m + retryInterval: 5m + prune: true + force: false + targetNamespace: appliers + sourceRef: + kind: OCIRepository + name: podinfo + namespace: appliers + path: "./" diff --git a/tests/v2.2/appliers/namespace.yaml b/tests/v2.2/appliers/namespace.yaml new file mode 100644 index 0000000..ae07656 --- /dev/null +++ b/tests/v2.2/appliers/namespace.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: appliers + diff --git a/tests/v2.2/clusters/kind/appliers.yaml b/tests/v2.2/clusters/kind/appliers.yaml new file mode 100644 index 0000000..2a6cdff --- /dev/null +++ b/tests/v2.2/clusters/kind/appliers.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: appliers + namespace: flux-system +spec: + dependsOn: + - name: sources + serviceAccountName: kustomize-controller + interval: 10m + sourceRef: + kind: GitRepository + name: flux-system + path: ./tests/v2.2/appliers + prune: true + wait: true + timeout: 5m