From 702668a95c3ba2e2b3006246c04353dc9aa8d8ee Mon Sep 17 00:00:00 2001 From: Tiago Silva Date: Thu, 23 Jan 2025 15:54:06 +0000 Subject: [PATCH] plugins: remove outdated `sigs.k8s.io/kustomize/api` replace (#51402) * plugins: remove outdated `sigs.k8s.io/kustomize/api` replace This PR removes the outdated go.mod replace directive for `sigs.k8s.io/kustomize/api` and adds the `kustomize_disable_go_plugin_support` build tag to skip the support for dynamic plugins. Signed-off-by: Tiago Silva * handle review comments --------- Signed-off-by: Tiago Silva --- integrations/access/common.mk | 2 +- integrations/event-handler/Makefile | 2 +- integrations/event-handler/go.mod | 3 --- integrations/event-handler/go.sum | 4 ++-- integrations/operator/Dockerfile | 2 +- integrations/operator/Dockerfile.gha | 2 +- integrations/operator/Makefile | 2 +- integrations/terraform/Makefile | 2 +- integrations/terraform/go.mod | 1 - integrations/terraform/go.sum | 4 ++-- 10 files changed, 10 insertions(+), 14 deletions(-) diff --git a/integrations/access/common.mk b/integrations/access/common.mk index ee77ce7fa380a..122fe9614c4d7 100644 --- a/integrations/access/common.mk +++ b/integrations/access/common.mk @@ -30,7 +30,7 @@ DOCKER_BUILD_ARGS = --load --platform="$(OS)/$(ARCH)" .PHONY: $(BINARY) $(BINARY): - GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BINARY) $(BUILDFLAGS) github.com/gravitational/teleport/integrations/access/$(ACCESS_PLUGIN)/cmd/teleport-$(ACCESS_PLUGIN) + GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BINARY) -tags "kustomize_disable_go_plugin_support" $(BUILDFLAGS) github.com/gravitational/teleport/integrations/access/$(ACCESS_PLUGIN)/cmd/teleport-$(ACCESS_PLUGIN) .PHONY: test test: FLAGS ?= '-race' diff --git a/integrations/event-handler/Makefile b/integrations/event-handler/Makefile index d0a0906bada06..fc49e294271f0 100644 --- a/integrations/event-handler/Makefile +++ b/integrations/event-handler/Makefile @@ -44,7 +44,7 @@ RELEASE_MESSAGE = "Building with GOOS=$(OS) GOARCH=$(ARCH)." .PHONY: build build: - GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BUILDDIR)/teleport-event-handler $(BUILDFLAGS) + GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "kustomize_disable_go_plugin_support" -o $(BUILDDIR)/teleport-event-handler $(BUILDFLAGS) # darwin-signed-build is a wrapper around the build target that ensures it is codesigned include ../../darwin-signing.mk diff --git a/integrations/event-handler/go.mod b/integrations/event-handler/go.mod index 910dfef050d6d..02a0faf3ce610 100644 --- a/integrations/event-handler/go.mod +++ b/integrations/event-handler/go.mod @@ -344,7 +344,4 @@ replace ( github.com/moby/spdystream => github.com/gravitational/spdystream v0.0.0-20230512133543-4e46862ca9bf github.com/redis/go-redis/v9 => github.com/gravitational/redis/v9 v9.6.1-teleport.1 github.com/vulcand/predicate => github.com/gravitational/predicate v1.3.1 - // replace module sigs.k8s.io/kustomize/api until https://github.com/kubernetes-sigs/kustomize/issues/5524 is resolved, - // otherwise we get significant increase in size of the "teleport" binary. - sigs.k8s.io/kustomize/api => github.com/gravitational/kustomize/api v0.16.0-teleport.1 ) diff --git a/integrations/event-handler/go.sum b/integrations/event-handler/go.sum index b542e042797fc..fdd3960aa501f 100644 --- a/integrations/event-handler/go.sum +++ b/integrations/event-handler/go.sum @@ -1192,8 +1192,6 @@ github.com/gravitational/httprouter v1.3.1-0.20220408074523-c876c5e705a5 h1:qg8F github.com/gravitational/httprouter v1.3.1-0.20220408074523-c876c5e705a5/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/gravitational/kingpin/v2 v2.1.11-0.20230515143221-4ec6b70ecd33 h1:VFER/+0TfRypJhc9XeuggTtEZzhhe75DSVqMv/avHEU= github.com/gravitational/kingpin/v2 v2.1.11-0.20230515143221-4ec6b70ecd33/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/gravitational/kustomize/api v0.16.0-teleport.1 h1:d/aWgghHn/N6TlwGxjjbelUC7b0G0YRyUDf8XS1aScg= -github.com/gravitational/kustomize/api v0.16.0-teleport.1/go.mod h1:E/0/egj7ED7xWEegMHlRagaZTiL6fxakmSR2pyiK2ZU= github.com/gravitational/license v0.0.0-20240313232707-8312e719d624 h1:TjiJ98fWU5N28MBktP5vj1/xohin7cX/JBPPJ8iCiTE= github.com/gravitational/license v0.0.0-20240313232707-8312e719d624/go.mod h1:pERQ8qtFfvV0Pfw9jA5o1WH1snupQQ3SZ+n8CVdRJNs= github.com/gravitational/predicate v1.3.1 h1:f1uGg2FF6z5wZbcafYpLZJ1gl+82I0MlSd0cQKDPQe0= @@ -2431,6 +2429,8 @@ sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= +sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ= sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/integrations/operator/Dockerfile b/integrations/operator/Dockerfile index 9c7652003b75e..33eee89a5447e 100644 --- a/integrations/operator/Dockerfile +++ b/integrations/operator/Dockerfile @@ -77,7 +77,7 @@ ARG TARGETARCH # CGO is required for github.com/gravitational/teleport/lib/system RUN echo "Targeting $TARGETOS/$TARGETARCH with CC=$COMPILER_NAME" && \ CGO_ENABLED=1 CC=$COMPILER_NAME GOOS=$TARGETOS GOARCH=$TARGETARCH \ - go build -a -o /go/bin/teleport-operator github.com/gravitational/teleport/integrations/operator + go build -tags "kustomize_disable_go_plugin_support" -a -o /go/bin/teleport-operator github.com/gravitational/teleport/integrations/operator # Create the image with the build operator on the $TARGETPLATFORM # TARGETPLATFORM is provided by Docker/buildx diff --git a/integrations/operator/Dockerfile.gha b/integrations/operator/Dockerfile.gha index dba764f0beed3..f8012173d8f37 100644 --- a/integrations/operator/Dockerfile.gha +++ b/integrations/operator/Dockerfile.gha @@ -96,7 +96,7 @@ RUN case "$TARGETARCH" in \ esac; \ echo "Targeting $TARGETOS/$TARGETARCH with CC=$COMPILER_NAME" && \ CGO_ENABLED=1 CC=$COMPILER_NAME GOOS=$TARGETOS GOARCH=$TARGETARCH \ - go build -a -o /go/bin/teleport-operator github.com/gravitational/teleport/integrations/operator + go build -tags "kustomize_disable_go_plugin_support" -a -o /go/bin/teleport-operator github.com/gravitational/teleport/integrations/operator # Create the image with the build operator on the $TARGETPLATFORM # TARGETPLATFORM is provided by Docker/buildx diff --git a/integrations/operator/Makefile b/integrations/operator/Makefile index 4073de70029df..2204e15be8fc3 100644 --- a/integrations/operator/Makefile +++ b/integrations/operator/Makefile @@ -154,7 +154,7 @@ crdgen-test: ## Run crdgen tests. .PHONY: build build: generate fmt vet ## Build manager binary. - go build -trimpath -o bin/manager main.go namespace.go config.go + go build -trimpath -tags "kustomize_disable_go_plugin_support" -o bin/manager main.go namespace.go config.go .PHONY: run run: manifests generate fmt vet ## Run a controller from your host. diff --git a/integrations/terraform/Makefile b/integrations/terraform/Makefile index 2cc072c0b9de4..79ce5ceeda136 100644 --- a/integrations/terraform/Makefile +++ b/integrations/terraform/Makefile @@ -30,7 +30,7 @@ clean: tfclean .PHONY: build build: clean # Turning off GOWORK to prevent missing package errors. - GOWORK=off GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BUILDDIR)/terraform-provider-teleport $(BUILDFLAGS) + GOWORK=off GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "kustomize_disable_go_plugin_support" -o $(BUILDDIR)/terraform-provider-teleport $(BUILDFLAGS) build-darwin-universal: $(addprefix $(BUILDDIR)/terraform-provider-teleport_,arm64 amd64) lipo -create -output $(BUILDDIR)/terraform-provider-teleport $^ diff --git a/integrations/terraform/go.mod b/integrations/terraform/go.mod index d324e122a0939..807457d1e0c1a 100644 --- a/integrations/terraform/go.mod +++ b/integrations/terraform/go.mod @@ -408,5 +408,4 @@ replace ( github.com/moby/spdystream => github.com/gravitational/spdystream v0.0.0-20230512133543-4e46862ca9bf github.com/redis/go-redis/v9 => github.com/gravitational/redis/v9 v9.6.1-teleport.1 github.com/vulcand/predicate => github.com/gravitational/predicate v1.3.1 - sigs.k8s.io/kustomize/api => github.com/gravitational/kustomize/api v0.16.0-teleport.1 ) diff --git a/integrations/terraform/go.sum b/integrations/terraform/go.sum index a81d9b581512b..8e5a10cfa92cc 100644 --- a/integrations/terraform/go.sum +++ b/integrations/terraform/go.sum @@ -1320,8 +1320,6 @@ github.com/gravitational/httprouter v1.3.1-0.20220408074523-c876c5e705a5 h1:qg8F github.com/gravitational/httprouter v1.3.1-0.20220408074523-c876c5e705a5/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/gravitational/kingpin/v2 v2.1.11-0.20230515143221-4ec6b70ecd33 h1:VFER/+0TfRypJhc9XeuggTtEZzhhe75DSVqMv/avHEU= github.com/gravitational/kingpin/v2 v2.1.11-0.20230515143221-4ec6b70ecd33/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/gravitational/kustomize/api v0.16.0-teleport.1 h1:d/aWgghHn/N6TlwGxjjbelUC7b0G0YRyUDf8XS1aScg= -github.com/gravitational/kustomize/api v0.16.0-teleport.1/go.mod h1:E/0/egj7ED7xWEegMHlRagaZTiL6fxakmSR2pyiK2ZU= github.com/gravitational/license v0.0.0-20240313232707-8312e719d624 h1:TjiJ98fWU5N28MBktP5vj1/xohin7cX/JBPPJ8iCiTE= github.com/gravitational/license v0.0.0-20240313232707-8312e719d624/go.mod h1:pERQ8qtFfvV0Pfw9jA5o1WH1snupQQ3SZ+n8CVdRJNs= github.com/gravitational/predicate v1.3.1 h1:f1uGg2FF6z5wZbcafYpLZJ1gl+82I0MlSd0cQKDPQe0= @@ -2808,6 +2806,8 @@ sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= +sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ= sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=