From 265164405707211c49b5a2036c1055e2e6096f42 Mon Sep 17 00:00:00 2001 From: David Simansky Date: Wed, 13 Apr 2022 19:34:16 +0200 Subject: [PATCH] [release-v1.1.0] Update kn-plugin-event (#1024) --- go.mod | 2 +- go.sum | 4 ++-- .../kn-plugin-event/pkg/cli/ics/constants.go | 5 ----- .../kn-plugin-event/pkg/sender/in_cluster.go | 13 ++----------- vendor/modules.txt | 4 ++-- 5 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 vendor/knative.dev/kn-plugin-event/pkg/cli/ics/constants.go diff --git a/go.mod b/go.mod index b76d0a4d3f..ffc4d393b1 100644 --- a/go.mod +++ b/go.mod @@ -41,6 +41,6 @@ replace ( k8s.io/code-generator => k8s.io/code-generator v0.21.4 // Inlined plugins - knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220331134246-2c22e325c977 + knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220412125940-01b7cf265a69 knative.dev/kn-plugin-func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20220413141425-a3b388f3a2d8 ) diff --git a/go.sum b/go.sum index 3607f41853..42cd1aa47b 100644 --- a/go.sum +++ b/go.sum @@ -2119,8 +2119,8 @@ github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3 github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220331134246-2c22e325c977 h1:G/bBqKfxZdddNCn2TmtUsIYoJkqnugAvyLaEnWlKYRM= -github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220331134246-2c22e325c977/go.mod h1:We6ISNJGglXUFJaY06o/9ZyFOESVJMw+WifpRqTOnXc= +github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220412125940-01b7cf265a69 h1:122tH4tHwjx+YLdUQW9n3xhLCZvcRA+5VJhg2yWHWPA= +github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220412125940-01b7cf265a69/go.mod h1:We6ISNJGglXUFJaY06o/9ZyFOESVJMw+WifpRqTOnXc= github.com/openshift-knative/kn-plugin-func v1.1.3-0.20220413141425-a3b388f3a2d8 h1:brTiR2qD8lxt/eaxANpED9DZfuZ/Ccbxc6JqmKAAZvE= github.com/openshift-knative/kn-plugin-func v1.1.3-0.20220413141425-a3b388f3a2d8/go.mod h1:DrRHVdD9Zj7hleSrzSYz01KjNijG+xVbjqOsrkA8v0M= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= diff --git a/vendor/knative.dev/kn-plugin-event/pkg/cli/ics/constants.go b/vendor/knative.dev/kn-plugin-event/pkg/cli/ics/constants.go deleted file mode 100644 index 2daec77e7e..0000000000 --- a/vendor/knative.dev/kn-plugin-event/pkg/cli/ics/constants.go +++ /dev/null @@ -1,5 +0,0 @@ -package ics - -// ContainerBasename holds a OCI container base name. -// TODO: set value from .env file during the build. -var ContainerBasename = "quay.io/cardil" //nolint:gochecknoglobals diff --git a/vendor/knative.dev/kn-plugin-event/pkg/sender/in_cluster.go b/vendor/knative.dev/kn-plugin-event/pkg/sender/in_cluster.go index 811dff44f8..3647da0325 100644 --- a/vendor/knative.dev/kn-plugin-event/pkg/sender/in_cluster.go +++ b/vendor/knative.dev/kn-plugin-event/pkg/sender/in_cluster.go @@ -2,7 +2,6 @@ package sender import ( "fmt" - "regexp" cloudevents "github.com/cloudevents/sdk-go/v2" batchv1 "k8s.io/api/batch/v1" @@ -11,6 +10,7 @@ import ( "knative.dev/kn-plugin-event/pkg/cli/ics" "knative.dev/kn-plugin-event/pkg/event" "knative.dev/kn-plugin-event/pkg/k8s" + "knative.dev/kn-plugin-event/pkg/metadata" ) type inClusterSender struct { @@ -44,7 +44,7 @@ func (i *inClusterSender) Send(ce cloudevents.Event) error { RestartPolicy: corev1.RestartPolicyNever, Containers: []corev1.Container{{ Name: "kn-event-sender", - Image: imageFor("kn-event-sender"), + Image: metadata.ResolveImage(), Env: []corev1.EnvVar{{ Name: "K_SINK", Value: url.String(), @@ -63,12 +63,3 @@ func (i *inClusterSender) Send(ce cloudevents.Event) error { } return nil } - -func imageFor(artifact string) string { - basename := ics.ContainerBasename - r := regexp.MustCompile(".+[A-Za-z0-9]$") - if r.MatchString(basename) { - basename += "/" - } - return basename + artifact -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 64384cbe9a..061f6f25c2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1585,7 +1585,7 @@ knative.dev/eventing-kafka/pkg/common/constants # knative.dev/hack v0.0.0-20220128200847-51a42b2eb63e ## explicit knative.dev/hack -# knative.dev/kn-plugin-event v1.1.1 => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220331134246-2c22e325c977 +# knative.dev/kn-plugin-event v1.1.1 => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220412125940-01b7cf265a69 ## explicit knative.dev/kn-plugin-event/internal/cli/cmd knative.dev/kn-plugin-event/pkg/cli @@ -1830,5 +1830,5 @@ sigs.k8s.io/yaml # k8s.io/apimachinery => k8s.io/apimachinery v0.21.4 # k8s.io/client-go => k8s.io/client-go v0.21.4 # k8s.io/code-generator => k8s.io/code-generator v0.21.4 -# knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220331134246-2c22e325c977 +# knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.27.1-0.20220412125940-01b7cf265a69 # knative.dev/kn-plugin-func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20220413141425-a3b388f3a2d8