-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
d080f7f
commit ddd3b7f
Showing
32 changed files
with
1,862 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_conversion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
43 changes: 43 additions & 0 deletions
43
vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_defaults.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
106 changes: 106 additions & 0 deletions
106
vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_lifecycle.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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...) | ||
} |
122 changes: 122 additions & 0 deletions
122
vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/requestreply_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
Oops, something went wrong.