diff --git a/cmd/controller/main.go b/cmd/controller/main.go index bfca7ca7896..03dd21d9c45 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -21,13 +21,14 @@ import ( // _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "errors" - integrationSink "knative.dev/eventing/pkg/reconciler/integration/sink" - integrationSource "knative.dev/eventing/pkg/reconciler/integration/source" "log" "net/http" "os" "time" + integrationSink "knative.dev/eventing/pkg/reconciler/integration/sink" + integrationSource "knative.dev/eventing/pkg/reconciler/integration/source" + "knative.dev/pkg/injection/sharedmain" filteredFactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered" diff --git a/docs/eventing-api.md b/docs/eventing-api.md index a0ec2721261..5615dfe1388 100644 --- a/docs/eventing-api.md +++ b/docs/eventing-api.md @@ -6055,7 +6055,7 @@ JobSinkStatus s3
-knative.dev/eventing/pkg/apis/common.AWSS3 +knative.dev/eventing/pkg/apis/common/integration/v1alpha1.AWSS3 @@ -6065,7 +6065,7 @@ knative.dev/eventing/pkg/apis/common.AWSS3 sqs
-knative.dev/eventing/pkg/apis/common.AWSSQS +knative.dev/eventing/pkg/apis/common/integration/v1alpha1.AWSSQS @@ -6076,7 +6076,7 @@ knative.dev/eventing/pkg/apis/common.AWSSQS auth
-knative.dev/eventing/pkg/apis/common.Auth +knative.dev/eventing/pkg/apis/common/integration/v1alpha1.Auth diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_defaults_test.go b/pkg/apis/sinks/v1alpha1/integration_sink_defaults_test.go index 41bdc3137ce..fd605809c77 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_defaults_test.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_defaults_test.go @@ -18,8 +18,9 @@ package v1alpha1 import ( "context" - "github.com/google/go-cmp/cmp" "testing" + + "github.com/google/go-cmp/cmp" ) func TestIntegrationSinkSetDefaults(t *testing.T) { diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle_test.go b/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle_test.go index 4cb2902666d..a7cfeee5eb1 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle_test.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle_test.go @@ -17,11 +17,12 @@ limitations under the License. package v1alpha1 import ( + "testing" + "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" - "testing" ) func TestIntegrationSinkGetConditionSet(t *testing.T) { diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_types.go b/pkg/apis/sinks/v1alpha1/integration_sink_types.go index 95d0366cf9c..5e2dbb46fd0 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_types.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_types.go @@ -20,7 +20,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "knative.dev/eventing/pkg/apis/common" + "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -74,9 +74,9 @@ type Log struct { } type Aws struct { - S3 *common.AWSS3 `json:"s3,omitempty"` // S3 source configuration - SQS *common.AWSSQS `json:"sqs,omitempty"` // SQS source configuration - Auth *common.Auth `json:"auth,omitempty"` + S3 *v1alpha1.AWSS3 `json:"s3,omitempty"` // S3 source configuration + SQS *v1alpha1.AWSSQS `json:"sqs,omitempty"` // SQS source configuration + Auth *v1alpha1.Auth `json:"auth,omitempty"` } type IntegrationSinkStatus struct { diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_types_test.go b/pkg/apis/sinks/v1alpha1/integration_sink_types_test.go index d148aa28f90..27efddffeca 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_types_test.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_types_test.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha1 import ( - "knative.dev/eventing/pkg/apis/common" "testing" + + "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" ) func TestIntegrationSink_GetStatus(t *testing.T) { @@ -54,30 +55,30 @@ func TestLog(t *testing.T) { } func TestAWS(t *testing.T) { - s3 := common.AWSS3{ - AWSCommon: common.AWSCommon{ + s3 := v1alpha1.AWSS3{ + AWSCommon: v1alpha1.AWSCommon{ Region: "eu-north-1", }, - BucketNameOrArn: "example-bucket", + Arn: "example-bucket", } if s3.Region != "eu-north-1" { t.Errorf("AWSS3.Region = %v, want 'eu-north-1'", s3.Region) } - sqs := common.AWSSQS{ - AWSCommon: common.AWSCommon{ + sqs := v1alpha1.AWSSQS{ + AWSCommon: v1alpha1.AWSCommon{ Region: "eu-north-1", }, - QueueNameOrArn: "example-queue", + Arn: "example-queue", } if sqs.Region != "eu-north-1" { t.Errorf("AWSSQS.Region = %v, want 'eu-north-1'", sqs.Region) } - ddbStreams := common.AWSDDBStreams{ - AWSCommon: common.AWSCommon{ + ddbStreams := v1alpha1.AWSDDBStreams{ + AWSCommon: v1alpha1.AWSCommon{ Region: "eu-north-1", }, Table: "example-table", @@ -90,9 +91,9 @@ func TestAWS(t *testing.T) { // TestAuthFieldAccess tests the HasAuth method and field access in Auth struct func TestAuthFieldAccess(t *testing.T) { - auth := common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + auth := v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_validation.go b/pkg/apis/sinks/v1alpha1/integration_sink_validation.go index 40d02310540..c96b83d7dbe 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_validation.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_validation.go @@ -18,6 +18,7 @@ package v1alpha1 import ( "context" + "knative.dev/pkg/apis" ) @@ -61,7 +62,7 @@ func (spec *IntegrationSinkSpec) Validate(ctx context.Context) *apis.FieldError // Additional validation for AWS S3 required fields if spec.Aws.S3 != nil { - if spec.Aws.S3.BucketNameOrArn == "" { + if spec.Aws.S3.Arn == "" { errs = errs.Also(apis.ErrMissingField("aws.s3.bucketNameOrArn")) } if spec.Aws.S3.Region == "" { @@ -71,7 +72,7 @@ func (spec *IntegrationSinkSpec) Validate(ctx context.Context) *apis.FieldError // Additional validation for AWS SQS required fields if spec.Aws.SQS != nil { - if spec.Aws.SQS.QueueNameOrArn == "" { + if spec.Aws.SQS.Arn == "" { errs = errs.Also(apis.ErrMissingField("aws.sqs.queueNameOrArn")) } if spec.Aws.SQS.Region == "" { diff --git a/pkg/apis/sinks/v1alpha1/integration_sink_validation_test.go b/pkg/apis/sinks/v1alpha1/integration_sink_validation_test.go index d984eadd4e6..cba73a420b7 100644 --- a/pkg/apis/sinks/v1alpha1/integration_sink_validation_test.go +++ b/pkg/apis/sinks/v1alpha1/integration_sink_validation_test.go @@ -18,9 +18,10 @@ package v1alpha1 import ( "context" - "knative.dev/eventing/pkg/apis/common" "testing" + "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" + "github.com/google/go-cmp/cmp" "knative.dev/pkg/apis" ) @@ -45,15 +46,15 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "valid AWS S3 sink with auth and region", spec: IntegrationSinkSpec{ Aws: &Aws{ - S3: &common.AWSS3{ - AWSCommon: common.AWSCommon{ + S3: &v1alpha1.AWSS3{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - BucketNameOrArn: "example-bucket", + Arn: "example-bucket", }, - Auth: &common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + Auth: &v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, @@ -66,15 +67,15 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "valid AWS SQS sink with auth and region", spec: IntegrationSinkSpec{ Aws: &Aws{ - SQS: &common.AWSSQS{ - AWSCommon: common.AWSCommon{ + SQS: &v1alpha1.AWSSQS{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - QueueNameOrArn: "example-queue", + Arn: "example-queue", }, - Auth: &common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + Auth: &v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, @@ -91,11 +92,11 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { ShowHeaders: true, }, Aws: &Aws{ - S3: &common.AWSS3{ - AWSCommon: common.AWSCommon{ + S3: &v1alpha1.AWSS3{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - BucketNameOrArn: "example-bucket", + Arn: "example-bucket", }, }, }, @@ -105,21 +106,21 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "multiple AWS sinks set (invalid)", spec: IntegrationSinkSpec{ Aws: &Aws{ - S3: &common.AWSS3{ - AWSCommon: common.AWSCommon{ + S3: &v1alpha1.AWSS3{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - BucketNameOrArn: "example-bucket", + Arn: "example-bucket", }, - SQS: &common.AWSSQS{ - AWSCommon: common.AWSCommon{ + SQS: &v1alpha1.AWSSQS{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - QueueNameOrArn: "example-queue", + Arn: "example-queue", }, - Auth: &common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + Auth: &v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, @@ -132,14 +133,14 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "AWS SQS sink without QueueNameOrArn (invalid)", spec: IntegrationSinkSpec{ Aws: &Aws{ - SQS: &common.AWSSQS{ - AWSCommon: common.AWSCommon{ + SQS: &v1alpha1.AWSSQS{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, }, - Auth: &common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + Auth: &v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, @@ -157,11 +158,11 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "AWS sink without auth (invalid)", spec: IntegrationSinkSpec{ Aws: &Aws{ - S3: &common.AWSS3{ - AWSCommon: common.AWSCommon{ + S3: &v1alpha1.AWSS3{ + AWSCommon: v1alpha1.AWSCommon{ Region: "us-east-1", }, - BucketNameOrArn: "example-bucket", + Arn: "example-bucket", }, }, }, @@ -171,12 +172,12 @@ func TestIntegrationSinkSpecValidation(t *testing.T) { name: "AWS S3 sink without region (invalid)", spec: IntegrationSinkSpec{ Aws: &Aws{ - S3: &common.AWSS3{ - BucketNameOrArn: "example-bucket", + S3: &v1alpha1.AWSS3{ + Arn: "example-bucket", }, - Auth: &common.Auth{ - Secret: &common.Secret{ - Ref: &common.SecretReference{ + Auth: &v1alpha1.Auth{ + Secret: &v1alpha1.Secret{ + Ref: &v1alpha1.SecretReference{ Name: "aws-secret", }, }, diff --git a/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go index 99dadeaaee1..3dff23adf1d 100644 --- a/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go @@ -24,7 +24,7 @@ package v1alpha1 import ( v1 "k8s.io/api/batch/v1" runtime "k8s.io/apimachinery/pkg/runtime" - common "knative.dev/eventing/pkg/apis/common" + integrationv1alpha1 "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -32,17 +32,17 @@ func (in *Aws) DeepCopyInto(out *Aws) { *out = *in if in.S3 != nil { in, out := &in.S3, &out.S3 - *out = new(common.AWSS3) + *out = new(integrationv1alpha1.AWSS3) **out = **in } if in.SQS != nil { in, out := &in.SQS, &out.SQS - *out = new(common.AWSSQS) + *out = new(integrationv1alpha1.AWSSQS) **out = **in } if in.Auth != nil { in, out := &in.Auth, &out.Auth - *out = new(common.Auth) + *out = new(integrationv1alpha1.Auth) (*in).DeepCopyInto(*out) } return diff --git a/pkg/apis/sources/v1alpha1/integration_types_test.go b/pkg/apis/sources/v1alpha1/integration_types_test.go index 4dfd20ea801..ad30b14e2ed 100644 --- a/pkg/apis/sources/v1alpha1/integration_types_test.go +++ b/pkg/apis/sources/v1alpha1/integration_types_test.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha1 import ( - "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" "testing" + + "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" ) func TestIntegrationSource_GetStatus(t *testing.T) { diff --git a/pkg/apis/sources/v1alpha1/integration_validation_test.go b/pkg/apis/sources/v1alpha1/integration_validation_test.go index 3281b3940fb..9b263426b61 100644 --- a/pkg/apis/sources/v1alpha1/integration_validation_test.go +++ b/pkg/apis/sources/v1alpha1/integration_validation_test.go @@ -18,9 +18,10 @@ package v1alpha1 import ( "context" - "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" "testing" + "knative.dev/eventing/pkg/apis/common/integration/v1alpha1" + "github.com/google/go-cmp/cmp" "knative.dev/pkg/apis" ) diff --git a/pkg/reconciler/integration/helper.go b/pkg/reconciler/integration/helper.go index 4af8191b199..bc530788994 100644 --- a/pkg/reconciler/integration/helper.go +++ b/pkg/reconciler/integration/helper.go @@ -2,10 +2,11 @@ package integration import ( "fmt" - corev1 "k8s.io/api/core/v1" "reflect" "strconv" "strings" + + corev1 "k8s.io/api/core/v1" ) const prefix = "CAMEL_KAMELET_" @@ -37,17 +38,18 @@ func GenerateEnvVarsFromStruct(prefix string, s interface{}) []corev1.EnvVar { continue } - // Extract the JSON tag or fall back to the Go field name - jsonTag := fieldType.Tag.Get("json") - tagName := strings.Split(jsonTag, ",")[0] - - // fallback to Go field name if no JSON tag - if tagName == "" || tagName == "-" { - tagName = fieldType.Name + // First, check for the custom 'camel' tag + envVarName := fieldType.Tag.Get("camel") + if envVarName == "" { + // If 'camel' tag is not present, fall back to the 'json' tag or Go field name + jsonTag := fieldType.Tag.Get("json") + tagName := strings.Split(jsonTag, ",")[0] + if tagName == "" || tagName == "-" { + tagName = fieldType.Name + } + envVarName = fmt.Sprintf("%s_%s", prefix, strings.ToUpper(tagName)) } - envVarName := fmt.Sprintf("%s_%s", prefix, strings.ToUpper(tagName)) - if field.Kind() == reflect.Ptr { if field.IsNil() { continue diff --git a/pkg/reconciler/integration/helper_test.go b/pkg/reconciler/integration/helper_test.go index a602814ac98..22fa9d02da6 100644 --- a/pkg/reconciler/integration/helper_test.go +++ b/pkg/reconciler/integration/helper_test.go @@ -1,9 +1,10 @@ package integration import ( + "testing" + "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" - "testing" ) func TestGenerateEnvVarsFromStruct(t *testing.T) { @@ -33,3 +34,28 @@ func TestGenerateEnvVarsFromStruct(t *testing.T) { t.Errorf("generateEnvVarsFromStruct() mismatch (-want +got):\n%s", diff) } } + +func TestGenerateEnvVarsFromStruct_S3WithCamelTag(t *testing.T) { + type AWSS3 struct { + Arn string `json:"arn,omitempty" camel:"CAMEL_KAMELET_AWS_S3_SOURCE_BUCKETNAMEORARN"` + Region string `json:"region,omitempty"` + } + + prefix := "CAMEL_KAMELET_AWS_S3_SOURCE" + input := AWSS3{ + Arn: "arn:aws:s3:::example-bucket", + Region: "us-west-2", + } + + // Expected environment variables including SSL settings and camel tag for Arn + want := []corev1.EnvVar{ + {Name: "CAMEL_KAMELET_AWS_S3_SOURCE_BUCKETNAMEORARN", Value: "arn:aws:s3:::example-bucket"}, + {Name: "CAMEL_KAMELET_AWS_S3_SOURCE_REGION", Value: "us-west-2"}, + } + + got := GenerateEnvVarsFromStruct(prefix, input) + + if diff := cmp.Diff(want, got); diff != "" { + t.Errorf("generateEnvVarsFromStruct_S3WithCamelTag() mismatch (-want +got):\n%s", diff) + } +} diff --git a/pkg/reconciler/integration/sink/controller.go b/pkg/reconciler/integration/sink/controller.go index 3dda75718a9..a6b8c50d5c1 100644 --- a/pkg/reconciler/integration/sink/controller.go +++ b/pkg/reconciler/integration/sink/controller.go @@ -2,6 +2,7 @@ package sink import ( "context" + "k8s.io/client-go/tools/cache" "knative.dev/eventing/pkg/apis/feature" v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" diff --git a/pkg/reconciler/integration/sink/integrationsink.go b/pkg/reconciler/integration/sink/integrationsink.go index 5851f667301..f313d404f3a 100644 --- a/pkg/reconciler/integration/sink/integrationsink.go +++ b/pkg/reconciler/integration/sink/integrationsink.go @@ -3,6 +3,7 @@ package sink import ( "context" "fmt" + "go.uber.org/zap" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/test/rekt/features/integrationsink/features.go b/test/rekt/features/integrationsink/features.go index fd6c71132cd..944e1e4f89d 100644 --- a/test/rekt/features/integrationsink/features.go +++ b/test/rekt/features/integrationsink/features.go @@ -17,6 +17,8 @@ limitations under the License. package integrationsink import ( + "time" + cetest "github.com/cloudevents/sdk-go/v2/test" "github.com/google/uuid" "knative.dev/eventing/test/rekt/features/featureflags" @@ -25,7 +27,6 @@ import ( "knative.dev/reconciler-test/pkg/eventshub" "knative.dev/reconciler-test/pkg/eventshub/assert" "knative.dev/reconciler-test/pkg/feature" - "time" ) func Success() *feature.Feature { diff --git a/test/rekt/integration_sink_test.go b/test/rekt/integration_sink_test.go index f0d595735f9..7bc0394ba70 100644 --- a/test/rekt/integration_sink_test.go +++ b/test/rekt/integration_sink_test.go @@ -20,9 +20,10 @@ limitations under the License. package rekt import ( + "testing" + "knative.dev/eventing/test/rekt/features/integrationsink" "knative.dev/reconciler-test/pkg/eventshub" - "testing" "knative.dev/pkg/system" "knative.dev/reconciler-test/pkg/environment" diff --git a/test/rekt/resources/integrationsink/integrationsink.go b/test/rekt/resources/integrationsink/integrationsink.go index f2eaddc1da1..6ed054918f7 100644 --- a/test/rekt/resources/integrationsink/integrationsink.go +++ b/test/rekt/resources/integrationsink/integrationsink.go @@ -3,6 +3,8 @@ package integrationsink import ( "context" "embed" + "time" + "k8s.io/apimachinery/pkg/runtime/schema" "knative.dev/reconciler-test/pkg/environment" "knative.dev/reconciler-test/pkg/eventshub" @@ -10,7 +12,6 @@ import ( "knative.dev/reconciler-test/pkg/k8s" "knative.dev/reconciler-test/pkg/knative" "knative.dev/reconciler-test/pkg/manifest" - "time" ) //go:embed integrationsink.yaml diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go b/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go deleted file mode 100644 index d547fef8f95..00000000000 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/core/v1/pod/pod.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2022 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. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package pod - -import ( - context "context" - - v1 "k8s.io/client-go/informers/core/v1" - factory "knative.dev/pkg/client/injection/kube/informers/factory" - controller "knative.dev/pkg/controller" - injection "knative.dev/pkg/injection" - logging "knative.dev/pkg/logging" -) - -func init() { - injection.Default.RegisterInformer(withInformer) -} - -// Key is used for associating the Informer inside the context.Context. -type Key struct{} - -func withInformer(ctx context.Context) (context.Context, controller.Informer) { - f := factory.Get(ctx) - inf := f.Core().V1().Pods() - return context.WithValue(ctx, Key{}, inf), inf.Informer() -} - -// Get extracts the typed informer from the context. -func Get(ctx context.Context) v1.PodInformer { - untyped := ctx.Value(Key{}) - if untyped == nil { - logging.FromContext(ctx).Panic( - "Unable to fetch k8s.io/client-go/informers/core/v1.PodInformer from context.") - } - return untyped.(v1.PodInformer) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index db12d9f91a6..cdfcc672463 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1130,7 +1130,6 @@ knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints/fake knative.dev/pkg/client/injection/kube/informers/core/v1/namespace knative.dev/pkg/client/injection/kube/informers/core/v1/namespace/fake -knative.dev/pkg/client/injection/kube/informers/core/v1/pod knative.dev/pkg/client/injection/kube/informers/core/v1/secret/filtered knative.dev/pkg/client/injection/kube/informers/core/v1/service knative.dev/pkg/client/injection/kube/informers/core/v1/service/fake