From d748c4daba650688d19c3d53b07688bd605437a3 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 3 Dec 2021 17:00:40 +0200 Subject: [PATCH 1/2] Check if working tree is dirty in CI Signed-off-by: Stefan Prodan --- .github/workflows/build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6b4cac61..4a666ecf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,6 +44,13 @@ jobs: run: make test env: KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin + - 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=ghcr.io/fluxcd/${{ github.event.repository.name }}:latest \ From 1341350376bba77136131404c85bf7e7ce352cd2 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 3 Dec 2021 17:06:37 +0200 Subject: [PATCH 2/2] Fix default observed generation Signed-off-by: Stefan Prodan --- config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml | 5 ++--- .../crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml b/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml index c60569aa..26958985 100644 --- a/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml +++ b/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml @@ -95,8 +95,6 @@ spec: - policy type: object status: - default: - observedGeneration: -1 description: ImagePolicyStatus defines the observed state of ImagePolicy properties: conditions: @@ -146,7 +144,6 @@ spec: description: LatestImage gives the first in the list of images scanned by the image repository, when filtered and ordered according to the policy. type: string observedGeneration: - description: ObservedGeneration is the last reconciled generation. format: int64 type: integer type: object @@ -373,6 +370,8 @@ spec: - policy type: object status: + default: + observedGeneration: -1 description: ImagePolicyStatus defines the observed state of ImagePolicy properties: conditions: diff --git a/config/crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml b/config/crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml index 04431afb..69ad70cd 100644 --- a/config/crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml +++ b/config/crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml @@ -71,8 +71,6 @@ spec: type: string type: object status: - default: - observedGeneration: -1 description: ImageRepositoryStatus defines the observed state of ImageRepository properties: canonicalImageName: @@ -340,6 +338,8 @@ spec: type: string type: object status: + default: + observedGeneration: -1 description: ImageRepositoryStatus defines the observed state of ImageRepository properties: canonicalImageName: