From c936fc145b92388a54430eb6b7cd44b910fabcbc Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Mon, 9 May 2022 15:54:55 +0100 Subject: [PATCH 1/2] Ensure git status is tracked at the correct time The previous version would verify git status at time of `make verify` execution, but before all its dependencies executed. If one of the dependencies resulted in a dirty git, the check would still pass. Signed-off-by: Paulo Gomes --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 72a1010c6..96e918736 100644 --- a/Makefile +++ b/Makefile @@ -225,13 +225,12 @@ ifneq ($(shell grep -o 'LIBGIT2_TAG ?= \w.*' Makefile | cut -d ' ' -f 3), $(shel exit 1; \ } endif -ifneq (, $(shell git status --porcelain --untracked-files=no)) - @{ \ - echo "working directory is dirty:"; \ - git --no-pager diff; \ - exit 1; \ - } -endif + + @if [ ! "$$(git status --porcelain --untracked-files=no)" = "" ]; then \ + echo "working directory is dirty:"; \ + git --no-pager diff; \ + exit 1; \ + fi # go-install-tool will 'go install' any package $2 and install it to $1. define go-install-tool From 50cb97f3319269a8d601e30b61e77ba3025be414 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Mon, 9 May 2022 16:16:04 +0100 Subject: [PATCH 2/2] Fix make verify failures Signed-off-by: Paulo Gomes --- api/v1beta1/gitrepository_types.go | 4 ++-- docs/spec/v1beta1/gitrepositories.md | 4 ++-- main.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v1beta1/gitrepository_types.go b/api/v1beta1/gitrepository_types.go index 3cdfab6b9..4c4562927 100644 --- a/api/v1beta1/gitrepository_types.go +++ b/api/v1beta1/gitrepository_types.go @@ -44,8 +44,8 @@ type GitRepositorySpec struct { // The secret name containing the Git credentials. // For HTTPS repositories the secret must contain username and password // fields. - // For SSH repositories the secret must contain identity, identity.pub and - // known_hosts fields. + // For SSH repositories the secret must contain identity and known_hosts + // fields. // +optional SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"` diff --git a/docs/spec/v1beta1/gitrepositories.md b/docs/spec/v1beta1/gitrepositories.md index 4579e8a54..93f0f33ca 100644 --- a/docs/spec/v1beta1/gitrepositories.md +++ b/docs/spec/v1beta1/gitrepositories.md @@ -19,8 +19,8 @@ type GitRepositorySpec struct { // The secret name containing the Git credentials. // For HTTPS repositories the secret must contain username and password // fields. - // For SSH repositories the secret must contain identity, identity.pub and - // known_hosts fields. + // For SSH repositories the secret must contain identity and known_hosts + // fields. // +optional SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` diff --git a/main.go b/main.go index 483d7cb29..3f964a1f8 100644 --- a/main.go +++ b/main.go @@ -245,7 +245,7 @@ func main() { ControllerName: controllerName, Cache: c, TTL: ttl, - CacheRecorder: cacheRecorder, + CacheRecorder: cacheRecorder, }).SetupWithManagerAndOptions(mgr, controllers.HelmChartReconcilerOptions{ MaxConcurrentReconciles: concurrent, RateLimiter: helper.GetRateLimiter(rateLimiterOptions),