Skip to content

Commit

Permalink
upgrade to latest dependencies (#214)
Browse files Browse the repository at this point in the history
bumping knative.dev/serving dbd3fc3...374b282:
  > 374b282 Update community files (# 13240)
  > 7315b02 Update net-kourier nightly (# 13236)
  > 2a72beb upgrade to latest dependencies (# 13238)
  > 765a052 Update net-certmanager nightly (# 13234)
  > ea5c535 stop the queue-proxy drain if we don't receive a TERM signal (# 13229)
  > 8d0281e Update net-istio nightly (# 13222)
  > d60e5e7 upgrade to latest dependencies (# 13227)
  > d89869e Properly shutdown tracer when the work is done (# 13226)
  > b3a7557 Update net-contour nightly (# 13225)
  > 358d04e Update net-certmanager nightly (# 13224)
  > b48e0e5 Update net-kourier nightly (# 13223)
bumping knative.dev/eventing ab981d6...cc06bab:
  > cc06bab Update community files (# 6492)
  > 0060ddd upgrade to latest dependencies (# 6491)
  > 5ee6158 Make sure tracer is shut down across components (# 6474)
  > 091ee6e Remove deprecated functions from test/upgrade package (# 6489)
  > 6eb4c78 upgrade to latest dependencies (# 6487)
  > cb3901f Increase max namespace count for e2e test runner (# 6486)
  > 1d00055 upgrade to latest dependencies (# 6485)
bumping knative.dev/pkg f78a006...4a03844:
  > 4a03844 fix double close of channel (# 2575)
bumping knative.dev/client a4a1163...76b3724:
  > 76b3724 Update community files (# 1726)
bumping knative.dev/reconciler-test 93a1083...177f826:
  > 177f826 upgrade to latest dependencies (# 377)
bumping knative.dev/networking 50ab590...e51df7c:
  > e51df7c upgrade to latest dependencies (# 703)
  > cb90216 upgrade to latest dependencies (# 702)

Signed-off-by: Knative Automation <[email protected]>

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Aug 23, 2022
1 parent 87224ca commit 55ced6c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 54 deletions.
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ require (
k8s.io/api v0.23.9
k8s.io/apimachinery v0.23.9
k8s.io/client-go v0.23.9
knative.dev/client v0.33.1-0.20220816071248-a4a11637a7cf
knative.dev/eventing v0.33.1-0.20220815185049-ab981d6bba92
knative.dev/client v0.33.1-0.20220823015118-76b3724af434
knative.dev/eventing v0.33.1-0.20220823013718-cc06bab0313c
knative.dev/hack v0.0.0-20220815132133-e9a8475f4329
knative.dev/pkg v0.0.0-20220816153547-f78a00694307
knative.dev/reconciler-test v0.0.0-20220816163747-93a10831a971
knative.dev/serving v0.33.1-0.20220816195748-dbd3fc35fded
knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15
knative.dev/reconciler-test v0.0.0-20220818122349-177f8264c28c
knative.dev/serving v0.33.1-0.20220823022717-374b28298920
sigs.k8s.io/yaml v1.3.0
)

Expand Down Expand Up @@ -167,7 +167,7 @@ require (
k8s.io/klog/v2 v2.70.2-0.20220707122935-0990e81f1a8f // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
knative.dev/networking v0.0.0-20220815134434-50ab5901247f // indirect
knative.dev/networking v0.0.0-20220818010248-e51df7cdf571 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/kind v0.11.1 // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2225,20 +2225,20 @@ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/client v0.33.1-0.20220816071248-a4a11637a7cf h1:o6H3knoWCIPYOELrjcxeRfyVK/y4IsbWPUGamMICqfU=
knative.dev/client v0.33.1-0.20220816071248-a4a11637a7cf/go.mod h1:vlYByv5VrV6KVprBOxINp/UYCTSnfKcNPEAMKFLYo9w=
knative.dev/eventing v0.33.1-0.20220815185049-ab981d6bba92 h1:AYvqSqSuoZXirP89uJgyejMdae7m0k9ONSB/wYB5jaE=
knative.dev/eventing v0.33.1-0.20220815185049-ab981d6bba92/go.mod h1:5Ip0LF/FmqQtOvSv8ycQxhOJhjxnowtMOuCv0ri8xWk=
knative.dev/client v0.33.1-0.20220823015118-76b3724af434 h1:lVURhA7ubHydvUofxHe4yZEOoy1xuon3MVMjVx2Wpxo=
knative.dev/client v0.33.1-0.20220823015118-76b3724af434/go.mod h1:vlYByv5VrV6KVprBOxINp/UYCTSnfKcNPEAMKFLYo9w=
knative.dev/eventing v0.33.1-0.20220823013718-cc06bab0313c h1:12m/C9vGPG43Sfc80jheJ/c66lMUWrjGuPnmWya5kd8=
knative.dev/eventing v0.33.1-0.20220823013718-cc06bab0313c/go.mod h1:oHUjUje7yVmF9FqdMe1dfddowxve8pNrNG0YZ+JkIPo=
knative.dev/hack v0.0.0-20220815132133-e9a8475f4329 h1:/X969GuiLDMgb+tyx5qZDLxGhENkS3OLPj/VCSW+Ul0=
knative.dev/hack v0.0.0-20220815132133-e9a8475f4329/go.mod h1:t/azP8I/Cygaw+87O7rkAPrNRjCelmtfSzWzu/9TM7I=
knative.dev/networking v0.0.0-20220815134434-50ab5901247f h1:7Huzbeu2IV06ne1MJsRx1OSU6qFQXRgFsPbxoPaKfOA=
knative.dev/networking v0.0.0-20220815134434-50ab5901247f/go.mod h1:wwhZW0N+qYb81ZsgDI/yxS1dwN+hoi++m01ft+HxG08=
knative.dev/pkg v0.0.0-20220816153547-f78a00694307 h1:CNf+DsnFydG4cr/PW+ucP7/9dZtdGOfzvgRZPJfL/Xc=
knative.dev/pkg v0.0.0-20220816153547-f78a00694307/go.mod h1:YLjXbkQLlGHok+u0FLfMbBHFzY9WGu3GHhnrptoAy8I=
knative.dev/reconciler-test v0.0.0-20220816163747-93a10831a971 h1:ShhVNhRaV1NNm1kGl3wYclzapbLtBYqJJkajaa1/XPU=
knative.dev/reconciler-test v0.0.0-20220816163747-93a10831a971/go.mod h1:YQhGT2cxDyHMbVniFDDt7/Oq/6vgOEYh5Utnh/kmavY=
knative.dev/serving v0.33.1-0.20220816195748-dbd3fc35fded h1:DxajOFhwtHl4q+dttrVKOz9ED5wdM83b6AH400lCp04=
knative.dev/serving v0.33.1-0.20220816195748-dbd3fc35fded/go.mod h1:f41oVTPm+sKyDmZSuJlDhvMbIG/B/ds0aun4yXSmOE4=
knative.dev/networking v0.0.0-20220818010248-e51df7cdf571 h1:Lu/TsJjxg1p+2CMr2LNHEdEFBNHYjDoZv2f1QZoM8jg=
knative.dev/networking v0.0.0-20220818010248-e51df7cdf571/go.mod h1:m3ataWRwmbHjOY9sCFvcDWRNLVITxVl0fH0RxdCa4jE=
knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15 h1:GNmzHVaUo3zoi/wtIN71LPQaWy6DdoYzmb+GIq2s4fw=
knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15/go.mod h1:YLjXbkQLlGHok+u0FLfMbBHFzY9WGu3GHhnrptoAy8I=
knative.dev/reconciler-test v0.0.0-20220818122349-177f8264c28c h1:wWtcZ1ZyP+mXx4xQmcKzKyXkk/t07/iSq/jqhqxoyCM=
knative.dev/reconciler-test v0.0.0-20220818122349-177f8264c28c/go.mod h1:A437yxlDVDVKQv779WlB9Nj9lWAMoOKHQXFXls24Sps=
knative.dev/serving v0.33.1-0.20220823022717-374b28298920 h1:P/GtA2eEM7H+RaYjY5Z2KeQDLoR1KVOn07mRha+9YMw=
knative.dev/serving v0.33.1-0.20220823022717-374b28298920/go.mod h1:nLRb1kIf3GMZsGrdYZplaSOERyca/djmXGc3NIowpNw=
mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ var instance forwarder.Forwarder
func main() {
instance = forwarder.New()
instance.Forward()
forwarder.Shutdown()
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ limitations under the License.
package config

import (
"context"

"go.uber.org/zap"
"knative.dev/pkg/tracing"
tracingconfig "knative.dev/pkg/tracing/config"
)

var tracer tracing.Tracer

func SetupTracing() {
config, err := tracingconfig.JSONToTracingConfig(Instance.TracingConfig)
if err != nil {
Log.Warn("Tracing configuration is invalid, using the no-op default", zap.Error(err))
}
if err = tracing.SetupStaticPublishing(Log, "", config); err != nil {
if tracer, err = tracing.SetupPublishingWithStaticConfig(Log, "", config); err != nil {
Log.Fatal("Error setting up trace publishing", zap.Error(err))
}
}

func ShutdownTracing() {
if tracer != nil {
if err := tracer.Shutdown(context.Background()); err != nil {
Log.Warn("Failed to shutdown tracing")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func New() Forwarder {
return f
}

func Shutdown() {
config.ShutdownTracing()
}

func (f *forwarder) Forward() {
port := config.Instance.Forwarder.Port
client.Receive(port, Canceling, f.forwardEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func New() Sender {
}
}

func Shutdown() {
config.ShutdownTracing()
}

// NewEventID creates new event ID
func NewEventID() string {
return randString(16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ var (
"supported by any registered event sender")
log = config.Log
senderConfig = &config.Instance.Sender
eventSenders = make([]EventSender, 0, 1)
eventSendersWithContext = make([]EventSenderWithContext, 0, 1)
)

Expand All @@ -65,9 +64,6 @@ func (s *sender) SendContinually() {
var shutdownCh = make(chan struct{})
defer func() {
s.sendFinished()
// Give time to send tracing information.
// https://github.com/knative/pkg/issues/2475
time.Sleep(5 * time.Second)
}()

go func() {
Expand Down Expand Up @@ -143,16 +139,9 @@ func NewCloudEvent(data interface{}, typ string) cloudevents.Event {

// ResetEventSenders will reset configured event senders to defaults.
func ResetEventSenders() {
eventSenders = make([]EventSender, 0, 1)
eventSendersWithContext = make([]EventSenderWithContext, 0, 1)
}

// RegisterEventSender will register a EventSender to be used.
// Deprecated. Use RegisterEventSenderWithContext.
func RegisterEventSender(es EventSender) {
eventSenders = append(eventSenders, es)
}

// RegisterEventSenderWithContext will register EventSenderWithContext to be used.
func RegisterEventSenderWithContext(es EventSenderWithContext) {
eventSendersWithContext = append(eventSendersWithContext, es)
Expand All @@ -162,23 +151,14 @@ func RegisterEventSenderWithContext(es EventSenderWithContext) {
func SendEvent(ctx context.Context, ce cloudevents.Event, endpoint interface{}) error {
sendersWithCtx := make([]EventSenderWithContext, 0, len(eventSendersWithContext)+1)
sendersWithCtx = append(sendersWithCtx, eventSendersWithContext...)
if len(eventSendersWithContext) == 0 && len(eventSenders) == 0 {
if len(eventSendersWithContext) == 0 {
sendersWithCtx = append(sendersWithCtx, httpSender{})
}
for _, eventSender := range sendersWithCtx {
if eventSender.Supports(endpoint) {
return eventSender.SendEventWithContext(ctx, ce, endpoint)
}
}
// Backwards compatibility.
// TODO: Remove when downstream repositories start using EventSenderWithContext.
senders := make([]EventSender, 0, len(eventSenders)+1)
senders = append(senders, eventSenders...)
for _, eventSender := range senders {
if eventSender.Supports(endpoint) {
return eventSender.SendEvent(ce, endpoint)
}
}
return fmt.Errorf("%w: endpoint is %#v", ErrEndpointTypeNotSupported, endpoint)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ type EndpointSupporter interface {
Supports(endpoint interface{}) bool
}

// EventSender will be used to send events to configured endpoint.
// Deprecated. Use EventSenderWithContext.
type EventSender interface {
EndpointSupporter
// SendEvent will send event to given endpoint.
SendEvent(ce cloudevents.Event, endpoint interface{}) error
}

// EventSenderWithContext will be used to send events to configured endpoint, passing a context.
type EventSenderWithContext interface {
EndpointSupporter
Expand Down
12 changes: 6 additions & 6 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ k8s.io/utils/internal/third_party/forked/golang/net
k8s.io/utils/lru
k8s.io/utils/net
k8s.io/utils/trace
# knative.dev/client v0.33.1-0.20220816071248-a4a11637a7cf
# knative.dev/client v0.33.1-0.20220823015118-76b3724af434
## explicit; go 1.18
knative.dev/client/lib/test
knative.dev/client/pkg/apis/client
Expand All @@ -1266,7 +1266,7 @@ knative.dev/client/pkg/serving/v1
knative.dev/client/pkg/util
knative.dev/client/pkg/util/mock
knative.dev/client/pkg/wait
# knative.dev/eventing v0.33.1-0.20220815185049-ab981d6bba92
# knative.dev/eventing v0.33.1-0.20220823013718-cc06bab0313c
## explicit; go 1.18
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck
Expand Down Expand Up @@ -1308,7 +1308,7 @@ knative.dev/eventing/test/upgrade/prober/wathola/sender
# knative.dev/hack v0.0.0-20220815132133-e9a8475f4329
## explicit; go 1.17
knative.dev/hack
# knative.dev/networking v0.0.0-20220815134434-50ab5901247f
# knative.dev/networking v0.0.0-20220818010248-e51df7cdf571
## explicit; go 1.18
knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking
Expand All @@ -1320,7 +1320,7 @@ knative.dev/networking/pkg/http/probe
knative.dev/networking/pkg/http/proxy
knative.dev/networking/pkg/http/stats
knative.dev/networking/pkg/k8s
# knative.dev/pkg v0.0.0-20220816153547-f78a00694307
# knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15
## explicit; go 1.18
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down Expand Up @@ -1366,7 +1366,7 @@ knative.dev/pkg/tracing/config
knative.dev/pkg/tracing/propagation
knative.dev/pkg/tracing/propagation/tracecontextb3
knative.dev/pkg/tracker
# knative.dev/reconciler-test v0.0.0-20220816163747-93a10831a971
# knative.dev/reconciler-test v0.0.0-20220818122349-177f8264c28c
## explicit; go 1.18
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand All @@ -1389,7 +1389,7 @@ knative.dev/reconciler-test/pkg/manifest
knative.dev/reconciler-test/pkg/milestone
knative.dev/reconciler-test/pkg/state
knative.dev/reconciler-test/resources/svc
# knative.dev/serving v0.33.1-0.20220816195748-dbd3fc35fded
# knative.dev/serving v0.33.1-0.20220823022717-374b28298920
## explicit; go 1.18
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
Expand Down

0 comments on commit 55ced6c

Please sign in to comment.