diff --git a/go.mod b/go.mod index e4e911ac1a..113dc19bae 100644 --- a/go.mod +++ b/go.mod @@ -20,10 +20,10 @@ require ( k8s.io/client-go v0.31.0 k8s.io/code-generator v0.31.0 k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 - knative.dev/eventing v0.43.1-0.20241126125511-65da6fc77cd4 - knative.dev/hack v0.0.0-20241106013728-b7995315deb5 - knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f - knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf + knative.dev/eventing v0.43.1-0.20241211095952-f82811bd1041 + knative.dev/hack v0.0.0-20241128013751-1978b3a02667 + knative.dev/pkg v0.0.0-20241128013618-f3ab5605e542 + knative.dev/reconciler-test v0.0.0-20241128013747-984ae1257c23 sigs.k8s.io/controller-runtime v0.19.0 ) diff --git a/go.sum b/go.sum index f5049173e2..8bee42d993 100644 --- a/go.sum +++ b/go.sum @@ -826,14 +826,14 @@ k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 h1:1Wof1cGQgA5pqgo8MxKPtf k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8/go.mod h1:Os6V6dZwLNii3vxFpxcNaTmH8LJJBkOTg1N0tOA0fvA= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.43.1-0.20241126125511-65da6fc77cd4 h1:0jgqiStGgfXkFeTFKXM02tw7cxJSOypE0Q1xhInTucc= -knative.dev/eventing v0.43.1-0.20241126125511-65da6fc77cd4/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04= -knative.dev/hack v0.0.0-20241106013728-b7995315deb5 h1:CfU5+6B+ylBd7mSGpvRqpzZV8H5ZQLGUwVygFzbE+1o= -knative.dev/hack v0.0.0-20241106013728-b7995315deb5/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= -knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f h1:ggyD8WGF4LbTWfCiLo++EC/Q7rvYY4UI6CzuDt9dXkE= -knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f/go.mod h1:C2dxK66GlycMOS0SKqv0SMAnWkxsYbG4hkH32Xg1qD0= -knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf h1:FMgW5irj5xRPSRmtVICeLNHnZsnn7t8IFO0Fj3Kf+jo= -knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf/go.mod h1:W9Kmdoxelg2mswUpDKerL/4Ih1/ouVhlSMeZeJ5LX9c= +knative.dev/eventing v0.43.1-0.20241211095952-f82811bd1041 h1:FLsLy9WWG660f9I4jVIa+erI8Li3cl9gpZUtgY26Aus= +knative.dev/eventing v0.43.1-0.20241211095952-f82811bd1041/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04= +knative.dev/hack v0.0.0-20241128013751-1978b3a02667 h1:cp3GfEBnL0H2OrqdxLZ7nZ2K7U4PMdQhdBogl4Vd5+E= +knative.dev/hack v0.0.0-20241128013751-1978b3a02667/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= +knative.dev/pkg v0.0.0-20241128013618-f3ab5605e542 h1:x5cEwa34aOgQDnSTEE+UtRk5lND0cvb8KbVBUShwNuI= +knative.dev/pkg v0.0.0-20241128013618-f3ab5605e542/go.mod h1:C2dxK66GlycMOS0SKqv0SMAnWkxsYbG4hkH32Xg1qD0= +knative.dev/reconciler-test v0.0.0-20241128013747-984ae1257c23 h1:uImxV6MAs6JEahOHfemXSq7fgWNQ5ZW1BtFPDlanEc4= +knative.dev/reconciler-test v0.0.0-20241128013747-984ae1257c23/go.mod h1:zDapuiJIFS67XEVBJWdEnVN5KHE8EvFGooLQGXeDH/c= 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= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/knative.dev/eventing/pkg/adapter/v2/context.go b/vendor/knative.dev/eventing/pkg/adapter/v2/context.go index f36f95daa7..db03f4feab 100644 --- a/vendor/knative.dev/eventing/pkg/adapter/v2/context.go +++ b/vendor/knative.dev/eventing/pkg/adapter/v2/context.go @@ -124,3 +124,14 @@ func ConfiguratorOptionsFromContext(ctx context.Context) []ConfiguratorOption { } return value.([]ConfiguratorOption) } + +type healthProbesDisabledKey struct{} + +// WithHealthProbesDisabled signals to MainWithContext that it should disable default probes (readiness and liveness). +func WithHealthProbesDisabled(ctx context.Context) context.Context { + return context.WithValue(ctx, healthProbesDisabledKey{}, struct{}{}) +} + +func HealthProbesDisabled(ctx context.Context) bool { + return ctx.Value(healthProbesDisabledKey{}) != nil +} diff --git a/vendor/knative.dev/eventing/pkg/adapter/v2/main.go b/vendor/knative.dev/eventing/pkg/adapter/v2/main.go index 1eb274364f..af6598d5ce 100644 --- a/vendor/knative.dev/eventing/pkg/adapter/v2/main.go +++ b/vendor/knative.dev/eventing/pkg/adapter/v2/main.go @@ -306,6 +306,14 @@ func MainWithInformers(ctx context.Context, component string, env EnvConfigAcces }() } + if !HealthProbesDisabled(ctx) { + wg.Add(1) + go func() { + defer wg.Done() + injection.ServeHealthProbes(ctx, injection.HealthCheckDefaultPort) + }() + } + // Finally start the adapter (blocking) if err := adapter.Start(ctx); err != nil { logger.Fatalw("Start returned an error", zap.Error(err)) diff --git a/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/aws.go b/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/aws.go index 056ef5b4ea..7a77d57b52 100644 --- a/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/aws.go +++ b/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/aws.go @@ -16,13 +16,19 @@ limitations under the License. package v1alpha1 +const ( + + // AwsAccessKey is the name of the expected key on the secret for accessing the actual AWS access key value. + AwsAccessKey = "aws.accessKey" + // AwsSecretKey is the name of the expected key on the secret for accessing the actual AWS secret key value. + AwsSecretKey = "aws.secretKey" +) + type AWSCommon struct { // Auth is the S3 authentication (accessKey/secretKey) configuration. - Region string `json:"region,omitempty"` // AWS region - ProfileCredentialsName string `json:"profileCredentialsName,omitempty"` // Profile name for profile credentials provider - SessionToken string `json:"sessionToken,omitempty"` // Session token - URIEndpointOverride string `json:"uriEndpointOverride,omitempty"` // Override endpoint URI - OverrideEndpoint bool `json:"overrideEndpoint" default:"false"` // Override endpoint flag + Region string `json:"region,omitempty"` // AWS region + URIEndpointOverride string `json:"uriEndpointOverride,omitempty"` // Override endpoint URI + OverrideEndpoint bool `json:"overrideEndpoint" default:"false"` // Override endpoint flag } type AWSS3 struct { @@ -62,3 +68,9 @@ type AWSDDBStreams struct { StreamIteratorType string `json:"streamIteratorType,omitempty" default:"FROM_LATEST"` // Defines where in the DynamoDB stream to start getting records Delay int `json:"delay,omitempty" default:"500"` // Delay in milliseconds before the next poll from the database } + +type AWSSNS struct { + AWSCommon `json:",inline"` // Embeds AWSCommon to inherit its fields in JSON + Arn string `json:"arn,omitempty" camel:"CAMEL_KAMELET_AWS_SNS_SINK_TOPICNAMEORARN"` // SNS ARN + AutoCreateTopic bool `json:"autoCreateTopic" default:"false"` // Auto-create SNS topic +} diff --git a/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/zz_generated.deepcopy.go index 5d0f7dde59..9cf353963a 100644 --- a/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/common/integration/v1alpha1/zz_generated.deepcopy.go @@ -71,6 +71,23 @@ func (in *AWSS3) DeepCopy() *AWSS3 { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSSNS) DeepCopyInto(out *AWSSNS) { + *out = *in + out.AWSCommon = in.AWSCommon + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSSNS. +func (in *AWSSNS) DeepCopy() *AWSSNS { + if in == nil { + return nil + } + out := new(AWSSNS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSSQS) DeepCopyInto(out *AWSSQS) { *out = *in diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go index ee73d0d6a7..c05f915d10 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go @@ -20,6 +20,7 @@ import ( "context" "k8s.io/utils/ptr" + "knative.dev/eventing/pkg/apis/feature" "knative.dev/pkg/apis" ) @@ -30,7 +31,7 @@ func (rr *RequestReply) SetDefaults(ctx context.Context) { func (rrs *RequestReplySpec) SetDefaults(ctx context.Context) { if rrs.Timeout == nil || *rrs.Timeout == "" { - rrs.Timeout = ptr.To("30s") + rrs.Timeout = ptr.To(feature.FromContextOrDefaults(ctx).RequestReplyDefaultTimeout()) } if rrs.CorrelationAttribute == "" { diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/features.go b/vendor/knative.dev/eventing/pkg/apis/feature/features.go index 98eeb2907c..cfe379141d 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/features.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/features.go @@ -67,6 +67,10 @@ const ( // DefaultOIDCDiscoveryURL is the default OIDC Discovery URL used in most Kubernetes clusters. DefaultOIDCDiscoveryBaseURL Flag = "https://kubernetes.default.svc" + + // DefaultRequestReplyTimeout is a value for RequestReplyDefaultTimeout that indicates to timeout + // a RequestReply resource after 30 seconds by default. + DefaultRequestReplyTimeout Flag = "30s" ) // Flags is a map containing all the enabled/disabled flags for the experimental features. @@ -75,16 +79,17 @@ type Flags map[string]Flag func newDefaults() Flags { return map[string]Flag{ - KReferenceGroup: Disabled, - DeliveryRetryAfter: Disabled, - DeliveryTimeout: Enabled, - KReferenceMapping: Disabled, - TransportEncryption: Disabled, - OIDCAuthentication: Disabled, - EvenTypeAutoCreate: Disabled, - NewAPIServerFilters: Disabled, - AuthorizationDefaultMode: AuthorizationAllowSameNamespace, - OIDCDiscoveryBaseURL: DefaultOIDCDiscoveryBaseURL, + KReferenceGroup: Disabled, + DeliveryRetryAfter: Disabled, + DeliveryTimeout: Enabled, + KReferenceMapping: Disabled, + TransportEncryption: Disabled, + OIDCAuthentication: Disabled, + EvenTypeAutoCreate: Disabled, + NewAPIServerFilters: Disabled, + AuthorizationDefaultMode: AuthorizationAllowSameNamespace, + OIDCDiscoveryBaseURL: DefaultOIDCDiscoveryBaseURL, + RequestReplyDefaultTimeout: DefaultRequestReplyTimeout, } } @@ -151,6 +156,19 @@ func (e Flags) OIDCDiscoveryBaseURL() string { return string(discoveryUrl) } +func (e Flags) RequestReplyDefaultTimeout() string { + if e == nil { + return string(DefaultRequestReplyTimeout) + } + + timeout, ok := e[RequestReplyDefaultTimeout] + if !ok { + return string(DefaultRequestReplyTimeout) + } + + return string(timeout) +} + func (e Flags) String() string { return fmt.Sprintf("%+v", map[string]Flag(e)) } diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go b/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go index e21056eb44..ba163868c7 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go @@ -17,16 +17,17 @@ limitations under the License. package feature const ( - KReferenceGroup = "kreference-group" - DeliveryRetryAfter = "delivery-retryafter" - DeliveryTimeout = "delivery-timeout" - KReferenceMapping = "kreference-mapping" - TransportEncryption = "transport-encryption" - EvenTypeAutoCreate = "eventtype-auto-create" - OIDCAuthentication = "authentication-oidc" - NodeSelectorLabel = "apiserversources-nodeselector-" - CrossNamespaceEventLinks = "cross-namespace-event-links" - NewAPIServerFilters = "new-apiserversource-filters" - AuthorizationDefaultMode = "default-authorization-mode" - OIDCDiscoveryBaseURL = "oidc-discovery-base-url" + KReferenceGroup = "kreference-group" + DeliveryRetryAfter = "delivery-retryafter" + DeliveryTimeout = "delivery-timeout" + KReferenceMapping = "kreference-mapping" + TransportEncryption = "transport-encryption" + EvenTypeAutoCreate = "eventtype-auto-create" + OIDCAuthentication = "authentication-oidc" + NodeSelectorLabel = "apiserversources-nodeselector-" + CrossNamespaceEventLinks = "cross-namespace-event-links" + NewAPIServerFilters = "new-apiserversource-filters" + AuthorizationDefaultMode = "default-authorization-mode" + OIDCDiscoveryBaseURL = "oidc-discovery-base-url" + RequestReplyDefaultTimeout = "requestreply-default-timeout" ) diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go index 5e2dbb46fd..efc15e62b8 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go @@ -76,6 +76,7 @@ type Log struct { type Aws struct { S3 *v1alpha1.AWSS3 `json:"s3,omitempty"` // S3 source configuration SQS *v1alpha1.AWSSQS `json:"sqs,omitempty"` // SQS source configuration + SNS *v1alpha1.AWSSNS `json:"sns,omitempty"` // SNS source configuration Auth *v1alpha1.Auth `json:"auth,omitempty"` } diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go index c96b83d7db..7f24d9ca5a 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go @@ -42,6 +42,9 @@ func (spec *IntegrationSinkSpec) Validate(ctx context.Context) *apis.FieldError if spec.Aws.SQS != nil { sinkSetCount++ } + if spec.Aws.SNS != nil { + sinkSetCount++ + } } // Validate that only one sink field is set @@ -53,7 +56,7 @@ func (spec *IntegrationSinkSpec) Validate(ctx context.Context) *apis.FieldError // Only perform AWS-specific validation if exactly one AWS sink is configured if sinkSetCount == 1 && spec.Aws != nil { - if spec.Aws.S3 != nil || spec.Aws.SQS != nil { + if spec.Aws.S3 != nil || spec.Aws.SQS != nil || spec.Aws.SNS != nil { // Check that AWS Auth is properly configured if !spec.Aws.Auth.HasAuth() { errs = errs.Also(apis.ErrMissingField("aws.auth.secret.ref.name")) @@ -63,7 +66,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.Arn == "" { - errs = errs.Also(apis.ErrMissingField("aws.s3.bucketNameOrArn")) + errs = errs.Also(apis.ErrMissingField("aws.s3.arn")) } if spec.Aws.S3.Region == "" { errs = errs.Also(apis.ErrMissingField("aws.s3.region")) @@ -73,12 +76,21 @@ 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.Arn == "" { - errs = errs.Also(apis.ErrMissingField("aws.sqs.queueNameOrArn")) + errs = errs.Also(apis.ErrMissingField("aws.sqs.arn")) } if spec.Aws.SQS.Region == "" { errs = errs.Also(apis.ErrMissingField("aws.sqs.region")) } } + // Additional validation for AWS SNS required fields + if spec.Aws.SNS != nil { + if spec.Aws.SNS.Arn == "" { + errs = errs.Also(apis.ErrMissingField("aws.sns.arn")) + } + if spec.Aws.SNS.Region == "" { + errs = errs.Also(apis.ErrMissingField("aws.sns.region")) + } + } } return errs diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go index da69766bdd..5cc3a0faf6 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go @@ -29,7 +29,7 @@ import ( ) const ( - ExecutionModeEnvVar = "KNATIVE_EXECUTION_MODE" + ExecutionModeEnvVar = "K_EXECUTION_MODE" ) type ExecutionMode string diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go index 3dff23adf1..a0265e79c0 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go @@ -40,6 +40,11 @@ func (in *Aws) DeepCopyInto(out *Aws) { *out = new(integrationv1alpha1.AWSSQS) **out = **in } + if in.SNS != nil { + in, out := &in.SNS, &out.SNS + *out = new(integrationv1alpha1.AWSSNS) + **out = **in + } if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = new(integrationv1alpha1.Auth) diff --git a/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_validation.go b/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_validation.go index 3b41299846..935e18e384 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_validation.go +++ b/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_validation.go @@ -76,7 +76,7 @@ func (spec *IntegrationSourceSpec) Validate(ctx context.Context) *apis.FieldErro // Additional validation for AWS SQS required fields if spec.Aws.SQS != nil { if spec.Aws.SQS.Arn == "" { - errs = errs.Also(apis.ErrMissingField("aws.sqs.queueNameOrArn")) + errs = errs.Also(apis.ErrMissingField("aws.sqs.arn")) } if spec.Aws.SQS.Region == "" { errs = errs.Also(apis.ErrMissingField("aws.sqs.region")) diff --git a/vendor/modules.txt b/vendor/modules.txt index b60bad0b1d..13ddc99fa5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1081,7 +1081,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.43.1-0.20241126125511-65da6fc77cd4 +# knative.dev/eventing v0.43.1-0.20241211095952-f82811bd1041 ## explicit; go 1.22.7 knative.dev/eventing/cmd/heartbeats knative.dev/eventing/pkg/adapter/v2 @@ -1214,10 +1214,10 @@ knative.dev/eventing/test/rekt/resources/trigger knative.dev/eventing/test/test_images knative.dev/eventing/test/test_images/event-sender knative.dev/eventing/test/test_images/print -# knative.dev/hack v0.0.0-20241106013728-b7995315deb5 +# knative.dev/hack v0.0.0-20241128013751-1978b3a02667 ## explicit; go 1.21 knative.dev/hack -# knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f +# knative.dev/pkg v0.0.0-20241128013618-f3ab5605e542 ## explicit; go 1.22.7 knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -1316,8 +1316,8 @@ knative.dev/pkg/webhook/json knative.dev/pkg/webhook/resourcesemantics knative.dev/pkg/webhook/resourcesemantics/defaulting knative.dev/pkg/webhook/resourcesemantics/validation -# knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf -## explicit; go 1.22.0 +# knative.dev/reconciler-test v0.0.0-20241128013747-984ae1257c23 +## explicit; go 1.22.7 knative.dev/reconciler-test/cmd/eventshub knative.dev/reconciler-test/pkg/environment knative.dev/reconciler-test/pkg/eventshub