From 21c57265f32035d01d20075e9cd537968ca92cf4 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Thu, 9 Feb 2023 11:38:14 +0100 Subject: [PATCH 1/2] Fix pre-commit findings: executables It seems the pre-commit config was merged without running pre-commit on the repo ever. This patch fixes the pre-commit finding. --- templates/mariadb/bin/mariadb_init.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 templates/mariadb/bin/mariadb_init.sh diff --git a/templates/mariadb/bin/mariadb_init.sh b/templates/mariadb/bin/mariadb_init.sh old mode 100644 new mode 100755 From 858b387cd8511f137409860bf1fee41b3621bf14 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Thu, 9 Feb 2023 11:45:01 +0100 Subject: [PATCH 2/2] Fix pre-commit findings: operator-lint It seems the pre-commit config was merged without running pre-commit on the repo ever. This patch fixes the pre-commit finding by adding the missing operator-lint and gowork make targets and fixing the lint findings. --- .gitignore | 4 ++++ Makefile | 12 ++++++++++++ api/v1beta1/mariadb_types.go | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 437eeac1..680ddf4c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,7 @@ config/manager/kustomization.yaml # Common CI tools repository CI_TOOLS_REPO + +#ignore go.work as it is generated on the fly +go.work +go.work.sum diff --git a/Makefile b/Makefile index 4a799928..9acfb83b 100644 --- a/Makefile +++ b/Makefile @@ -288,3 +288,15 @@ golangci: get-ci-tools # Run go lint against code golint: get-ci-tools PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh + +.PHONY: operator-lint +operator-lint: $(LOCALBIN) gowork ## Runs operator-lint + #TODO(gibi): bump this to v0.2.2 as soon as that version is tagged + GOBIN=$(LOCALBIN) go install github.com/gibizer/operator-lint@2ffa25b7f1c13fb2bdae5444a3dd1b5bbad529b1 + go vet -vettool=$(LOCALBIN)/operator-lint ./... ./api/... + +.PHONY: gowork +gowork: ## Generate go.work file + test -f go.work || go work init + go work use . + go work use ./api diff --git a/api/v1beta1/mariadb_types.go b/api/v1beta1/mariadb_types.go index dd3ccb3d..0bbefd51 100644 --- a/api/v1beta1/mariadb_types.go +++ b/api/v1beta1/mariadb_types.go @@ -32,7 +32,7 @@ type MariaDBSpec struct { // +kubebuilder:validation:Optional // +kubebuilder:default="quay.io/tripleozedcentos9/openstack-mariadb:current-tripleo" - ContainerImage string `json:"containerImage,omitempty"` + ContainerImage string `json:"containerImage"` AdoptionRedirect AdoptionRedirectSpec `json:"adoptionRedirect,omitempty"` }