Skip to content

Commit

Permalink
upgrade to latest dependencies (#901)
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing 6eb4c78...5ee6158:
  > 5ee6158 Make sure tracer is shut down across components (# 6474)
  > 091ee6e Remove deprecated functions from test/upgrade package (# 6489)

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

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Aug 22, 2022
1 parent 07cf4e3 commit 6d2e8ae
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
k8s.io/client-go v0.23.9
k8s.io/code-generator v0.23.9
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65
knative.dev/eventing v0.33.1-0.20220818050948-6eb4c785ae43
knative.dev/eventing v0.33.1-0.20220822135655-5ee615866b28
knative.dev/hack v0.0.0-20220815132133-e9a8475f4329
knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15
knative.dev/reconciler-test v0.0.0-20220818122349-177f8264c28c
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,8 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/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/eventing v0.33.1-0.20220818050948-6eb4c785ae43 h1:6xgvRnCdMSCfgE3xufQ5hBFmvSIij0bwPiHauLqR56k=
knative.dev/eventing v0.33.1-0.20220818050948-6eb4c785ae43/go.mod h1:+kn5/HpGP1fXAai69THMxfkm7L33Z19pcyUWOpWZi2Y=
knative.dev/eventing v0.33.1-0.20220822135655-5ee615866b28 h1:nupMPxXvdrpahgnp9LnU12Przw4u6rGc0pzCsDDSjX4=
knative.dev/eventing v0.33.1-0.20220822135655-5ee615866b28/go.mod h1:+kn5/HpGP1fXAai69THMxfkm7L33Z19pcyUWOpWZi2Y=
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/pkg v0.0.0-20220818004048-4a03844c0b15 h1:GNmzHVaUo3zoi/wtIN71LPQaWy6DdoYzmb+GIq2s4fw=
Expand Down
6 changes: 3 additions & 3 deletions vendor/knative.dev/eventing/pkg/adapter/v2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type EnvConfigAccessor interface {
// Get the parsed logger.
GetLogger() *zap.SugaredLogger

SetupTracing(*zap.SugaredLogger) error
SetupTracing(*zap.SugaredLogger) (tracing.Tracer, error)

GetCloudEventOverrides() (*duckv1.CloudEventOverrides, error)

Expand Down Expand Up @@ -179,12 +179,12 @@ func (e *EnvConfig) GetSinktimeout() int {
return -1
}

func (e *EnvConfig) SetupTracing(logger *zap.SugaredLogger) error {
func (e *EnvConfig) SetupTracing(logger *zap.SugaredLogger) (tracing.Tracer, error) {
config, err := tracingconfig.JSONToTracingConfig(e.TracingConfigJson)
if err != nil {
logger.Warn("Tracing configuration is invalid, using the no-op default", zap.Error(err))
}
return tracing.SetupStaticPublishing(logger, "", config)
return tracing.SetupPublishingWithStaticConfig(logger, "", config)
}

func (e *EnvConfig) GetCloudEventOverrides() (*duckv1.CloudEventOverrides, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,18 @@ func NewTracingConfiguratorFromConfigMap(opts ...TracingConfiguratorFromConfigMa

// SetupTracing based on the component's ConfigMap.
// A Watcher is set to update the configuration dynamically.
func (c *tracingConfiguratorFromConfigMap) SetupTracing(ctx context.Context, cfg *TracingConfiguration) {
func (c *tracingConfiguratorFromConfigMap) SetupTracing(ctx context.Context, cfg *TracingConfiguration) tracing.Tracer {
logger := logging.FromContext(ctx)

cmw := ConfigWatcherFromContext(ctx)
service := fmt.Sprintf("%s.%s", cfg.InstanceName, NamespaceFromContext(ctx))

logger.Infof("Adding Watcher on ConfigMap %s for tracing", c.configMapName)
if err := tracing.SetupDynamicPublishing(logger, cmw, service, c.configMapName); err != nil {
tracer, err := tracing.SetupPublishingWithDynamicConfig(logger, cmw, service, c.configMapName)
if err != nil {
logger.Errorw("Error setting up trace publishing. Tracing configuration will be ignored.", zap.Error(err))
}
return tracer
}

// cloudEventsStatusReporterConfiguratorFromConfigMap dynamically configures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/http"

"go.uber.org/zap"
"knative.dev/pkg/tracing"

"knative.dev/pkg/logging"
"knative.dev/pkg/metrics"
Expand Down Expand Up @@ -90,13 +91,15 @@ func NewTracingConfiguratorFromEnvironment(env EnvConfigAccessor) TracingConfigu
}

// SetupTracing based on environment variables.
func (c *tracingConfiguratorFromEnvironment) SetupTracing(ctx context.Context, _ *TracingConfiguration) {
func (c *tracingConfiguratorFromEnvironment) SetupTracing(ctx context.Context, _ *TracingConfiguration) tracing.Tracer {
logger := logging.FromContext(ctx)
if err := c.env.SetupTracing(logger); err != nil {
tracer, err := c.env.SetupTracing(logger)
if err != nil {
// If tracing doesn't work, we will log an error, but allow the adapter
// to continue to start.
logger.Errorw("Error setting up trace publishing", zap.Error(err))
}
return tracer
}

// cloudEventsStatusReporterConfiguratorFromEnvironment configures
Expand Down
6 changes: 4 additions & 2 deletions vendor/knative.dev/eventing/pkg/adapter/v2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/kelseyhightower/envconfig"
"go.uber.org/zap"
"knative.dev/pkg/tracing"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -79,7 +80,7 @@ type TracingConfiguration struct {

// TracingConfigurator configures the tracing settings for an adapter.
type TracingConfigurator interface {
SetupTracing(ctx context.Context, cfg *TracingConfiguration)
SetupTracing(ctx context.Context, cfg *TracingConfiguration) tracing.Tracer
}

// ObservabilityConfigurator groups the observability related methods
Expand Down Expand Up @@ -203,7 +204,8 @@ func MainWithInformers(ctx context.Context, component string, env EnvConfigAcces
}()
}

configurator.SetupTracing(ctx, &TracingConfiguration{InstanceName: env.GetName()})
tracer := configurator.SetupTracing(ctx, &TracingConfiguration{InstanceName: env.GetName()})
defer tracer.Shutdown(context.Background())

crStatusEventClient := configurator.CreateCloudEventsStatusReporter(ctx)

Expand Down
4 changes: 3 additions & 1 deletion vendor/knative.dev/eventing/pkg/adapter/v2/main_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ func MainMessageAdapterWithContext(ctx context.Context, component string, ector
}

// Retrieve tracing config
if err := env.SetupTracing(logger); err != nil {
tracer, err := env.SetupTracing(logger)
if err != nil {
// If tracing doesn't work, we will log an error, but allow the adapter
// to continue to start.
logger.Error("Error setting up trace publishing", zap.Error(err))
}
defer tracer.Shutdown(context.Background())

httpBindingsSender, err := kncloudevents.NewHTTPMessageSenderWithTarget(env.GetSink())
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
cehttp "github.com/cloudevents/sdk-go/v2/protocol/http"
"go.opencensus.io/plugin/ochttp"
"go.uber.org/zap"
"knative.dev/pkg/tracing"
"knative.dev/pkg/tracing/propagation/tracecontextb3"

"knative.dev/eventing/test/lib/sender"
Expand Down Expand Up @@ -111,12 +112,14 @@ func main() {
}

var c cloudevents.Client
var tracer tracing.Tracer
if addTracing {
log.Println("Adding tracing")
logger, _ := zap.NewDevelopment()
if err := test_images.ConfigureTracing(logger.Sugar(), ""); err != nil {
if tracer, err = test_images.ConfigureTracing(logger.Sugar(), ""); err != nil {
log.Fatalf("Unable to setup trace publishing: %v", err)
}
defer tracer.Shutdown(context.Background())
c, err = cloudevents.NewClient(t, client.WithObservabilityService(obsclient.New()))
} else {
c, err = cloudevents.NewClient(t)
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/eventing/test/test_images/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ const (
)

// ConfigureTracing can be used in test-images to configure tracing.
func ConfigureTracing(logger *zap.SugaredLogger, serviceName string) error {
func ConfigureTracing(logger *zap.SugaredLogger, serviceName string) (tracing.Tracer, error) {
tracingEnv := os.Getenv(ConfigTracingEnv)
conf, err := config.JSONToTracingConfig(tracingEnv)
if err != nil {
logger.Warn("Error while trying to read the tracing config, using NoopConfig: ", err)
}
return tracing.SetupStaticPublishing(logger, serviceName, conf)
return tracing.SetupPublishingWithStaticConfig(logger, serviceName, conf)
}

// ConfigureLogging can be used in test-images to configure logging.
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ k8s.io/utils/internal/third_party/forked/golang/net
k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/eventing v0.33.1-0.20220818050948-6eb4c785ae43
# knative.dev/eventing v0.33.1-0.20220822135655-5ee615866b28
## explicit; go 1.18
knative.dev/eventing/pkg/adapter/v2
knative.dev/eventing/pkg/adapter/v2/util/crstatusevent
Expand Down

0 comments on commit 6d2e8ae

Please sign in to comment.