Skip to content

Commit

Permalink
make: fix go_preflight_ldflags and helm_values_mutation_function
Browse files Browse the repository at this point in the history
  • Loading branch information
maelvls committed Sep 30, 2024
1 parent ce0511a commit 3aa2fe8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 10 additions & 9 deletions make/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ go_preflight_mod_dir := .
go_preflight_ldflags := \
-X $(repo_name)/pkg/version.PreflightVersion=$(VERSION) \
-X $(repo_name)/pkg/version.Commit=$(GITCOMMIT) \
-X $(repo_name)/pkg/version.BuildDate="$$(date -uR)" \
-X $(repo_name)/pkg/client.ClientID="k3TrDbfLhCgnpAbOiiT2kIE1AbovKzjo" \
-X $(repo_name)/pkg/client.ClientSecret="f39w_3KT9Vp0VhzcPzvh-uVbudzqCFmHER3Huj0dvHgJwVrjxsoOQPIw_1SDiCfa" \
-X $(repo_name)/pkg/client.AuthServerDomain="auth.jetstack.io"
-X $(repo_name)/pkg/version.BuildDate=$(shell date "+%F-%T-%Z") \
-X $(repo_name)/pkg/client.ClientID=k3TrDbfLhCgnpAbOiiT2kIE1AbovKzjo \
-X $(repo_name)/pkg/client.ClientSecret=f39w_3KT9Vp0VhzcPzvh-uVbudzqCFmHER3Huj0dvHgJwVrjxsoOQPIw_1SDiCfa \
-X $(repo_name)/pkg/client.AuthServerDomain=auth.jetstack.io

oci_preflight_base_image_flavor := static
oci_preflight_image_name := quay.io/jetstack/venafi-agent
Expand All @@ -26,6 +26,7 @@ oci_preflight_image_name_development := jetstack.local/venafi-agent
deploy_name := venafi-kubernetes-agent
deploy_namespace := venafi

helm_chart_repo_base := oci://registry.venafi.cloud/charts
helm_chart_source_dir := deploy/charts/venafi-kubernetes-agent
helm_chart_name := venafi-kubernetes-agent
helm_chart_version := $(VERSION:v%=%)
Expand All @@ -34,13 +35,13 @@ helm_docs_use_helm_tool := 1
helm_generate_schema := 1
helm_verify_values := 1

golangci_lint_config := .golangci.yaml

define helm_values_mutation_function
$(YQ) \
# Allows us to replace the Helm values.yaml's image.repository and image.tag
# with the right values. We use "=" and not ":=" because $(YQ) isn't defined yet
# in 00_mod.mk, so we need this var to be lazy.
helm_values_mutation_function = $(YQ) \
'( .image.repository = "$(oci_preflight_image_name)" ) | \
( .image.tag = "$(oci_preflight_image_tag)" )' \
$1 --inplace
endef

golangci_lint_config := .golangci.yaml
go_header_file := /dev/null
2 changes: 2 additions & 0 deletions make/02_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GITHUB_OUTPUT ?= /dev/stderr
## @category [shared] Release
release: $(helm_chart_archive)
$(MAKE) oci-push-preflight
$(HELM) push "$(helm_chart_archive)" "$(helm_chart_repo_base)"

@echo "RELEASE_OCI_preflight_IMAGE=$(oci_preflight_image_name)" >> "$(GITHUB_OUTPUT)"
@echo "RELEASE_OCI_preflight_TAG=$(oci_preflight_image_tag)" >> "$(GITHUB_OUTPUT)"
Expand Down Expand Up @@ -41,3 +42,4 @@ $(helm_chart_source_dir)/templates/venafi-connection-crd.yaml: $(helm_chart_sour
# Replace the generate-crds target with generate-crds-venconn.
shared_generate_targets := $(filter-out generate-crds,$(shared_generate_targets))
shared_generate_targets += generate-crds-venconn

0 comments on commit 3aa2fe8

Please sign in to comment.