From 9ca74a60620128bc097d356a9795b3ae7b744cb0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 26 Nov 2020 10:04:39 +0100 Subject: [PATCH] Simplify manifest testing We don't need to test with kustomize, manifest testing is good enough, as we just test that the manifest are correct, not that they are functional (which would require a change in the poll time). --- .github/kustomize/kured-dev.yaml | 15 ------------- .github/kustomize/kustomization.yaml | 7 ------ ...kustomize-test.yml => manifests-tests.yml} | 22 ++++++++++--------- 3 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 .github/kustomize/kured-dev.yaml delete mode 100644 .github/kustomize/kustomization.yaml rename .github/workflows/{kustomize-test.yml => manifests-tests.yml} (68%) diff --git a/.github/kustomize/kured-dev.yaml b/.github/kustomize/kured-dev.yaml deleted file mode 100644 index daa9427..0000000 --- a/.github/kustomize/kured-dev.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kured - namespace: kube-system -spec: - template: - spec: - containers: - - name: kured - image: docker.io/weaveworks/kured - imagePullPolicy: Always - command: - - /usr/bin/kured - - --period=1m diff --git a/.github/kustomize/kustomization.yaml b/.github/kustomize/kustomization.yaml deleted file mode 100644 index fdcdd8c..0000000 --- a/.github/kustomize/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - kured-ds.yaml - - kured-rbac.yaml -patchesStrategicMerge: - - kured-dev.yaml diff --git a/.github/workflows/kustomize-test.yml b/.github/workflows/manifests-tests.yml similarity index 68% rename from .github/workflows/kustomize-test.yml rename to .github/workflows/manifests-tests.yml index 72144e8..dd808aa 100644 --- a/.github/workflows/kustomize-test.yml +++ b/.github/workflows/manifests-tests.yml @@ -1,8 +1,10 @@ -#This tests if our kustomize manifests still work with an update -#of kustomize or with an update of our manifests (keeping the image -# the same). +#This: +#- Periodically ensures our latest releases manifest deploy correctly +#- Ensures that a PR changing any of the manifests (later used for +# producing a release) will not break a deployment of an existing release +# (so we can assume it will not break a new release either) -name: Kustomize deploy +name: Manifest deploy on: pull_request: @@ -12,7 +14,7 @@ on: - cron: '0 0 1 * *' jobs: - deploy-with-kustomize: + use-manifests: runs-on: ubuntu-latest steps: - name: Checkout @@ -26,14 +28,14 @@ jobs: - name: Create a default kind cluster uses: helm/kind-action@master - # Kustomize won't work with symlinks to resources outside its folder # kind-action already installed kind and kubectl. - - name: Deploy with kubectl using kustomization + # Hard code DH_ORG weaveworks so that all forks point to latest image + # from weaveworks. + - name: Deploy with kubectl run: | - cp kured-{ds,rbac}.yaml .github/kustomize/ VERSION=$(curl -s https://api.github.com/repos/weaveworks/kured/releases | jq -r .[0].tag_name) - sed -i "s#docker.io/weaveworks/kured#docker.io/weaveworks/kured:$VERSION#g" .github/kustomize/kured-dev.yaml - kubectl apply -k .github/kustomize/ + make DH_ORG=weaveworks VERSION=$VERSION manifest + kubectl apply -f kured-{rbac,ds}.yaml - name: Show kured is deploying run: |