From ddd3b7f9199b6766d09c3a682f99f1035bbf8140 Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Mon, 25 Nov 2024 13:35:09 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/eventing ebe99e6...366ff26: > 366ff26 IntegrationSink: rek-test templating support for bool annotations (# 8342) > 7176ce6 Add IntegrationSink CRD (# 8304) > 5ad7dab feat: add RequestReply types and CRD (# 8337) > 7f313d7 fix: rename `job-sink` to `job_sink` (# 8335) > 4f6535a chore: correct comments (# 8336) Signed-off-by: Knative Automation --- go.mod | 2 +- go.sum | 4 +- .../pkg/apis/eventing/v1alpha1/register.go | 2 + .../v1alpha1/requestreply_conversion.go | 34 +++ .../v1alpha1/requestreply_defaults.go | 43 ++++ .../v1alpha1/requestreply_lifecycle.go | 106 ++++++++++ .../eventing/v1alpha1/requestreply_types.go | 122 +++++++++++ .../v1alpha1/requestreply_validation.go | 83 ++++++++ .../v1alpha1/zz_generated.deepcopy.go | 113 ++++++++++ .../eventing/pkg/apis/sinks/register.go | 6 + .../v1alpha1/integration_sink_conversion.go | 36 ++++ .../v1alpha1/integration_sink_defaults.go | 26 +++ .../v1alpha1/integration_sink_lifecycle.go | 123 +++++++++++ .../sinks/v1alpha1/integration_sink_types.go | 117 +++++++++++ .../v1alpha1/integration_sink_validation.go | 85 ++++++++ .../pkg/apis/sinks/v1alpha1/register.go | 2 + .../sinks/v1alpha1/zz_generated.deepcopy.go | 154 ++++++++++++++ .../sources/v1alpha1/integration_lifecycle.go | 4 +- .../eventing/v1alpha1/eventing_client.go | 5 + .../v1alpha1/fake/fake_eventing_client.go | 4 + .../v1alpha1/fake/fake_requestreply.go | 141 +++++++++++++ .../eventing/v1alpha1/generated_expansion.go | 2 + .../typed/eventing/v1alpha1/requestreply.go | 195 ++++++++++++++++++ .../v1alpha1/fake/fake_integrationsink.go | 141 +++++++++++++ .../sinks/v1alpha1/fake/fake_sinks_client.go | 4 + .../sinks/v1alpha1/generated_expansion.go | 2 + .../typed/sinks/v1alpha1/integrationsink.go | 195 ++++++++++++++++++ .../typed/sinks/v1alpha1/sinks_client.go | 5 + .../eventing/v1alpha1/expansion_generated.go | 8 + .../listers/eventing/v1alpha1/requestreply.go | 99 +++++++++ .../eventing/pkg/eventingtls/eventingtls.go | 3 + vendor/modules.txt | 2 +- 32 files changed, 1862 insertions(+), 6 deletions(-) create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_conversion.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_lifecycle.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_types.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_validation.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_conversion.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_defaults.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_requestreply.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/requestreply.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_integrationsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/integrationsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/requestreply.go diff --git a/go.mod b/go.mod index efd5b4242..dae989686 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( k8s.io/api v0.30.3 k8s.io/apimachinery v0.30.3 k8s.io/client-go v0.30.3 - knative.dev/eventing v0.43.1-0.20241119173100-ebe99e655146 + knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6 knative.dev/hack v0.0.0-20241106013728-b7995315deb5 knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f knative.dev/serving v0.43.1-0.20241119121959-3e45e8f8392b diff --git a/go.sum b/go.sum index 15dd7244e..3df94bfd7 100644 --- a/go.sum +++ b/go.sum @@ -794,8 +794,8 @@ 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.20241119173100-ebe99e655146 h1:ySpPjfPIvpqR+QtEGSbEjMJ8J6dyZTt7G89Tr0kj5L4= -knative.dev/eventing v0.43.1-0.20241119173100-ebe99e655146/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04= +knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6 h1:/8Cq+ZgwU4Fb4MWVQ1jggNGA8wedH6agbgyhfkEDLbk= +knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6/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/networking v0.0.0-20241118075147-929a5d5f19d0 h1:3vj6wR95isnuqgjQzcclyrzaodv5Jvjc7xq4Bv0yde8= diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go index c6f3e98cd..c891f7c7b 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go @@ -47,6 +47,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &EventPolicy{}, &EventPolicyList{}, + &RequestReply{}, + &RequestReplyList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_conversion.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_conversion.go new file mode 100644 index 000000000..739e922ca --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_conversion.go @@ -0,0 +1,34 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + "context" + "fmt" + + "knative.dev/pkg/apis" +) + +// ConvertTo implements apis.Convertible +func (ep *RequestReply) ConvertTo(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", obj) +} + +// ConvertFrom implements apis.Convertible +func (ep *RequestReply) ConvertFrom(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", obj) +} 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 new file mode 100644 index 000000000..ee73d0d6a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go @@ -0,0 +1,43 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + "context" + + "k8s.io/utils/ptr" + "knative.dev/pkg/apis" +) + +func (rr *RequestReply) SetDefaults(ctx context.Context) { + ctx = apis.WithinParent(ctx, rr.ObjectMeta) + rr.Spec.SetDefaults(ctx) +} + +func (rrs *RequestReplySpec) SetDefaults(ctx context.Context) { + if rrs.Timeout == nil || *rrs.Timeout == "" { + rrs.Timeout = ptr.To("30s") + } + + if rrs.CorrelationAttribute == "" { + rrs.CorrelationAttribute = "correlationid" + } + + if rrs.ReplyAttribute == "" { + rrs.ReplyAttribute = "replyid" + } +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_lifecycle.go new file mode 100644 index 000000000..670142290 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_lifecycle.go @@ -0,0 +1,106 @@ +/* +Copyright 2024 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 v1alpha1 + +import ( + "knative.dev/pkg/apis" + v1 "knative.dev/pkg/apis/duck/v1" +) + +var requestReplyCondSet = apis.NewLivingConditionSet(RequestReplyConditionIngress, RequestReplyConditionTriggers, RequestReplyConditionAddressable, RequestReplyConditionEventPoliciesReady) + +const ( + RequestReplyConditionReady = apis.ConditionReady + RequestReplyConditionIngress apis.ConditionType = "IngressReady" + RequestReplyConditionTriggers apis.ConditionType = "TriggersReady" + RequestReplyConditionAddressable apis.ConditionType = "Addressable" + RequestReplyConditionEventPoliciesReady apis.ConditionType = "EventPoliciesReady" +) + +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*RequestReply) GetConditionSet() apis.ConditionSet { + return requestReplyCondSet +} + +func (*RequestReplyStatus) GetConditionSet() apis.ConditionSet { + return requestReplyCondSet +} + +// GetCondition returns the condition currently associated with the given type, or nil. +func (rr *RequestReplyStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return requestReplyCondSet.Manage(rr).GetCondition(t) +} + +// IsReady returns true if the resource is ready overall. +func (rr *RequestReplyStatus) IsReady() bool { + return rr.GetTopLevelCondition().IsTrue() +} + +// GetTopLevelCondition returns the top level Condition. +func (rr *RequestReplyStatus) GetTopLevelCondition() *apis.Condition { + return requestReplyCondSet.Manage(rr).GetTopLevelCondition() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (rr *RequestReplyStatus) InitializeConditions() { + requestReplyCondSet.Manage(rr).InitializeConditions() +} + +func (rr *RequestReplyStatus) SetAddress(address *v1.Addressable) { + rr.AddressStatus = v1.AddressStatus{ + Address: address, + } + + if address != nil && address.URL != nil { + rr.GetConditionSet().Manage(rr).MarkTrue(RequestReplyConditionAddressable) + rr.AddressStatus.Address.Name = &address.URL.Scheme + } else { + rr.GetConditionSet().Manage(rr).MarkFalse(RequestReplyConditionAddressable, "nil URL", "URL is nil") + } +} + +func (rr *RequestReplyStatus) MarkTriggersReady() { + rr.GetConditionSet().Manage(rr).MarkTrue(RequestReplyConditionTriggers) +} + +func (rr *RequestReplyStatus) MarkTriggersNotReadyWithReason(reason, messageFormat string, messageA ...interface{}) { + rr.GetConditionSet().Manage(rr).MarkUnknown(RequestReplyConditionTriggers, reason, messageFormat, messageA...) +} + +func (rr *RequestReplyStatus) MarkIngressReady() { + rr.GetConditionSet().Manage(rr).MarkTrue(RequestReplyConditionIngress) +} + +func (rr *RequestReplyStatus) MarkIngressNotReadyWithReason(reason, messageFormat string, messageA ...interface{}) { + rr.GetConditionSet().Manage(rr).MarkUnknown(RequestReplyConditionIngress, reason, messageFormat, messageA...) +} + +func (rr *RequestReplyStatus) MarkEventPoliciesTrue() { + rr.GetConditionSet().Manage(rr).MarkTrue(RequestReplyConditionEventPoliciesReady) +} + +func (rr *RequestReplyStatus) MarkEventPoliciesTrueWithReason(reason, messageFormat string, messageA ...interface{}) { + rr.GetConditionSet().Manage(rr).MarkTrueWithReason(RequestReplyConditionEventPoliciesReady, reason, messageFormat, messageA...) +} + +func (rr *RequestReplyStatus) MarkEventPoliciesFailed(reason, messageFormat string, messageA ...interface{}) { + rr.GetConditionSet().Manage(rr).MarkFalse(RequestReplyConditionEventPoliciesReady, reason, messageFormat, messageA...) +} + +func (rr *RequestReplyStatus) MarkEventPoliciesUnknown(reason, messageFormat string, messageA ...interface{}) { + rr.GetConditionSet().Manage(rr).MarkUnknown(RequestReplyConditionEventPoliciesReady, reason, messageFormat, messageA...) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_types.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_types.go new file mode 100644 index 000000000..3cb37e11b --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_types.go @@ -0,0 +1,122 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/kmeta" + + eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" +) + +// +genclient +// +genreconciler +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// RequestRepluy represents synchronous interface to sending and receiving events from a Broker. +type RequestReply struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of the EventPolicy. + Spec RequestReplySpec `json:"spec,omitempty"` + + // Status represents the current state of the EventPolicy. + // This data may be out of date. + // +optional + Status RequestReplyStatus `json:"status,omitempty"` +} + +var ( + // Check that EventPolicy can be validated, can be defaulted, and has immutable fields. + _ apis.Validatable = (*RequestReply)(nil) + _ apis.Defaultable = (*RequestReply)(nil) + + // Check that EventPolicy can return its spec untyped. + _ apis.HasSpec = (*RequestReply)(nil) + + _ runtime.Object = (*RequestReply)(nil) + + // Check that we can create OwnerReferences to an EventPolicy. + _ kmeta.OwnerRefable = (*RequestReply)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*RequestReply)(nil) +) + +type RequestReplySpec struct { + // BrokerRef contains the reference to the broker the RequestReply sends events to. + BrokerRef duckv1.KReference `json:"brokerRef"` + + CorrelationAttribute string `json:"correlationAttribute"` + + ReplyAttribute string `json:"replyAttribute"` + + Timeout *string `json:"timeout,omitempty"` + + Delivery *eventingduckv1.DeliverySpec `json:"delivery,omitempty"` + + Secrets []string `json:"secrets"` +} + +// RequestReplyStatus represents the current state of a RequestReply. +type RequestReplyStatus struct { + // inherits duck/v1 Status, which currently provides: + // * ObservedGeneration - the 'Generation' of the Service that was last processed by the controller. + // * Conditions - the latest available observations of a resource's current state. + duckv1.Status `json:",inline"` + + // AddressStatus is the part where the RequestReply fulfills the Addressable contract. + // It exposes the endpoint as an URI to get events delivered. + // +optional + duckv1.AddressStatus `json:",inline"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker. + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// RequestReplyList is a collection of RequestReplies. +type RequestReplyList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + Items []RequestReply `json:"items"` +} + +// GetGroupVersionKind returns GroupVersionKind for EventPolicy +func (rr *RequestReply) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("RequestReply") +} + +// GetUntypedSpec returns the spec of the EventPolicy. +func (rr *RequestReply) GetUntypedSpec() interface{} { + return rr.Spec +} + +// GetStatus retrieves the status of the EventPolicy. Implements the KRShaped interface. +func (rr *RequestReply) GetStatus() *duckv1.Status { + return &rr.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_validation.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_validation.go new file mode 100644 index 000000000..693c5a789 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_validation.go @@ -0,0 +1,83 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + "context" + "strings" + + "github.com/rickb777/date/period" + + "knative.dev/pkg/apis" +) + +func (rr *RequestReply) Validate(ctx context.Context) *apis.FieldError { + ctx = apis.WithinParent(ctx, rr.ObjectMeta) + return rr.Spec.Validate(ctx).ViaField("spec") +} + +func (rrs *RequestReplySpec) Validate(ctx context.Context) *apis.FieldError { + var errs *apis.FieldError + + if ke := rrs.BrokerRef.Validate(ctx); ke != nil { + errs = errs.Also(ke.ViaField("brokerRef")) + } + + if !strings.EqualFold(rrs.BrokerRef.Kind, "broker") { + errs = errs.Also(apis.ErrInvalidValue(rrs.BrokerRef.Kind, ".kind", "brokerRef kind must be Broker").ViaField("brokerRef")) + } + + if rrs.BrokerRef.Namespace != "" { + errs = errs.Also(apis.ErrDisallowedFields("namespace").ViaField("brokerRef")) + } + + if rrs.Delivery != nil { + if de := rrs.Delivery.Validate(ctx); de != nil { + errs = errs.Also(de.ViaField("delivery")) + } + } + + if rrs.Timeout != nil { + timeout, err := period.Parse(*rrs.Timeout) + if err != nil || timeout.IsZero() || timeout.IsNegative() { + errs = errs.Also(apis.ErrInvalidValue(*rrs.Timeout, "timeout")) + } + + } + + if len(rrs.Secrets) == 0 { + errs = errs.Also(apis.ErrInvalidValue(rrs.Secrets, "secrets", "one or more secrets must be provided")) + } + + if rrs.CorrelationAttribute == "" || + rrs.CorrelationAttribute == "id" || + rrs.CorrelationAttribute == "course" || + rrs.CorrelationAttribute == "specversion" || + rrs.CorrelationAttribute == "type" { + errs = errs.Also(apis.ErrInvalidValue(rrs.CorrelationAttribute, "correlationattribute", "correlationattribute must be non-empty and cannot be a core cloudevent attribute (id, type, specversion, source)")) + } + + if rrs.ReplyAttribute == "" || + rrs.ReplyAttribute == "id" || + rrs.ReplyAttribute == "course" || + rrs.ReplyAttribute == "specversion" || + rrs.ReplyAttribute == "type" { + errs = errs.Also(apis.ErrInvalidValue(rrs.ReplyAttribute, "replyattribute", "replyattribute must be non-empty and cannot be a core cloudevent attribute (id, type, specversion, source)")) + } + + return errs +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go index 068369c53..4a30bba48 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go @@ -24,6 +24,7 @@ package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" + duckv1 "knative.dev/eventing/pkg/apis/duck/v1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" ) @@ -256,3 +257,115 @@ func (in *EventPolicyToReference) DeepCopy() *EventPolicyToReference { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestReply) DeepCopyInto(out *RequestReply) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestReply. +func (in *RequestReply) DeepCopy() *RequestReply { + if in == nil { + return nil + } + out := new(RequestReply) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RequestReply) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestReplyList) DeepCopyInto(out *RequestReplyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RequestReply, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestReplyList. +func (in *RequestReplyList) DeepCopy() *RequestReplyList { + if in == nil { + return nil + } + out := new(RequestReplyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RequestReplyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestReplySpec) DeepCopyInto(out *RequestReplySpec) { + *out = *in + in.BrokerRef.DeepCopyInto(&out.BrokerRef) + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(string) + **out = **in + } + if in.Delivery != nil { + in, out := &in.Delivery, &out.Delivery + *out = new(duckv1.DeliverySpec) + (*in).DeepCopyInto(*out) + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestReplySpec. +func (in *RequestReplySpec) DeepCopy() *RequestReplySpec { + if in == nil { + return nil + } + out := new(RequestReplySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestReplyStatus) DeepCopyInto(out *RequestReplyStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.AddressStatus.DeepCopyInto(&out.AddressStatus) + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestReplyStatus. +func (in *RequestReplyStatus) DeepCopy() *RequestReplyStatus { + if in == nil { + return nil + } + out := new(RequestReplyStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go index 676fa75e8..1994d5791 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/register.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go @@ -33,6 +33,12 @@ var ( Group: GroupName, Resource: "jobsinks", } + + // IntegrationSinkResource respresents a Knative Eventing sink IntegrationSink + IntegrationSinkResource = schema.GroupResource{ + Group: GroupName, + Resource: "integrationsinks", + } ) type Config struct { diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_conversion.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_conversion.go new file mode 100644 index 000000000..8f41d2da4 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_conversion.go @@ -0,0 +1,36 @@ +/* +Copyright 2024 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 v1alpha1 + +import ( + "context" + "fmt" + + "knative.dev/pkg/apis" +) + +// ConvertTo implements apis.Convertible +// Converts source from v1alpha1.IntegrationSink into a higher version. +func (sink *IntegrationSink) ConvertTo(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} + +// ConvertFrom implements apis.Convertible +// Converts source from a higher version into v1beta2.IntegrationSink +func (sink *IntegrationSink) ConvertFrom(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_defaults.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_defaults.go new file mode 100644 index 000000000..f77df267e --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_defaults.go @@ -0,0 +1,26 @@ +/* +Copyright 2020 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 v1alpha1 + +import "context" + +func (sink *IntegrationSink) SetDefaults(ctx context.Context) { + sink.Spec.SetDefaults(ctx) +} + +func (sink *IntegrationSinkSpec) SetDefaults(ctx context.Context) { +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle.go new file mode 100644 index 000000000..1ad33e2ca --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_lifecycle.go @@ -0,0 +1,123 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" +) + +const ( + // IntegrationSinkConditionReady has status True when the IntegrationSink is ready to send events. + IntegrationSinkConditionReady = apis.ConditionReady + + IntegrationSinkConditionAddressable apis.ConditionType = "Addressable" + + // IntegrationSinkConditionDeploymentReady has status True when the IntegrationSink has been configured with a deployment. + IntegrationSinkConditionDeploymentReady apis.ConditionType = "DeploymentReady" + + // IntegrationSinkConditionEventPoliciesReady has status True when all the applying EventPolicies for this + // IntegrationSink are ready. + IntegrationSinkConditionEventPoliciesReady apis.ConditionType = "EventPoliciesReady" +) + +var IntegrationSinkCondSet = apis.NewLivingConditionSet( + IntegrationSinkConditionAddressable, + IntegrationSinkConditionDeploymentReady, + IntegrationSinkConditionEventPoliciesReady, +) + +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*IntegrationSink) GetConditionSet() apis.ConditionSet { + return IntegrationSinkCondSet +} + +// GetCondition returns the condition currently associated with the given type, or nil. +func (s *IntegrationSinkStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return IntegrationSinkCondSet.Manage(s).GetCondition(t) +} + +// GetTopLevelCondition returns the top level Condition. +func (ps *IntegrationSinkStatus) GetTopLevelCondition() *apis.Condition { + return IntegrationSinkCondSet.Manage(ps).GetTopLevelCondition() +} + +// IsReady returns true if the resource is ready overall. +func (s *IntegrationSinkStatus) IsReady() bool { + return IntegrationSinkCondSet.Manage(s).IsHappy() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (s *IntegrationSinkStatus) InitializeConditions() { + IntegrationSinkCondSet.Manage(s).InitializeConditions() +} + +// MarkAddressableReady marks the Addressable condition to True. +func (s *IntegrationSinkStatus) MarkAddressableReady() { + IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable) +} + +// MarkEventPoliciesFailed marks the EventPoliciesReady condition to False with the given reason and message. +func (s *IntegrationSinkStatus) MarkEventPoliciesFailed(reason, messageFormat string, messageA ...interface{}) { + IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...) +} + +// MarkEventPoliciesUnknown marks the EventPoliciesReady condition to Unknown with the given reason and message. +func (s *IntegrationSinkStatus) MarkEventPoliciesUnknown(reason, messageFormat string, messageA ...interface{}) { + IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...) +} + +// MarkEventPoliciesTrue marks the EventPoliciesReady condition to True. +func (s *IntegrationSinkStatus) MarkEventPoliciesTrue() { + IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionEventPoliciesReady) +} + +// MarkEventPoliciesTrueWithReason marks the EventPoliciesReady condition to True with the given reason and message. +func (s *IntegrationSinkStatus) MarkEventPoliciesTrueWithReason(reason, messageFormat string, messageA ...interface{}) { + IntegrationSinkCondSet.Manage(s).MarkTrueWithReason(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...) +} + +func (s *IntegrationSinkStatus) PropagateDeploymentStatus(d *appsv1.DeploymentStatus) { + deploymentAvailableFound := false + for _, cond := range d.Conditions { + if cond.Type == appsv1.DeploymentAvailable { + deploymentAvailableFound = true + if cond.Status == corev1.ConditionTrue { + IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionDeploymentReady) + } else if cond.Status == corev1.ConditionFalse { + IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message) + } else if cond.Status == corev1.ConditionUnknown { + IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message) + } + } + } + if !deploymentAvailableFound { + IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, "DeploymentUnavailable", "The Deployment '%s' is unavailable.", d) + } +} + +func (s *IntegrationSinkStatus) SetAddress(address *duckv1.Addressable) { + s.Address = address + if address == nil || address.URL.IsEmpty() { + IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionAddressable, "EmptyHostname", "hostname is the empty string") + } else { + IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable) + + } +} 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 new file mode 100644 index 000000000..5e2dbb46f --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_types.go @@ -0,0 +1,117 @@ +/* +Copyright 2024 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 v1alpha1 + +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/integration/v1alpha1" + eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" + "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/kmeta" +) + +// +genclient +// +genreconciler +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// IntegrationSink is the Schema for the IntegrationSink API. +type IntegrationSink struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IntegrationSinkSpec `json:"spec,omitempty"` + Status IntegrationSinkStatus `json:"status,omitempty"` +} + +// Check the interfaces that JobSink should be implementing. +var ( + _ runtime.Object = (*IntegrationSink)(nil) + _ kmeta.OwnerRefable = (*IntegrationSink)(nil) + _ apis.Validatable = (*IntegrationSink)(nil) + _ apis.Defaultable = (*IntegrationSink)(nil) + _ apis.HasSpec = (*IntegrationSink)(nil) + _ duckv1.KRShaped = (*IntegrationSink)(nil) + _ apis.Convertible = (*JobSink)(nil) +) + +type IntegrationSinkSpec struct { + Aws *Aws `json:"aws,omitempty"` // AWS source configuration + Log *Log `json:"log,omitempty"` // Log sink configuration +} + +type Log struct { + LoggerName string `json:"loggerName,omitempty" default:"log-sink"` // Name of the logging category to use + Level string `json:"level,omitempty" default:"INFO"` // Logging level to use + LogMask bool `json:"logMask,omitempty" default:"false"` // Mask sensitive information in the log + Marker string `json:"marker,omitempty"` // An optional Marker name to use + Multiline bool `json:"multiline,omitempty" default:"false"` // If enabled, outputs each information on a newline + ShowAllProperties bool `json:"showAllProperties,omitempty" default:"false"` // Show all of the exchange properties (both internal and custom) + ShowBody bool `json:"showBody,omitempty" default:"true"` // Show the message body + ShowBodyType bool `json:"showBodyType,omitempty" default:"true"` // Show the body Java type + ShowExchangePattern bool `json:"showExchangePattern,omitempty" default:"true"` // Show the Message Exchange Pattern (MEP) + ShowHeaders bool `json:"showHeaders,omitempty" default:"false"` // Show the headers received + ShowProperties bool `json:"showProperties,omitempty" default:"false"` // Show the exchange properties (only custom) + ShowStreams bool `json:"showStreams,omitempty" default:"false"` // Show the stream bodies + ShowCachedStreams bool `json:"showCachedStreams,omitempty" default:"true"` // Show cached stream bodies +} + +type Aws struct { + 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 { + duckv1.Status `json:",inline"` + + // AddressStatus is the part where the JobSink fulfills the Addressable contract. + // It exposes the endpoint as an URI to get events delivered. + // +optional + duckv1.AddressStatus `json:",inline"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this JobSink + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` +} + +// GetGroupVersionKind returns the GroupVersionKind. +func (*IntegrationSink) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("IntegrationSink") +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// IntegrationSinkList contains a list of IntegrationSink +type IntegrationSinkList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IntegrationSink `json:"items"` +} + +// GetUntypedSpec returns the spec of the IntegrationSink. +func (c *IntegrationSink) GetUntypedSpec() interface{} { + return c.Spec +} + +// GetStatus retrieves the status of the IntegrationSink. Implements the KRShaped interface. +func (c *IntegrationSink) GetStatus() *duckv1.Status { + return &c.Status.Status +} 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 new file mode 100644 index 000000000..c96b83d7d --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/integration_sink_validation.go @@ -0,0 +1,85 @@ +/* +Copyright 2020 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 v1alpha1 + +import ( + "context" + + "knative.dev/pkg/apis" +) + +func (sink *IntegrationSink) Validate(ctx context.Context) *apis.FieldError { + ctx = apis.WithinParent(ctx, sink.ObjectMeta) + return sink.Spec.Validate(ctx).ViaField("spec") +} + +func (spec *IntegrationSinkSpec) Validate(ctx context.Context) *apis.FieldError { + var errs *apis.FieldError + + // Count how many fields are set to ensure mutual exclusivity + sinkSetCount := 0 + if spec.Log != nil { + sinkSetCount++ + } + if spec.Aws != nil { + if spec.Aws.S3 != nil { + sinkSetCount++ + } + if spec.Aws.SQS != nil { + sinkSetCount++ + } + } + + // Validate that only one sink field is set + if sinkSetCount > 1 { + errs = errs.Also(apis.ErrGeneric("only one sink type can be set", "spec")) + } else if sinkSetCount == 0 { + errs = errs.Also(apis.ErrGeneric("at least one sink type must be specified", "spec")) + } + + // 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 { + // Check that AWS Auth is properly configured + if !spec.Aws.Auth.HasAuth() { + errs = errs.Also(apis.ErrMissingField("aws.auth.secret.ref.name")) + } + } + + // 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")) + } + if spec.Aws.S3.Region == "" { + errs = errs.Also(apis.ErrMissingField("aws.s3.region")) + } + } + + // 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")) + } + if spec.Aws.SQS.Region == "" { + errs = errs.Also(apis.ErrMissingField("aws.sqs.region")) + } + } + } + + return errs +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go index 827ebc28b..89e4f3fbe 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go @@ -47,6 +47,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &JobSink{}, &JobSinkList{}, + &IntegrationSink{}, + &IntegrationSinkList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil 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 58c9fdfaf..3dff23adf 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 @@ -24,8 +24,146 @@ package v1alpha1 import ( v1 "k8s.io/api/batch/v1" runtime "k8s.io/apimachinery/pkg/runtime" + 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. +func (in *Aws) DeepCopyInto(out *Aws) { + *out = *in + if in.S3 != nil { + in, out := &in.S3, &out.S3 + *out = new(integrationv1alpha1.AWSS3) + **out = **in + } + if in.SQS != nil { + in, out := &in.SQS, &out.SQS + *out = new(integrationv1alpha1.AWSSQS) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(integrationv1alpha1.Auth) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Aws. +func (in *Aws) DeepCopy() *Aws { + if in == nil { + return nil + } + out := new(Aws) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationSink) DeepCopyInto(out *IntegrationSink) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSink. +func (in *IntegrationSink) DeepCopy() *IntegrationSink { + if in == nil { + return nil + } + out := new(IntegrationSink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IntegrationSink) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationSinkList) DeepCopyInto(out *IntegrationSinkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IntegrationSink, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSinkList. +func (in *IntegrationSinkList) DeepCopy() *IntegrationSinkList { + if in == nil { + return nil + } + out := new(IntegrationSinkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IntegrationSinkList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationSinkSpec) DeepCopyInto(out *IntegrationSinkSpec) { + *out = *in + if in.Aws != nil { + in, out := &in.Aws, &out.Aws + *out = new(Aws) + (*in).DeepCopyInto(*out) + } + if in.Log != nil { + in, out := &in.Log, &out.Log + *out = new(Log) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSinkSpec. +func (in *IntegrationSinkSpec) DeepCopy() *IntegrationSinkSpec { + if in == nil { + return nil + } + out := new(IntegrationSinkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationSinkStatus) DeepCopyInto(out *IntegrationSinkStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.AddressStatus.DeepCopyInto(&out.AddressStatus) + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSinkStatus. +func (in *IntegrationSinkStatus) DeepCopy() *IntegrationSinkStatus { + if in == nil { + return nil + } + out := new(IntegrationSinkStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JobSink) DeepCopyInto(out *JobSink) { *out = *in @@ -143,3 +281,19 @@ func (in *JobStatus) DeepCopy() *JobStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Log) DeepCopyInto(out *Log) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Log. +func (in *Log) DeepCopy() *Log { + if in == nil { + return nil + } + out := new(Log) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_lifecycle.go index 4f25e70e5..cc1270fb8 100644 --- a/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/sources/v1alpha1/integration_lifecycle.go @@ -26,7 +26,7 @@ const ( // IntegrationSourceConditionReady has status True when the IntegrationSource is ready to send events. IntegrationSourceConditionReady = apis.ConditionReady - // IntegrationSourceConditionReceiveAdapterReady has status True when the IntegrationSource's Deployment is ready. + // IntegrationSourceConditionContainerSourceReady has status True when the IntegrationSource's ContainerSource is ready. IntegrationSourceConditionContainerSourceReady apis.ConditionType = "ContainerSourceReady" ) @@ -54,7 +54,7 @@ func (iss *IntegrationSourceStatus) IsReady() bool { } func (s *IntegrationSourceStatus) PropagateContainerSourceStatus(status *v1.ContainerSourceStatus) { - //// Do not copy conditions nor observedGeneration + // ContainerSource status has all we need, hence deep copy it. s.SourceStatus = *status.SourceStatus.DeepCopy() cond := status.GetCondition(apis.ConditionReady) diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go index e901caf43..5ffd41edd 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go @@ -29,6 +29,7 @@ import ( type EventingV1alpha1Interface interface { RESTClient() rest.Interface EventPoliciesGetter + RequestRepliesGetter } // EventingV1alpha1Client is used to interact with features provided by the eventing.knative.dev group. @@ -40,6 +41,10 @@ func (c *EventingV1alpha1Client) EventPolicies(namespace string) EventPolicyInte return newEventPolicies(c, namespace) } +func (c *EventingV1alpha1Client) RequestReplies(namespace string) RequestReplyInterface { + return newRequestReplies(c, namespace) +} + // NewForConfig creates a new EventingV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go index 958cd8661..5d628625c 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go @@ -32,6 +32,10 @@ func (c *FakeEventingV1alpha1) EventPolicies(namespace string) v1alpha1.EventPol return &FakeEventPolicies{c, namespace} } +func (c *FakeEventingV1alpha1) RequestReplies(namespace string) v1alpha1.RequestReplyInterface { + return &FakeRequestReplies{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeEventingV1alpha1) RESTClient() rest.Interface { diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_requestreply.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_requestreply.go new file mode 100644 index 000000000..a1b6fdc6a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_requestreply.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" +) + +// FakeRequestReplies implements RequestReplyInterface +type FakeRequestReplies struct { + Fake *FakeEventingV1alpha1 + ns string +} + +var requestrepliesResource = v1alpha1.SchemeGroupVersion.WithResource("requestreplies") + +var requestrepliesKind = v1alpha1.SchemeGroupVersion.WithKind("RequestReply") + +// Get takes name of the requestReply, and returns the corresponding requestReply object, and an error if there is any. +func (c *FakeRequestReplies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RequestReply, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(requestrepliesResource, c.ns, name), &v1alpha1.RequestReply{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RequestReply), err +} + +// List takes label and field selectors, and returns the list of RequestReplies that match those selectors. +func (c *FakeRequestReplies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RequestReplyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(requestrepliesResource, requestrepliesKind, c.ns, opts), &v1alpha1.RequestReplyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.RequestReplyList{ListMeta: obj.(*v1alpha1.RequestReplyList).ListMeta} + for _, item := range obj.(*v1alpha1.RequestReplyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested requestReplies. +func (c *FakeRequestReplies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(requestrepliesResource, c.ns, opts)) + +} + +// Create takes the representation of a requestReply and creates it. Returns the server's representation of the requestReply, and an error, if there is any. +func (c *FakeRequestReplies) Create(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.CreateOptions) (result *v1alpha1.RequestReply, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(requestrepliesResource, c.ns, requestReply), &v1alpha1.RequestReply{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RequestReply), err +} + +// Update takes the representation of a requestReply and updates it. Returns the server's representation of the requestReply, and an error, if there is any. +func (c *FakeRequestReplies) Update(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (result *v1alpha1.RequestReply, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(requestrepliesResource, c.ns, requestReply), &v1alpha1.RequestReply{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RequestReply), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRequestReplies) UpdateStatus(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (*v1alpha1.RequestReply, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(requestrepliesResource, "status", c.ns, requestReply), &v1alpha1.RequestReply{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RequestReply), err +} + +// Delete takes name of the requestReply and deletes it. Returns an error if one occurs. +func (c *FakeRequestReplies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(requestrepliesResource, c.ns, name, opts), &v1alpha1.RequestReply{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRequestReplies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(requestrepliesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.RequestReplyList{}) + return err +} + +// Patch applies the patch and returns the patched requestReply. +func (c *FakeRequestReplies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RequestReply, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(requestrepliesResource, c.ns, name, pt, data, subresources...), &v1alpha1.RequestReply{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RequestReply), err +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go index d5bd1a045..96c08942a 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1alpha1 type EventPolicyExpansion interface{} + +type RequestReplyExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/requestreply.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/requestreply.go new file mode 100644 index 000000000..01742674f --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/requestreply.go @@ -0,0 +1,195 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + scheme "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +// RequestRepliesGetter has a method to return a RequestReplyInterface. +// A group's client should implement this interface. +type RequestRepliesGetter interface { + RequestReplies(namespace string) RequestReplyInterface +} + +// RequestReplyInterface has methods to work with RequestReply resources. +type RequestReplyInterface interface { + Create(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.CreateOptions) (*v1alpha1.RequestReply, error) + Update(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (*v1alpha1.RequestReply, error) + UpdateStatus(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (*v1alpha1.RequestReply, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RequestReply, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RequestReplyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RequestReply, err error) + RequestReplyExpansion +} + +// requestReplies implements RequestReplyInterface +type requestReplies struct { + client rest.Interface + ns string +} + +// newRequestReplies returns a RequestReplies +func newRequestReplies(c *EventingV1alpha1Client, namespace string) *requestReplies { + return &requestReplies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the requestReply, and returns the corresponding requestReply object, and an error if there is any. +func (c *requestReplies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RequestReply, err error) { + result = &v1alpha1.RequestReply{} + err = c.client.Get(). + Namespace(c.ns). + Resource("requestreplies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RequestReplies that match those selectors. +func (c *requestReplies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RequestReplyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.RequestReplyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("requestreplies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested requestReplies. +func (c *requestReplies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("requestreplies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a requestReply and creates it. Returns the server's representation of the requestReply, and an error, if there is any. +func (c *requestReplies) Create(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.CreateOptions) (result *v1alpha1.RequestReply, err error) { + result = &v1alpha1.RequestReply{} + err = c.client.Post(). + Namespace(c.ns). + Resource("requestreplies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(requestReply). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a requestReply and updates it. Returns the server's representation of the requestReply, and an error, if there is any. +func (c *requestReplies) Update(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (result *v1alpha1.RequestReply, err error) { + result = &v1alpha1.RequestReply{} + err = c.client.Put(). + Namespace(c.ns). + Resource("requestreplies"). + Name(requestReply.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(requestReply). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *requestReplies) UpdateStatus(ctx context.Context, requestReply *v1alpha1.RequestReply, opts v1.UpdateOptions) (result *v1alpha1.RequestReply, err error) { + result = &v1alpha1.RequestReply{} + err = c.client.Put(). + Namespace(c.ns). + Resource("requestreplies"). + Name(requestReply.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(requestReply). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the requestReply and deletes it. Returns an error if one occurs. +func (c *requestReplies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("requestreplies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *requestReplies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("requestreplies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched requestReply. +func (c *requestReplies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RequestReply, err error) { + result = &v1alpha1.RequestReply{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("requestreplies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_integrationsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_integrationsink.go new file mode 100644 index 000000000..690b2a948 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_integrationsink.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" +) + +// FakeIntegrationSinks implements IntegrationSinkInterface +type FakeIntegrationSinks struct { + Fake *FakeSinksV1alpha1 + ns string +} + +var integrationsinksResource = v1alpha1.SchemeGroupVersion.WithResource("integrationsinks") + +var integrationsinksKind = v1alpha1.SchemeGroupVersion.WithKind("IntegrationSink") + +// Get takes name of the integrationSink, and returns the corresponding integrationSink object, and an error if there is any. +func (c *FakeIntegrationSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IntegrationSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(integrationsinksResource, c.ns, name), &v1alpha1.IntegrationSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.IntegrationSink), err +} + +// List takes label and field selectors, and returns the list of IntegrationSinks that match those selectors. +func (c *FakeIntegrationSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IntegrationSinkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(integrationsinksResource, integrationsinksKind, c.ns, opts), &v1alpha1.IntegrationSinkList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.IntegrationSinkList{ListMeta: obj.(*v1alpha1.IntegrationSinkList).ListMeta} + for _, item := range obj.(*v1alpha1.IntegrationSinkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested integrationSinks. +func (c *FakeIntegrationSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(integrationsinksResource, c.ns, opts)) + +} + +// Create takes the representation of a integrationSink and creates it. Returns the server's representation of the integrationSink, and an error, if there is any. +func (c *FakeIntegrationSinks) Create(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.CreateOptions) (result *v1alpha1.IntegrationSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(integrationsinksResource, c.ns, integrationSink), &v1alpha1.IntegrationSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.IntegrationSink), err +} + +// Update takes the representation of a integrationSink and updates it. Returns the server's representation of the integrationSink, and an error, if there is any. +func (c *FakeIntegrationSinks) Update(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (result *v1alpha1.IntegrationSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(integrationsinksResource, c.ns, integrationSink), &v1alpha1.IntegrationSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.IntegrationSink), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeIntegrationSinks) UpdateStatus(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (*v1alpha1.IntegrationSink, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(integrationsinksResource, "status", c.ns, integrationSink), &v1alpha1.IntegrationSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.IntegrationSink), err +} + +// Delete takes name of the integrationSink and deletes it. Returns an error if one occurs. +func (c *FakeIntegrationSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(integrationsinksResource, c.ns, name, opts), &v1alpha1.IntegrationSink{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIntegrationSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(integrationsinksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.IntegrationSinkList{}) + return err +} + +// Patch applies the patch and returns the patched integrationSink. +func (c *FakeIntegrationSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IntegrationSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(integrationsinksResource, c.ns, name, pt, data, subresources...), &v1alpha1.IntegrationSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.IntegrationSink), err +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go index f64a39a5c..c3cbdcfe5 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go @@ -28,6 +28,10 @@ type FakeSinksV1alpha1 struct { *testing.Fake } +func (c *FakeSinksV1alpha1) IntegrationSinks(namespace string) v1alpha1.IntegrationSinkInterface { + return &FakeIntegrationSinks{c, namespace} +} + func (c *FakeSinksV1alpha1) JobSinks(namespace string) v1alpha1.JobSinkInterface { return &FakeJobSinks{c, namespace} } diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go index 029b7bee8..b444c4460 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go @@ -18,4 +18,6 @@ limitations under the License. package v1alpha1 +type IntegrationSinkExpansion interface{} + type JobSinkExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/integrationsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/integrationsink.go new file mode 100644 index 000000000..3e75e3aed --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/integrationsink.go @@ -0,0 +1,195 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" + scheme "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +// IntegrationSinksGetter has a method to return a IntegrationSinkInterface. +// A group's client should implement this interface. +type IntegrationSinksGetter interface { + IntegrationSinks(namespace string) IntegrationSinkInterface +} + +// IntegrationSinkInterface has methods to work with IntegrationSink resources. +type IntegrationSinkInterface interface { + Create(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.CreateOptions) (*v1alpha1.IntegrationSink, error) + Update(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (*v1alpha1.IntegrationSink, error) + UpdateStatus(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (*v1alpha1.IntegrationSink, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.IntegrationSink, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.IntegrationSinkList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IntegrationSink, err error) + IntegrationSinkExpansion +} + +// integrationSinks implements IntegrationSinkInterface +type integrationSinks struct { + client rest.Interface + ns string +} + +// newIntegrationSinks returns a IntegrationSinks +func newIntegrationSinks(c *SinksV1alpha1Client, namespace string) *integrationSinks { + return &integrationSinks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the integrationSink, and returns the corresponding integrationSink object, and an error if there is any. +func (c *integrationSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IntegrationSink, err error) { + result = &v1alpha1.IntegrationSink{} + err = c.client.Get(). + Namespace(c.ns). + Resource("integrationsinks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IntegrationSinks that match those selectors. +func (c *integrationSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IntegrationSinkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.IntegrationSinkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("integrationsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested integrationSinks. +func (c *integrationSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("integrationsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a integrationSink and creates it. Returns the server's representation of the integrationSink, and an error, if there is any. +func (c *integrationSinks) Create(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.CreateOptions) (result *v1alpha1.IntegrationSink, err error) { + result = &v1alpha1.IntegrationSink{} + err = c.client.Post(). + Namespace(c.ns). + Resource("integrationsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(integrationSink). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a integrationSink and updates it. Returns the server's representation of the integrationSink, and an error, if there is any. +func (c *integrationSinks) Update(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (result *v1alpha1.IntegrationSink, err error) { + result = &v1alpha1.IntegrationSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("integrationsinks"). + Name(integrationSink.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(integrationSink). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *integrationSinks) UpdateStatus(ctx context.Context, integrationSink *v1alpha1.IntegrationSink, opts v1.UpdateOptions) (result *v1alpha1.IntegrationSink, err error) { + result = &v1alpha1.IntegrationSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("integrationsinks"). + Name(integrationSink.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(integrationSink). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the integrationSink and deletes it. Returns an error if one occurs. +func (c *integrationSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("integrationsinks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *integrationSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("integrationsinks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched integrationSink. +func (c *integrationSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IntegrationSink, err error) { + result = &v1alpha1.IntegrationSink{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("integrationsinks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go index 2012a8f57..9d394dfb0 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go @@ -28,6 +28,7 @@ import ( type SinksV1alpha1Interface interface { RESTClient() rest.Interface + IntegrationSinksGetter JobSinksGetter } @@ -36,6 +37,10 @@ type SinksV1alpha1Client struct { restClient rest.Interface } +func (c *SinksV1alpha1Client) IntegrationSinks(namespace string) IntegrationSinkInterface { + return newIntegrationSinks(c, namespace) +} + func (c *SinksV1alpha1Client) JobSinks(namespace string) JobSinkInterface { return newJobSinks(c, namespace) } diff --git a/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go index e3f601930..1d021242b 100644 --- a/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go +++ b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go @@ -25,3 +25,11 @@ type EventPolicyListerExpansion interface{} // EventPolicyNamespaceListerExpansion allows custom methods to be added to // EventPolicyNamespaceLister. type EventPolicyNamespaceListerExpansion interface{} + +// RequestReplyListerExpansion allows custom methods to be added to +// RequestReplyLister. +type RequestReplyListerExpansion interface{} + +// RequestReplyNamespaceListerExpansion allows custom methods to be added to +// RequestReplyNamespaceLister. +type RequestReplyNamespaceListerExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/requestreply.go b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/requestreply.go new file mode 100644 index 000000000..fdfe4d17e --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/requestreply.go @@ -0,0 +1,99 @@ +/* +Copyright 2021 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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" +) + +// RequestReplyLister helps list RequestReplies. +// All objects returned here must be treated as read-only. +type RequestReplyLister interface { + // List lists all RequestReplies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.RequestReply, err error) + // RequestReplies returns an object that can list and get RequestReplies. + RequestReplies(namespace string) RequestReplyNamespaceLister + RequestReplyListerExpansion +} + +// requestReplyLister implements the RequestReplyLister interface. +type requestReplyLister struct { + indexer cache.Indexer +} + +// NewRequestReplyLister returns a new RequestReplyLister. +func NewRequestReplyLister(indexer cache.Indexer) RequestReplyLister { + return &requestReplyLister{indexer: indexer} +} + +// List lists all RequestReplies in the indexer. +func (s *requestReplyLister) List(selector labels.Selector) (ret []*v1alpha1.RequestReply, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.RequestReply)) + }) + return ret, err +} + +// RequestReplies returns an object that can list and get RequestReplies. +func (s *requestReplyLister) RequestReplies(namespace string) RequestReplyNamespaceLister { + return requestReplyNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// RequestReplyNamespaceLister helps list and get RequestReplies. +// All objects returned here must be treated as read-only. +type RequestReplyNamespaceLister interface { + // List lists all RequestReplies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.RequestReply, err error) + // Get retrieves the RequestReply from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.RequestReply, error) + RequestReplyNamespaceListerExpansion +} + +// requestReplyNamespaceLister implements the RequestReplyNamespaceLister +// interface. +type requestReplyNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all RequestReplies in the indexer for a given namespace. +func (s requestReplyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RequestReply, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.RequestReply)) + }) + return ret, err +} + +// Get retrieves the RequestReply from the indexer for a given namespace and name. +func (s requestReplyNamespaceLister) Get(name string) (*v1alpha1.RequestReply, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("requestreply"), name) + } + return obj.(*v1alpha1.RequestReply), nil +} diff --git a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go index 718a744c1..eedea290d 100644 --- a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go +++ b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go @@ -57,6 +57,9 @@ const ( BrokerFilterServerTLSSecretName = "mt-broker-filter-server-tls" //nolint:gosec // This is not a hardcoded credential // BrokerIngressServerTLSSecretName is the name of the tls secret for the broker ingress server BrokerIngressServerTLSSecretName = "mt-broker-ingress-server-tls" //nolint:gosec // This is not a hardcoded credential + + // IntegrationSinkDispatcherServerTLSSecretName is the name of the tls secret for the integration sink dispatcher server + IntegrationSinkDispatcherServerTLSSecretName = "integration-sink-server-tls" //nolint:gosec // This is not a hardcoded credential ) type ClientConfig struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 7ec589214..1af7259a5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -991,7 +991,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.20241119173100-ebe99e655146 +# knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6 ## explicit; go 1.22.7 knative.dev/eventing/pkg/adapter/v2 knative.dev/eventing/pkg/adapter/v2/util/crstatusevent