Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💝 Kn Event buildflags patch #282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions openshift/patches/200-kn-event-buildflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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 000000000..c87c3fd44
--- /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}"