From bf869fda93084e4b1c87a1703a0cf519a90b2346 Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Fri, 29 Sep 2023 13:17:08 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/pkg 0f52db7...6cf4b05: > 6cf4b05 upgrade to latest dependencies (# 2841) bumping knative.dev/reconciler-test 4b73d83...1bc30a7: > 1bc30a7 Update community files (# 584) > 922b219 Call the quit when the eventshub is closed (# 591) Signed-off-by: Knative Automation --- go.mod | 4 +- go.sum | 8 ++-- .../pkg/eventshub/eventshub.go | 6 ++- .../pkg/eventshub/istio_quit.go | 38 +++++++++++++++++++ vendor/modules.txt | 4 +- 5 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 vendor/knative.dev/reconciler-test/pkg/eventshub/istio_quit.go diff --git a/go.mod b/go.mod index 53ad025c58f..aff0f479e92 100644 --- a/go.mod +++ b/go.mod @@ -46,8 +46,8 @@ require ( k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263 knative.dev/hack/schema v0.0.0-20230926181829-f2f9b6f91263 - knative.dev/pkg v0.0.0-20230926133247-0f52db700d63 - knative.dev/reconciler-test v0.0.0-20230920080213-4b73d83f40fc + knative.dev/pkg v0.0.0-20230927121431-6cf4b051de4f + knative.dev/reconciler-test v0.0.0-20230928130937-1bc30a77ad78 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index dc76baaba31..cf7731a5e4c 100644 --- a/go.sum +++ b/go.sum @@ -848,10 +848,10 @@ knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263 h1:e6r9J1YopzSh6tDCpyKhVBfRU knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/hack/schema v0.0.0-20230926181829-f2f9b6f91263 h1:STkde45JVGJdrrhEBudTxd2R4mY2fKqwlMtkkSxCV8g= knative.dev/hack/schema v0.0.0-20230926181829-f2f9b6f91263/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0= -knative.dev/pkg v0.0.0-20230926133247-0f52db700d63 h1:L0O5LRuKFkdwuR+MrDLGjrXgaQv9+7xse+kC7EboshI= -knative.dev/pkg v0.0.0-20230926133247-0f52db700d63/go.mod h1:NzXHwtuwTWXyMD1KbL2ONwLk8cLROLYTtujCTTG7xQs= -knative.dev/reconciler-test v0.0.0-20230920080213-4b73d83f40fc h1:2pGUphOyniBD5nhJ/Xt6a72owZLZEpAfR3NXcTEGIu8= -knative.dev/reconciler-test v0.0.0-20230920080213-4b73d83f40fc/go.mod h1:i+/PWK/n3HPgjXMoj5U7CA6WRW/C3c3EfHCQ0FmrhNM= +knative.dev/pkg v0.0.0-20230927121431-6cf4b051de4f h1:+J5spRfGrMzQguNXkJlnyUK8yHoYtakUn6d1Z6Ulm/c= +knative.dev/pkg v0.0.0-20230927121431-6cf4b051de4f/go.mod h1:h2O9k9WkB10sVeYUHqywUJNN88y4jZMmu9nFwemwKAE= +knative.dev/reconciler-test v0.0.0-20230928130937-1bc30a77ad78 h1:1/VFdHjSG0J1WYu9/TzqIjR5a6igrP8pSDBnMdKQxZ8= +knative.dev/reconciler-test v0.0.0-20230928130937-1bc30a77ad78/go.mod h1:i+/PWK/n3HPgjXMoj5U7CA6WRW/C3c3EfHCQ0FmrhNM= pgregory.net/rapid v1.0.0 h1:iQaM2w5PZ6xvt6x7hbd7tiDS+nk7YPp5uCaEba+T/F4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/vendor/knative.dev/reconciler-test/pkg/eventshub/eventshub.go b/vendor/knative.dev/reconciler-test/pkg/eventshub/eventshub.go index fab7948b075..512552b8e14 100644 --- a/vendor/knative.dev/reconciler-test/pkg/eventshub/eventshub.go +++ b/vendor/knative.dev/reconciler-test/pkg/eventshub/eventshub.go @@ -23,6 +23,7 @@ import ( "golang.org/x/sync/errgroup" "knative.dev/pkg/injection" "knative.dev/pkg/logging" + "knative.dev/pkg/signals" ) type envConfig struct { @@ -39,8 +40,9 @@ type EventGeneratorStarter func(context.Context, *EventLogs) error // Start starts a new eventshub process, with the provided factories. // You can create your own eventshub providing event log factories and event generator factories. func Start(eventLogFactories map[string]EventLogFactory, eventGeneratorFactories map[string]EventGeneratorStarter) { - //nolint // nil ctx is fine here, look at the code of EnableInjectionOrDie - ctx, _ := injection.EnableInjectionOrDie(nil, nil) + ctx := signals.NewContext() + defer maybeQuitIstioProxy(ctx) // quit at exit + ctx, _ = injection.EnableInjectionOrDie(ctx, nil) ctx = ConfigureLogging(ctx, "eventshub") tracer, err := ConfigureTracing(logging.FromContext(ctx), "") diff --git a/vendor/knative.dev/reconciler-test/pkg/eventshub/istio_quit.go b/vendor/knative.dev/reconciler-test/pkg/eventshub/istio_quit.go new file mode 100644 index 00000000000..6a16defb836 --- /dev/null +++ b/vendor/knative.dev/reconciler-test/pkg/eventshub/istio_quit.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package eventshub + +import ( + "context" + "errors" + "net/http" + "syscall" + + "knative.dev/pkg/logging" +) + +// maybeQuitIstioProxy shuts down Istio's proxy when available. +func maybeQuitIstioProxy(ctx context.Context) { + log := logging.FromContext(ctx) + req, _ := http.NewRequest(http.MethodPost, "http://localhost:15020/quitquitquit", nil) + + _, err := http.DefaultClient.Do(req) + + if err != nil && !errors.Is(err, syscall.ECONNREFUSED) { + log.Warn("Ignore this warning if Istio proxy is not used on this pod", err) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 31cff907cc7..7913c722866 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1186,7 +1186,7 @@ knative.dev/hack/schema/commands knative.dev/hack/schema/docs knative.dev/hack/schema/registry knative.dev/hack/schema/schema -# knative.dev/pkg v0.0.0-20230926133247-0f52db700d63 +# knative.dev/pkg v0.0.0-20230927121431-6cf4b051de4f ## explicit; go 1.18 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate @@ -1324,7 +1324,7 @@ knative.dev/pkg/webhook/resourcesemantics knative.dev/pkg/webhook/resourcesemantics/conversion knative.dev/pkg/webhook/resourcesemantics/defaulting knative.dev/pkg/webhook/resourcesemantics/validation -# knative.dev/reconciler-test v0.0.0-20230920080213-4b73d83f40fc +# knative.dev/reconciler-test v0.0.0-20230928130937-1bc30a77ad78 ## explicit; go 1.18 knative.dev/reconciler-test/cmd/eventshub knative.dev/reconciler-test/pkg/environment