From 7a6346c9952914a6d6479c6f4fe4bd04802e33ce Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Wed, 9 Oct 2019 12:19:40 -0400 Subject: [PATCH 1/3] Cleanup receice adapter main code. --- cmd/apiserver_receive_adapter/main.go | 80 +++++++++----------- cmd/cronjob_receive_adapter/main.go | 49 +++++-------- pkg/adapter/config.go | 37 ++++++++++ pkg/adapter/cronjobevents/adapter.go | 26 +------ pkg/adapter/cronjobevents/adapter_test.go | 89 ++++++++--------------- 5 files changed, 123 insertions(+), 158 deletions(-) create mode 100644 pkg/adapter/config.go diff --git a/cmd/apiserver_receive_adapter/main.go b/cmd/apiserver_receive_adapter/main.go index 1e2c2bbd558..53244caddb2 100644 --- a/cmd/apiserver_receive_adapter/main.go +++ b/cmd/apiserver_receive_adapter/main.go @@ -17,10 +17,8 @@ limitations under the License. package main import ( - "context" "flag" "fmt" - "log" "strings" "time" @@ -34,17 +32,15 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/clientcmd" - "knative.dev/eventing/pkg/adapter/apiserver" - "knative.dev/eventing/pkg/kncloudevents" - "knative.dev/eventing/pkg/tracing" "knative.dev/pkg/logging" "knative.dev/pkg/metrics" "knative.dev/pkg/signals" "knative.dev/pkg/source" -) -const ( - component = "apiserversource" + "knative.dev/eventing/pkg/adapter" + "knative.dev/eventing/pkg/adapter/apiserver" + "knative.dev/eventing/pkg/kncloudevents" + "knative.dev/eventing/pkg/tracing" ) var ( @@ -63,9 +59,9 @@ func (s *StringList) Decode(value string) error { } type envConfig struct { - Namespace string `envconfig:"SYSTEM_NAMESPACE" default:"default"` + adapter.EnvConfig + Mode string `envconfig:"MODE"` - SinkURI string `split_words:"true" required:"true"` ApiVersion StringList `split_words:"true" required:"true"` Kind StringList `required:"true"` Controller []bool `required:"true"` @@ -73,36 +69,23 @@ type envConfig struct { OwnerApiVersion StringList `envconfig:"OWNER_API_VERSION" required:"true"` OwnerKind StringList `envconfig:"OWNER_KIND" required:"true"` Name string `envconfig:"NAME" required:"true"` - // MetricsConfigJson is a json string of metrics.ExporterOptions. - // This is used to configure the metrics exporter options, - // the config is stored in a config map inside the controllers - // namespace and copied here. - MetricsConfigJson string `envconfig:"K_METRICS_CONFIG" required:"true"` - - // LoggingConfigJson is a json string of logging.Config. - // This is used to configure the logging config, the config is stored in - // a config map inside the controllers namespace and copied here. - LoggingConfigJson string `envconfig:"K_LOGGING_CONFIG" required:"true"` } -// TODO: the controller should take the list of GVR +const ( + component = "apiserversource" +) func main() { flag.Parse() + ctx := signals.NewContext() + var env envConfig err := envconfig.Process("", &env) if err != nil { panic(fmt.Sprintf("Error processing env var: %s", err)) } - // Report stats on Go memory usage every 30 seconds. - msp := metrics.NewMemStatsAll() - msp.Start(context.Background(), 30*time.Second) - if err := view.Register(msp.DefaultViews()...); err != nil { - log.Fatalf("Error exporting go memstats view: %v", err) - } - // Convert json logging.Config to logging.Config. loggingConfig, err := logging.JsonToLoggingConfig(env.LoggingConfigJson) if err != nil { @@ -116,6 +99,14 @@ func main() { loggerSugared, _ := logging.NewLoggerFromConfig(loggingConfig, component) logger := loggerSugared.Desugar() defer flush(loggerSugared) + ctx = logging.WithLogger(ctx, loggerSugared) + + // Report stats on Go memory usage every 30 seconds. + msp := metrics.NewMemStatsAll() + msp.Start(ctx, 30*time.Second) + if err := view.Register(msp.DefaultViews()...); err != nil { + logger.Fatal("Error exporting go memstats view: %v", zap.Error(err)) + } // Convert json metrics.ExporterOptions to metrics.ExporterOptions. metricsConfig, err := metrics.JsonToMetricsOptions(env.MetricsConfigJson) @@ -132,31 +123,29 @@ func main() { logger.Error("error building statsreporter", zap.Error(err)) } - // set up signals so we handle the first shutdown signal gracefully - stopCh := signals.SetupSignalHandler() + if err = tracing.SetupStaticPublishing(loggerSugared, "", tracing.OnePercentSampling); 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)) + } + + eventsClient, err := kncloudevents.NewDefaultClient(env.SinkURI) + if err != nil { + logger.Fatal("error building cloud event client", zap.Error(err)) + } + + // Configuring the adapter cfg, err := clientcmd.BuildConfigFromFlags(*masterURL, *kubeconfig) if err != nil { logger.Fatal("error building kubeconfig", zap.Error(err)) } - logger.Info("Starting the controller") client, err := dynamic.NewForConfig(cfg) if err != nil { logger.Fatal("error building dynamic client", zap.Error(err)) } - if err = tracing.SetupStaticPublishing(loggerSugared, "", tracing.OnePercentSampling); err != nil { - // If tracing doesn't work, we will log an error, but allow the source - // to continue to start. - logger.Error("Error setting up trace publishing", zap.Error(err)) - } - - eventsClient, err := kncloudevents.NewDefaultClient(env.SinkURI) - if err != nil { - logger.Fatal("error building cloud event client", zap.Error(err)) - } - gvrcs := []apiserver.GVRC(nil) for i, apiVersion := range env.ApiVersion { @@ -187,9 +176,10 @@ func main() { GVRCs: gvrcs, } - a := apiserver.NewAdaptor(cfg.Host, client, eventsClient, loggerSugared, opt, reporter, env.Name) - logger.Info("starting kubernetes api adapter", zap.Any("adapter", env)) - if err := a.Start(stopCh); err != nil { + adapter := apiserver.NewAdaptor(cfg.Host, client, eventsClient, loggerSugared, opt, reporter, env.Name) + logger.Info("Starting Receive Adapter", zap.Any("adapter", adapter)) + + if err := adapter.Start(ctx.Done()); err != nil { logger.Warn("start returned an error", zap.Error(err)) } } diff --git a/cmd/cronjob_receive_adapter/main.go b/cmd/cronjob_receive_adapter/main.go index 9dd27f54ea8..79dd9e9d1a2 100644 --- a/cmd/cronjob_receive_adapter/main.go +++ b/cmd/cronjob_receive_adapter/main.go @@ -25,41 +25,28 @@ import ( "github.com/kelseyhightower/envconfig" "go.opencensus.io/stats/view" "go.uber.org/zap" - "golang.org/x/net/context" - "knative.dev/eventing/pkg/adapter/cronjobevents" "knative.dev/eventing/pkg/tracing" "knative.dev/pkg/logging" "knative.dev/pkg/metrics" "knative.dev/pkg/signals" "knative.dev/pkg/source" + + "knative.dev/eventing/pkg/adapter" + "knative.dev/eventing/pkg/adapter/cronjobevents" + "knative.dev/eventing/pkg/kncloudevents" ) type envConfig struct { + adapter.EnvConfig + // Environment variable container schedule. Schedule string `envconfig:"SCHEDULE" required:"true"` // Environment variable containing data. Data string `envconfig:"DATA" required:"true"` - // Sink for messages. - Sink string `envconfig:"SINK_URI" required:"true"` - // Environment variable containing the name of the cron job. Name string `envconfig:"NAME" required:"true"` - - // Environment variable containing the namespace of the cron job. - Namespace string `envconfig:"NAMESPACE" required:"true"` - - // MetricsConfigJson is a json string of metrics.ExporterOptions. - // This is used to configure the metrics exporter options, - // the config is stored in a config map inside the controllers - // namespace and copied here. - MetricsConfigJson string `envconfig:"K_METRICS_CONFIG" required:"true"` - - // LoggingConfigJson is a json string of logging.Config. - // This is used to configure the logging config, the config is stored in - // a config map inside the controllers namespace and copied here. - LoggingConfigJson string `envconfig:"K_LOGGING_CONFIG" required:"true"` } const ( @@ -69,7 +56,8 @@ const ( func main() { flag.Parse() - ctx := context.Background() + ctx := signals.NewContext() + var env envConfig err := envconfig.Process("", &env) if err != nil { @@ -107,33 +95,36 @@ func main() { logger.Error("failed to create the metrics exporter", zap.Error(err)) } - if err := envconfig.Process("", &env); err != nil { - log.Fatal("Failed to process env var", zap.Error(err)) - } reporter, err := source.NewStatsReporter() if err != nil { logger.Error("error building statsreporter", zap.Error(err)) } + if err = tracing.SetupStaticPublishing(loggerSugared, "", tracing.OnePercentSampling); err != nil { - // If tracing doesn't work, we will log an error, but allow the importer to continue to - // start. + // 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)) } + eventsClient, err := kncloudevents.NewDefaultClient(env.SinkURI) + if err != nil { + logger.Fatal("error building cloud event client", zap.Error(err)) + } + + // Configuring the adapter + adapter := &cronjobevents.Adapter{ Schedule: env.Schedule, Data: env.Data, - SinkURI: env.Sink, Name: env.Name, Namespace: env.Namespace, Reporter: reporter, + Client: eventsClient, } logger.Info("Starting Receive Adapter", zap.Any("adapter", adapter)) - stopCh := signals.SetupSignalHandler() - - if err := adapter.Start(ctx, stopCh); err != nil { + if err := adapter.Start(ctx, ctx.Done()); err != nil { logger.Fatal("Failed to start adapter", zap.Error(err)) } } diff --git a/pkg/adapter/config.go b/pkg/adapter/config.go new file mode 100644 index 00000000000..4cc8d963b39 --- /dev/null +++ b/pkg/adapter/config.go @@ -0,0 +1,37 @@ +/* +Copyright 2019 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 + + http://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 adapter + +// EnvConfig is the minimal set of configuration parameters +// source adapters must support +type EnvConfig struct { + // SinkURI is the URI messages will be forwarded to. + SinkURI string `envconfig:"SINK_URI" required:"true"` + + // Environment variable containing the namespace of the adapter + Namespace string `envconfig:"NAMESPACE" required:"true"` + + // MetricsConfigJson is a json string of metrics.ExporterOptions. + // This is used to configure the metrics exporter options, + // the config is stored in a config map inside the controllers + // namespace and copied here. + MetricsConfigJson string `envconfig:"K_METRICS_CONFIG" required:"true"` + + // LoggingConfigJson is a json string of logging.Config. + // This is used to configure the logging config, the config is stored in + // a config map inside the controllers namespace and copied here. + LoggingConfigJson string `envconfig:"K_LOGGING_CONFIG" required:"true"` +} diff --git a/pkg/adapter/cronjobevents/adapter.go b/pkg/adapter/cronjobevents/adapter.go index 6a99c2ffa8a..010d7ce388e 100644 --- a/pkg/adapter/cronjobevents/adapter.go +++ b/pkg/adapter/cronjobevents/adapter.go @@ -24,13 +24,10 @@ import ( "github.com/robfig/cron" "go.uber.org/zap" sourcesv1alpha1 "knative.dev/eventing/pkg/apis/sources/v1alpha1" - "knative.dev/eventing/pkg/kncloudevents" "knative.dev/pkg/logging" "knative.dev/pkg/source" ) -// TODO: this should be a k8s cron. - // Adapter implements the Cron Job adapter to trigger a Sink. type Adapter struct { // Schedule is a cron format string such as 0 * * * * or @hourly @@ -39,9 +36,6 @@ type Adapter struct { // Data is the data to be posted to the target. Data string - // SinkURI is the URI messages will be forwarded on to. - SinkURI string - // Name is the name of the Cron Job. Name string @@ -49,7 +43,7 @@ type Adapter struct { Namespace string // client sends cloudevents. - client cloudevents.Client + Client cloudevents.Client Reporter source.StatsReporter } @@ -58,17 +52,6 @@ const ( resourceGroup = "cronjobsources.sources.eventing.knative.dev" ) -// Initialize cloudevent client -func (a *Adapter) initClient() error { - if a.client == nil { - var err error - if a.client, err = kncloudevents.NewDefaultClient(a.SinkURI); err != nil { - return err - } - } - return nil -} - func (a *Adapter) Start(ctx context.Context, stopCh <-chan struct{}) error { logger := logging.FromContext(ctx) @@ -78,11 +61,6 @@ func (a *Adapter) Start(ctx context.Context, stopCh <-chan struct{}) error { return err } - if err = a.initClient(); err != nil { - logger.Error("Failed to create cloudevent client", zap.Error(err)) - return err - } - c := cron.New() c.Schedule(sched, cron.FuncJob(a.cronTick)) c.Start() @@ -107,7 +85,7 @@ func (a *Adapter) cronTick() { ResourceGroup: resourceGroup, } - rctx, _, err := a.client.Send(context.TODO(), event) + rctx, _, err := a.Client.Send(context.TODO(), event) rtctx := cloudevents.HTTPTransportContextFrom(rctx) if err != nil { logger.Error("failed to send cloudevent", zap.Error(err)) diff --git a/pkg/adapter/cronjobevents/adapter_test.go b/pkg/adapter/cronjobevents/adapter_test.go index 65a74d4e3c3..cb70a29a059 100644 --- a/pkg/adapter/cronjobevents/adapter_test.go +++ b/pkg/adapter/cronjobevents/adapter_test.go @@ -19,13 +19,12 @@ package cronjobevents import ( "context" "encoding/json" - "io/ioutil" "log" "net/http" - "net/http/httptest" "testing" "github.com/google/go-cmp/cmp" + kncetesting "knative.dev/eventing/pkg/kncloudevents/testing" "knative.dev/pkg/source" ) @@ -42,39 +41,31 @@ func TestStart_ServeHTTP(t *testing.T) { testCases := map[string]struct { schedule string sink func(http.ResponseWriter, *http.Request) - reqBody string + data string error bool }{ "happy": { schedule: "* * * * *", // every minute sink: sinkAccepted, - reqBody: `{"body":"data"}`, + data: `{"body":"data"}`, }, "rejected": { schedule: "* * * * *", // every minute sink: sinkRejected, - reqBody: `{"body":"data"}`, + data: `{"body":"data"}`, error: true, }, } for n, tc := range testCases { t.Run(n, func(t *testing.T) { - h := &fakeHandler{ - handler: tc.sink, - } - sinkServer := httptest.NewServer(h) - defer sinkServer.Close() + ce := kncetesting.NewTestClient() r := &mockReporter{} a := &Adapter{ Schedule: tc.schedule, Data: "data", - SinkURI: sinkServer.URL, Reporter: r, - } - - if err := a.initClient(); err != nil { - t.Errorf("failed to create cloudevent client, %v", err) + Client: ce, } stop := make(chan struct{}) @@ -90,10 +81,8 @@ func TestStart_ServeHTTP(t *testing.T) { a.cronTick() // force a tick. validateMetric(t, a.Reporter, 1) + validateSent(t, ce, tc.data) - if tc.reqBody != string(h.body) { - t.Errorf("expected request body %q, but got %q", tc.reqBody, h.body) - } log.Print("test done") }) } @@ -120,44 +109,34 @@ func TestStartBadCron(t *testing.T) { func TestPostMessage_ServeHTTP(t *testing.T) { testCases := map[string]struct { - sink func(http.ResponseWriter, *http.Request) - reqBody string - error bool + sink func(http.ResponseWriter, *http.Request) + data string + error bool }{ "happy": { - sink: sinkAccepted, - reqBody: `{"body":"data"}`, + sink: sinkAccepted, + data: `{"body":"data"}`, }, "rejected": { - sink: sinkRejected, - reqBody: `{"body":"data"}`, - error: true, + sink: sinkRejected, + data: `{"body":"data"}`, + error: true, }, } for n, tc := range testCases { t.Run(n, func(t *testing.T) { - h := &fakeHandler{ - handler: tc.sink, - } - sinkServer := httptest.NewServer(h) - defer sinkServer.Close() + + ce := kncetesting.NewTestClient() r := &mockReporter{} a := &Adapter{ Data: "data", - SinkURI: sinkServer.URL, Reporter: r, - } - - if err := a.initClient(); err != nil { - t.Errorf("failed to create cloudevent client, %v", err) + Client: ce, } a.cronTick() - - if tc.reqBody != string(h.body) { - t.Errorf("expected request body %q, but got %q", tc.reqBody, h.body) - } + validateSent(t, ce, tc.data) validateMetric(t, a.Reporter, 1) }) } @@ -199,26 +178,6 @@ func TestMessage(t *testing.T) { } } -type fakeHandler struct { - body []byte - ran int - handler func(http.ResponseWriter, *http.Request) -} - -func (h *fakeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - body, err := ioutil.ReadAll(r.Body) - if err != nil { - http.Error(w, "can not read body", http.StatusBadRequest) - return - } - h.body = body - - defer r.Body.Close() - h.handler(w, r) - - h.ran++ -} - func sinkAccepted(writer http.ResponseWriter, req *http.Request) { writer.WriteHeader(http.StatusOK) } @@ -234,3 +193,13 @@ func validateMetric(t *testing.T, reporter source.StatsReporter, want int) { t.Errorf("Expected %d for metric, got %d", want, mockReporter.eventCount) } } + +func validateSent(t *testing.T, ce *kncetesting.TestCloudEventsClient, wantData string) { + if got := len(ce.Sent); got != 1 { + t.Errorf("Expected 1 event to be sent, got %d", got) + } + + if got := ce.Sent[0].Data; string(got.([]byte)) != wantData { + t.Errorf("Expected %q event to be sent, got %q", wantData, string(got.([]byte))) + } +} From 9232f7a383ed21c8762f1d779bc43ba91e4abc11 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Wed, 9 Oct 2019 13:46:38 -0400 Subject: [PATCH 2/3] use NAMESPACE everywhere --- Gopkg.lock | 1 - pkg/adapter/config_test.go | 51 +++++++++++++++++++ .../resources/receive_adapter.go | 2 +- .../resources/receive_adapter_test.go | 2 +- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 pkg/adapter/config_test.go diff --git a/Gopkg.lock b/Gopkg.lock index fc41dd7a516..16f3cc281ec 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1364,7 +1364,6 @@ "go.uber.org/atomic", "go.uber.org/zap", "go.uber.org/zap/zapcore", - "golang.org/x/net/context", "google.golang.org/grpc", "google.golang.org/grpc/codes", "google.golang.org/grpc/status", diff --git a/pkg/adapter/config_test.go b/pkg/adapter/config_test.go new file mode 100644 index 00000000000..5e82d40105f --- /dev/null +++ b/pkg/adapter/config_test.go @@ -0,0 +1,51 @@ +/* +Copyright 2019 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 + + http://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 adapter + +import ( + "os" + "testing" + + "github.com/kelseyhightower/envconfig" +) + +type myEnvConfig struct { + EnvConfig + + Mode string `envconfig:"MODE"` +} + +func TestEnvConfig(t *testing.T) { + os.Setenv("SINK_URI", "http://sink") + os.Setenv("NAMESPACE", "ns") + os.Setenv("K_METRICS_CONFIG", "metrics") + os.Setenv("K_LOGGING_CONFIG", "logging") + os.Setenv("MODE", "mymode") + + var env myEnvConfig + err := envconfig.Process("", &env) + if err != nil { + t.Errorf("Expected no error: %v", err) + } + + if env.Mode != "mymode" { + t.Errorf("Expected mode mymode, got: %s", env.Mode) + } + + if env.SinkURI != "http://sink" { + t.Errorf("Expected sinkURI http://sink, got: %s", env.SinkURI) + } +} diff --git a/pkg/reconciler/apiserversource/resources/receive_adapter.go b/pkg/reconciler/apiserversource/resources/receive_adapter.go index d561c05a44e..30b9888ad72 100644 --- a/pkg/reconciler/apiserversource/resources/receive_adapter.go +++ b/pkg/reconciler/apiserversource/resources/receive_adapter.go @@ -139,7 +139,7 @@ func makeEnv(sinkURI, loggingConfig, metricsConfig string, spec *v1alpha1.ApiSer Name: "SELECTOR", Value: selectors, }, { - Name: "SYSTEM_NAMESPACE", + Name: "NAMESPACE", ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.namespace", diff --git a/pkg/reconciler/apiserversource/resources/receive_adapter_test.go b/pkg/reconciler/apiserversource/resources/receive_adapter_test.go index 5158150d694..82403891d0f 100644 --- a/pkg/reconciler/apiserversource/resources/receive_adapter_test.go +++ b/pkg/reconciler/apiserversource/resources/receive_adapter_test.go @@ -169,7 +169,7 @@ func TestMakeReceiveAdapter(t *testing.T) { Name: "SELECTOR", Value: ";;test-key1=test-value1;akey,!anotherkey;akey,!anotherkey,test-key2=test-value2", }, { - Name: "SYSTEM_NAMESPACE", + Name: "NAMESPACE", ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.namespace", From 13978a94cd14a72047a931bfe5ce434c5222ceaa Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 10 Oct 2019 09:25:10 -0400 Subject: [PATCH 3/3] fixes after review --- cmd/apiserver_receive_adapter/main.go | 6 +++--- cmd/cronjob_receive_adapter/main.go | 5 ++--- pkg/adapter/config.go | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/apiserver_receive_adapter/main.go b/cmd/apiserver_receive_adapter/main.go index 53244caddb2..5401e0b7343 100644 --- a/cmd/apiserver_receive_adapter/main.go +++ b/cmd/apiserver_receive_adapter/main.go @@ -19,6 +19,7 @@ package main import ( "flag" "fmt" + "log" "strings" "time" @@ -81,9 +82,8 @@ func main() { ctx := signals.NewContext() var env envConfig - err := envconfig.Process("", &env) - if err != nil { - panic(fmt.Sprintf("Error processing env var: %s", err)) + if err := envconfig.Process("", &env); err != nil { + log.Fatalf("Error processing env var: %s", err) } // Convert json logging.Config to logging.Config. diff --git a/cmd/cronjob_receive_adapter/main.go b/cmd/cronjob_receive_adapter/main.go index 79dd9e9d1a2..c024e5dfa01 100644 --- a/cmd/cronjob_receive_adapter/main.go +++ b/cmd/cronjob_receive_adapter/main.go @@ -59,9 +59,8 @@ func main() { ctx := signals.NewContext() var env envConfig - err := envconfig.Process("", &env) - if err != nil { - panic(fmt.Sprintf("Error processing env var: %s", err)) + if err := envconfig.Process("", &env); err != nil { + log.Fatalf("Error processing env var: %s", err) } // Report stats on Go memory usage every 30 seconds. diff --git a/pkg/adapter/config.go b/pkg/adapter/config.go index 4cc8d963b39..39df14507c9 100644 --- a/pkg/adapter/config.go +++ b/pkg/adapter/config.go @@ -16,7 +16,7 @@ limitations under the License. package adapter // EnvConfig is the minimal set of configuration parameters -// source adapters must support +// source adapters should support type EnvConfig struct { // SinkURI is the URI messages will be forwarded to. SinkURI string `envconfig:"SINK_URI" required:"true"`