From 1fdb9829ac2b524452d35a0dd11ef9107bb5cd51 Mon Sep 17 00:00:00 2001 From: David Simansky Date: Tue, 10 Oct 2023 21:16:08 +0200 Subject: [PATCH] [release-v1.10] Add kn-plugin-event custom ld flags (#281) --- hack/build.sh.d/kn-plugin-event.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 hack/build.sh.d/kn-plugin-event.sh diff --git a/hack/build.sh.d/kn-plugin-event.sh b/hack/build.sh.d/kn-plugin-event.sh new file mode 100644 index 0000000000..c87c3fd443 --- /dev/null +++ b/hack/build.sh.d/kn-plugin-event.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +knEventVersion="$(grep 'knative.dev/kn-plugin-event ' "$(basedir)/go.mod" \ + | head -n 1 \ + | sed -sE 's/.* (v[0-9]+\.[0-9]+\.[0-9]+.*)/\1/')" +knEventRelease="${knEventVersion%.*}" +knEventRelease="${knEventRelease#v}" +readonly upstream_sender_image="registry.ci.openshift.org/knative/release-${knEventRelease}:client-plugin-event-sender" +readonly sender_image="${KN_PLUGIN_EVENT_SENDER_IMAGE:-${upstream_sender_image}}" +export EXTERNAL_LD_FLAGS="${EXTERNAL_LD_FLAGS:-} \ +-X knative.dev/kn-plugin-event/pkg/metadata.Image=${sender_image} \ +-X knative.dev/kn-plugin-event/pkg/metadata.Version=${knEventVersion}"