From e3c86126b277c3e9c1df43b2fb93b3f75020c327 Mon Sep 17 00:00:00 2001 From: Oliver <69219753+ostempel@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:48:33 +0100 Subject: [PATCH] fix gardener local deployment (#34) --- .gitignore | 1 + Dockerfile | 2 +- Makefile | 39 +++++++++++++------------- charts/gardener-extension-audit/doc.go | 2 +- example/controller-registration.yaml | 2 +- go.mod | 4 +-- hack/update-codegen.sh | 13 ++++++--- 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 893124c..729e024 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ helm .vscode hack/tools/bin/* bin +.ci/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2dcd554..ae00beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22 AS builder +FROM golang:1.23 AS builder WORKDIR /go/src/github.com/metal-stack/gardener-extension-audit COPY . . diff --git a/Makefile b/Makefile index abc6c03..0876079 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +ENSURE_GARDENER_MOD := $(shell go get github.com/gardener/gardener@$$(go list -m -f "{{.Version}}" github.com/gardener/gardener)) +GARDENER_HACK_DIR := $(shell go list -m -f "{{.Dir}}" github.com/gardener/gardener)/hack IMAGE_TAG := $(or ${GITHUB_TAG_NAME}, latest) REGISTRY := ghcr.io/metal-stack IMAGE_PREFIX := $(REGISTRY) @@ -10,8 +12,8 @@ LEADER_ELECTION := false IGNORE_OPERATION_ANNOTATION := false WEBHOOK_CONFIG_URL := localhost -GOLANGCI_LINT_VERSION := v1.56.2 -GO_VERSION := 1.22 +GOLANGCI_LINT_VERSION := v1.61.0 +GO_VERSION := 1.23 ifeq ($(CI),true) DOCKER_TTY_ARG="" @@ -21,21 +23,27 @@ endif export GO111MODULE := on -TOOLS_DIR := hack/tools --include vendor/github.com/gardener/gardener/hack/tools.mk +TOOLS_DIR := $(HACK_DIR)/tools +include $(GARDENER_HACK_DIR)/tools.mk ################################################################# # Rules related to binary build, Docker image build and release # ################################################################# +.PHONY: tidy +tidy: + @GO111MODULE=on go mod tidy + @mkdir -p $(REPO_ROOT)/.ci/hack && cp $(GARDENER_HACK_DIR)/.ci/* $(REPO_ROOT)/.ci/hack/ && chmod +xw $(REPO_ROOT)/.ci/hack/* + + .PHONY: build build: go build -ldflags $(LD_FLAGS) -tags netgo -o bin/gardener-extension-audit ./cmd/gardener-extension-audit .PHONY: install -install: revendor $(HELM) +install: tidy $(HELM) @LD_FLAGS="-w -X github.com/gardener/$(EXTENSION_PREFIX)-$(NAME)/pkg/version.Version=$(VERSION)" \ - $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/install.sh ./... + bash $(GARDENER_HACK_DIR)/install.sh ./... .PHONY: docker-image docker-image: @@ -52,34 +60,25 @@ docker-push: # Rules for verification, formatting, linting, testing and cleaning # ##################################################################### -.PHONY: revendor -revendor: - @GO111MODULE=on go mod vendor - @GO111MODULE=on go mod tidy - @chmod +x $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/* - @chmod +x $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/.ci/* - @$(REPO_ROOT)/hack/update-github-templates.sh - .PHONY: clean clean: @$(shell find ./example -type f -name "controller-registration.yaml" -exec rm '{}' \;) - @$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/clean.sh ./cmd/... ./pkg/... + @bash $(GARDENER_HACK_DIR)/clean.sh ./cmd/... ./pkg/... .PHONY: check-generate check-generate: @$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-generate.sh $(REPO_ROOT) .PHONY: generate -generate: $(HELM) - @$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate-sequential.sh ./charts/... ./cmd/... ./pkg/... +generate: $(VGOPATH) $(HELM) $(YQ) + echo $(shell git -c safe.directory=/go/src/github.com/metal-stack/gardener-extension-audit describe --abbrev=0 --tags) > VERSION + @REPO_ROOT=$(REPO_ROOT) VGOPATH=$(VGOPATH) GARDENER_HACK_DIR=$(GARDENER_HACK_DIR) bash $(GARDENER_HACK_DIR)/generate-sequential.sh ./charts/... ./cmd/... ./pkg/... .PHONY: generate-in-docker -generate-in-docker: revendor $(HELM) $(YQ) - echo $(shell git describe --abbrev=0 --tags) > VERSION +generate-in-docker: tidy install $(HELM) $(YQ) docker run --rm -i$(DOCKER_TTY_ARG) -v $(PWD):/go/src/github.com/metal-stack/gardener-extension-audit golang:$(GO_VERSION) \ sh -c "cd /go/src/github.com/metal-stack/gardener-extension-audit \ && make generate \ - # && make install generate \ && chown -R $(shell id -u):$(shell id -g) ." .PHONY: test diff --git a/charts/gardener-extension-audit/doc.go b/charts/gardener-extension-audit/doc.go index 84164cf..96b575c 100644 --- a/charts/gardener-extension-audit/doc.go +++ b/charts/gardener-extension-audit/doc.go @@ -1,4 +1,4 @@ -//go:generate sh -c "../../vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh audit . $(cat ../../VERSION) ../../example/controller-registration.yaml Extension:audit" +//go:generate sh -c "bash $GARDENER_HACK_DIR/generate-controller-registration.sh audit . $(cat ../../VERSION) ../../example/controller-registration.yaml Extension:audit" // Package chart enables go:generate support for generating the correct controller registration. package chart diff --git a/example/controller-registration.yaml b/example/controller-registration.yaml index 90654eb..5946c85 100644 --- a/example/controller-registration.yaml +++ b/example/controller-registration.yaml @@ -4,7 +4,7 @@ kind: ControllerDeployment metadata: name: audit helm: - rawChart: H4sIAAAAAAAAA+0ca2/bRjKf+SsWTA5tgZB6ywWB3J3jqK3RxBZsX3qHojBW5EpiTXJZPhz7kvz3m32QWr5EyXbsS8uBAUvLncfuzszOzC61wpFDAhIZ5CYhQezSwMCp4ya9Zw8HfYCDyYT/Byj/558Ho/FgOBlOp6x9MB5P+8/Q5AFlaIQ0TnCE0LOI0mRbv7bnXymsmtb/aI2jxLzFvndvHmyBp+Nx4/oP+4PS+k9HB9NnqP8A42uFv/j649B9TyK27ha6Hmg4DPOv+sDs65pDYjtyw4Q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a/go.mod b/go.mod index 0e24bc4..e65d86a 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/metal-stack/gardener-extension-audit -go 1.22.0 - -toolchain go1.22.8 +go 1.23.0 require ( github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 4232cb1..64fe9ff 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -4,6 +4,11 @@ set -o errexit set -o nounset set -o pipefail +# setup virtual GOPATH +source "$GARDENER_HACK_DIR"/vgopath-setup.sh + +CODE_GEN_DIR=$(go list -m -f '{{.Dir}}' k8s.io/code-generator) + # We need to explicitly pass GO111MODULE=off to k8s.io/code-generator as it is significantly slower otherwise, # see https://github.com/kubernetes/code-generator/issues/100. export GO111MODULE=off @@ -14,7 +19,7 @@ PROJECT_ROOT=$(dirname $0)/.. git config --global --add safe.directory /go/src/github.com/metal-stack/gardener-extension-audit -bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ +bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \ deepcopy,defaulter \ github.com/metal-stack/gardener-extension-audit/pkg/client \ github.com/metal-stack/gardener-extension-audit/pkg/apis \ @@ -22,7 +27,7 @@ bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh "audit:v1alpha1" \ --go-header-file "${PROJECT_ROOT}/hack/boilerplate.txt" -bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ +bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \ conversion \ github.com/metal-stack/gardener-extension-audit/pkg/client \ github.com/metal-stack/gardener-extension-audit/pkg/apis \ @@ -31,7 +36,7 @@ bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh --extra-peer-dirs=github.com/metal-stack/gardener-extension-audit/pkg/apis/audit,github.com/metal-stack/gardener-extension-audit/pkg/apis/audit/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \ --go-header-file "${PROJECT_ROOT}/hack/boilerplate.txt" -bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ +bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \ deepcopy,defaulter \ github.com/metal-stack/gardener-extension-audit/pkg/client/componentconfig \ github.com/metal-stack/gardener-extension-audit/pkg/apis \ @@ -39,7 +44,7 @@ bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh "config:v1alpha1" \ --go-header-file "${PROJECT_ROOT}/hack/boilerplate.txt" -bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ +bash "${CODE_GEN_DIR}/generate-internal-groups.sh" \ conversion \ github.com/metal-stack/gardener-extension-audit/pkg/client/componentconfig \ github.com/metal-stack/gardener-extension-audit/pkg/apis \