1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: make ldflags optional in .ko.yaml (#4419)

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-08-26 15:40:27 +02:00 committed by GitHub
parent 9e49b25484
commit 4864be14f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -2,14 +2,14 @@ builds:
- id: initContainer
main: ./cmd/initContainer
ldflags:
- "{{ .Env.LD_FLAGS }}"
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}'
- id: kyverno
main: ./cmd/kyverno
ldflags:
- "{{ .Env.LD_FLAGS }}"
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}'
- id: cli
main: ./cmd/cli
ldflags:
- "{{ .Env.LD_FLAGS }}"
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}'

View file

@ -141,26 +141,32 @@ REPO_CLI := $(REPO)/kyverno-cli
.PHONY: ko-build-initContainer
ko-build-initContainer: $(KO)
# @$(KO) login $(REGISTRY)
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(REPO_KYVERNOPRE) $(KO) build $(KYVERNOPRE_DIR) --bare --tags=latest,$(IMAGE_TAG) --platform=$(KO_PLATFORM)
.PHONY: ko-build-kyverno
ko-build-kyverno: $(KO)
# @$(KO) login $(REGISTRY)
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(REPO_KYVERNO) $(KO) build $(KYVERNO_DIR) --bare --tags=latest,$(IMAGE_TAG) --platform=$(KO_PLATFORM)
.PHONY: ko-build-cli
ko-build-cli: $(KO)
# @$(KO) login $(REGISTRY)
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(REPO_CLI) $(KO) build $(CLI_DIR) --bare --tags=latest,$(IMAGE_TAG) --platform=$(KO_PLATFORM)
.PHONY: ko-build-initContainer-dev
ko-build-initContainer-dev: $(KO)
@$(KO) login $(REGISTRY) --username "dummy" --password $(GITHUB_TOKEN)
@LD_FLAGS=$(LD_FLAGS_DEV) KO_DOCKER_REPO=$(REPO_KYVERNOPRE) $(KO) build $(KYVERNOPRE_DIR) --bare --tags=latest,$(IMAGE_TAG_DEV) --platform=$(KO_PLATFORM)
.PHONY: ko-build-kyverno-dev
ko-build-kyverno-dev: $(KO)
@$(KO) login $(REGISTRY) --username "dummy" --password $(GITHUB_TOKEN)
@LD_FLAGS=$(LD_FLAGS_DEV) KO_DOCKER_REPO=$(REPO_KYVERNO) $(KO) build $(KYVERNO_DIR) --bare --tags=latest,$(IMAGE_TAG_DEV) --platform=$(KO_PLATFORM)
.PHONY: ko-build-cli-dev
ko-build-cli-dev: $(KO)
@$(KO) login $(REGISTRY) --username "dummy" --password $(GITHUB_TOKEN)
@LD_FLAGS=$(LD_FLAGS_DEV) KO_DOCKER_REPO=$(REPO_CLI) $(KO) build $(CLI_DIR) --bare --tags=latest,$(IMAGE_TAG_DEV) --platform=$(KO_PLATFORM)
.PHONY: ko-build-initContainer-local

View file

@ -15,5 +15,5 @@ metadata:
spec:
containers:
- name: kyverno
image: ghcr.io/kyverno/kyverno
image: ghcr.io/kyverno/kyverno:v1.7.3