diff --git a/controllers/account/Makefile b/controllers/account/Makefile index fe63ee8f5f4..06035dfcf40 100644 --- a/controllers/account/Makefile +++ b/controllers/account/Makefile @@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests. .PHONY: build build: ## Build manager binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go .PHONY: run diff --git a/controllers/job/init/Makefile b/controllers/job/init/Makefile index 3392aa8b514..49d5c8ad124 100644 --- a/controllers/job/init/Makefile +++ b/controllers/job/init/Makefile @@ -51,7 +51,7 @@ CONTROLLER_PKG=github.com/labring/sealos/controllers/pkg CONTROLLER_LICENSE=github.com/labring/sealos/controllers/license/internal/controller build: fmt vet ## Build manager binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/preset-${GOARCH} cmd/preset/main.go && chmod +x bin/preset-${GOARCH} && cp bin/preset-${GOARCH} bin/manager diff --git a/controllers/license/Makefile b/controllers/license/Makefile index d9086310865..c71b79652e6 100644 --- a/controllers/license/Makefile +++ b/controllers/license/Makefile @@ -69,7 +69,7 @@ CONTROLLER_PKG=github.com/labring/sealos/controllers/pkg CONTROLLER_LICENSE=github.com/labring/sealos/controllers/license/internal build: manifests generate fmt vet ## Build manager binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X ${CONTROLLER_PKG}/crypto.encryptionKey=${CRYPTOKEY} -X ${CONTROLLER_PKG}/database.cryptoKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X ${CONTROLLER_PKG}/crypto.encryptionKey=${CRYPTOKEY} -X ${CONTROLLER_PKG}/database.cryptoKey=${CRYPTOKEY}"; \ [ -n "$(LICENSE_KEY)" ] && LD_FLAGS+=" -X ${CONTROLLER_LICENSE}/util/key.EncryptionKey=${LICENSE_KEY}"; \ CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager cmd/manager/main.go diff --git a/controllers/objectstorage/Makefile b/controllers/objectstorage/Makefile index cbe43898401..ec50253fed7 100644 --- a/controllers/objectstorage/Makefile +++ b/controllers/objectstorage/Makefile @@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests. .PHONY: build build: ## Build manager binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go .PHONY: run diff --git a/controllers/resources/Makefile b/controllers/resources/Makefile index d6733814fb5..867f334d4f6 100644 --- a/controllers/resources/Makefile +++ b/controllers/resources/Makefile @@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests. .PHONY: build build: ## Build manager binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \ CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go .PHONY: run diff --git a/service/account/Makefile b/service/account/Makefile index a00677e3a90..9754adf8fb8 100644 --- a/service/account/Makefile +++ b/service/account/Makefile @@ -44,7 +44,7 @@ clean: .PHONY: build build: ## Build service-hub binary. LD_FLAGS="-s -w"; \ - [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY}"; \ + [ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY}"; \ CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go .PHONY: docker-build