Skip to content

Commit

Permalink
integrations: build with -trimpath option (#45092)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmb3 authored Aug 6, 2024
1 parent 0919a6d commit a7847e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integrations/access/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION ?= $(shell go run ../../hack/get-version/get-version.go)
BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-$(ACCESS_PLUGIN)
ADDFLAGS ?=
BUILDFLAGS ?= $(ADDFLAGS) -ldflags "-w -s"
BUILDFLAGS ?= $(ADDFLAGS) -trimpath -ldflags "-w -s"
CGOFLAG ?= CGO_ENABLED=0

OS ?= $(shell go env GOOS)
Expand Down
6 changes: 3 additions & 3 deletions integrations/event-handler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BINARY = $(BUILDDIR)/teleport-event-handler

GITREF ?= $(shell git describe --dirty --long --tags --match '$(VERSION)')
ADDFLAGS ?=
BUILDFLAGS ?= $(ADDFLAGS) -ldflags "-w -s -X main.Gitref=$(GITREF) -X main.Version=$(VERSION)"
BUILDFLAGS ?= $(ADDFLAGS) -trimpath -ldflags "-w -s -X main.Gitref=$(GITREF) -X main.Version=$(VERSION)"
CGOFLAG ?= CGO_ENABLED=0

PASS ?= 1234
Expand Down Expand Up @@ -58,7 +58,7 @@ release: build
tar -czf $(RELEASE).tar.gz $(RELEASE_NAME)
rm -rf $(RELEASE_NAME)/
@echo "---> Created $(RELEASE).tar.gz."


.PHONY: clean
clean:
Expand Down Expand Up @@ -96,7 +96,7 @@ configure: build

.PHONY: fluentd
fluentd:
docker run -p 8888:8888 -v $(LOCALDIR)tmp:/keys -v $(LOCALDIR)tmp/fluent.conf:/fluentd/etc/fluent.conf fluent/fluentd:edge
docker run -p 8888:8888 -v $(LOCALDIR)tmp:/keys -v $(LOCALDIR)tmp/fluent.conf:/fluentd/etc/fluent.conf fluent/fluentd:edge

.PHONY: example
example: build
Expand Down
2 changes: 1 addition & 1 deletion integrations/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ crdgen-test: ## Run crdgen tests.

.PHONY: build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go namespace.go config.go
go build -trimpath -o bin/manager main.go namespace.go config.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
Expand Down
5 changes: 3 additions & 2 deletions integrations/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ BUILDDIR ?= build
TFDIR ?= example

ADDFLAGS ?=
BUILDFLAGS ?= $(ADDFLAGS) -ldflags '-w -s'
BUILDFLAGS ?= $(ADDFLAGS) -trimpath -ldflags '-w -s'
# CGO must NOT be enabled as hashicorp cloud does not support running providers using on CGO.
CGOFLAG ?= CGO_ENABLED=0

RELEASE = terraform-provider-teleport-v$(VERSION)-$(OS)-$(ARCH)-bin
Expand Down Expand Up @@ -166,4 +167,4 @@ $(LOCALBIN):

bin/tfplugindocs: go.mod $(LOCALBIN)
mkdir -p bin
GOBIN=$(LOCALBIN) go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
GOBIN=$(LOCALBIN) go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs

0 comments on commit a7847e5

Please sign in to comment.