-
Notifications
You must be signed in to change notification settings - Fork 98
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 e2f1c77...7f4deb5:%0A > 7f4deb5 EventType v1b2 API addition (# 6893)%0A > 1f917d0 Refactor PingSource adapter client creation (# 6880)%0Abumping knative.dev/caching e773a62...d563a61:%0A > d563a61 upgrade to latest dependencies (# 747) Signed-off-by: Knative Automation <automation@knative.team>
- Loading branch information
1 parent
2d6ee7f
commit 83753db
Showing
29 changed files
with
1,572 additions
and
23 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
20 changes: 20 additions & 0 deletions
20
vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/doc.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,20 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
// Package v1beta2 is the v1beta2 version of the API. | ||
// +k8s:deepcopy-gen=package | ||
// +groupName=eventing.knative.dev | ||
package v1beta2 |
34 changes: 34 additions & 0 deletions
34
vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_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 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. | ||
*/ | ||
|
||
package v1beta2 | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"knative.dev/pkg/apis" | ||
) | ||
|
||
// ConvertTo implements apis.Convertible | ||
func (source *EventType) ConvertTo(ctx context.Context, to apis.Convertible) error { | ||
return fmt.Errorf("v1beta2 is the highest known version, got: %T", to) | ||
} | ||
|
||
// ConvertFrom implements apis.Convertible | ||
func (sink *EventType) ConvertFrom(ctx context.Context, from apis.Convertible) error { | ||
return fmt.Errorf("v1beta2 is the highest known version, got: %T", from) | ||
} |
29 changes: 29 additions & 0 deletions
29
vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_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,29 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta2 | ||
|
||
import "context" | ||
|
||
func (et *EventType) SetDefaults(ctx context.Context) { | ||
et.Spec.SetDefaults(ctx) | ||
} | ||
|
||
func (ets *EventTypeSpec) SetDefaults(ctx context.Context) { | ||
if ets.Broker == "" { | ||
ets.Broker = "default" | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_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,104 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta2 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
|
||
eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" | ||
"knative.dev/pkg/apis" | ||
) | ||
|
||
var eventTypeCondSet = apis.NewLivingConditionSet(EventTypeConditionBrokerExists, EventTypeConditionBrokerReady) | ||
|
||
const ( | ||
EventTypeConditionReady = apis.ConditionReady | ||
EventTypeConditionBrokerExists apis.ConditionType = "BrokerExists" | ||
EventTypeConditionBrokerReady apis.ConditionType = "BrokerReady" | ||
) | ||
|
||
// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. | ||
func (*EventType) GetConditionSet() apis.ConditionSet { | ||
return eventTypeCondSet | ||
} | ||
|
||
// GetCondition returns the condition currently associated with the given type, or nil. | ||
func (et *EventTypeStatus) GetCondition(t apis.ConditionType) *apis.Condition { | ||
return eventTypeCondSet.Manage(et).GetCondition(t) | ||
} | ||
|
||
// IsReady returns true if the resource is ready overall. | ||
func (et *EventTypeStatus) IsReady() bool { | ||
return eventTypeCondSet.Manage(et).IsHappy() | ||
} | ||
|
||
// GetTopLevelCondition returns the top level Condition. | ||
func (et *EventTypeStatus) GetTopLevelCondition() *apis.Condition { | ||
return eventTypeCondSet.Manage(et).GetTopLevelCondition() | ||
} | ||
|
||
// InitializeConditions sets relevant unset conditions to Unknown state. | ||
func (et *EventTypeStatus) InitializeConditions() { | ||
eventTypeCondSet.Manage(et).InitializeConditions() | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerExists() { | ||
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerExists) | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerDoesNotExist() { | ||
eventTypeCondSet.Manage(et).MarkFalse(EventTypeConditionBrokerExists, "BrokerDoesNotExist", "Broker does not exist") | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerExistsUnknown(reason, messageFormat string, messageA ...interface{}) { | ||
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerExists, reason, messageFormat, messageA...) | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerReady() { | ||
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerReady) | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerFailed(reason, messageFormat string, messageA ...interface{}) { | ||
eventTypeCondSet.Manage(et).MarkFalse(EventTypeConditionBrokerReady, reason, messageFormat, messageA...) | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerUnknown(reason, messageFormat string, messageA ...interface{}) { | ||
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerReady, reason, messageFormat, messageA...) | ||
} | ||
|
||
func (et *EventTypeStatus) MarkBrokerNotConfigured() { | ||
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerReady, | ||
"BrokerNotConfigured", "Broker has not yet been reconciled.") | ||
} | ||
|
||
func (et *EventTypeStatus) PropagateBrokerStatus(bs *eventingv1.BrokerStatus) { | ||
bc := bs.GetConditionSet().Manage(bs).GetTopLevelCondition() | ||
if bc == nil { | ||
et.MarkBrokerNotConfigured() | ||
return | ||
} | ||
switch { | ||
case bc.Status == corev1.ConditionUnknown: | ||
et.MarkBrokerUnknown(bc.Reason, bc.Message) | ||
case bc.Status == corev1.ConditionTrue: | ||
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerReady) | ||
case bc.Status == corev1.ConditionFalse: | ||
et.MarkBrokerFailed(bc.Reason, bc.Message) | ||
default: | ||
et.MarkBrokerUnknown("BrokerUnknown", "The status of Broker is invalid: %v", bc.Status) | ||
} | ||
} |
120 changes: 120 additions & 0 deletions
120
vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_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,120 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta2 | ||
|
||
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" | ||
) | ||
|
||
// +genclient | ||
// +genreconciler | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// EventType represents a type of event that can be consumed from a Broker. | ||
type EventType struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec defines the desired state of the EventType. | ||
Spec EventTypeSpec `json:"spec,omitempty"` | ||
|
||
// Status represents the current state of the EventType. | ||
// This data may be out of date. | ||
// +optional | ||
// TODO might be removed https://github.com/knative/eventing/issues/2750 | ||
Status EventTypeStatus `json:"status,omitempty"` | ||
} | ||
|
||
var ( | ||
// Check that EventType can be validated, can be defaulted, and has immutable fields. | ||
_ apis.Validatable = (*EventType)(nil) | ||
_ apis.Defaultable = (*EventType)(nil) | ||
|
||
// Check that EventType can return its spec untyped. | ||
_ apis.HasSpec = (*EventType)(nil) | ||
|
||
_ runtime.Object = (*EventType)(nil) | ||
|
||
// Check that we can create OwnerReferences to an EventType. | ||
_ kmeta.OwnerRefable = (*EventType)(nil) | ||
|
||
// Check that the type conforms to the duck Knative Resource shape. | ||
_ duckv1.KRShaped = (*EventType)(nil) | ||
) | ||
|
||
type EventTypeSpec struct { | ||
// Type represents the CloudEvents type. It is authoritative. | ||
Type string `json:"type"` | ||
// Source is a URI, it represents the CloudEvents source. | ||
// +optional | ||
Source *apis.URL `json:"source,omitempty"` | ||
// Schema is a URI, it represents the CloudEvents schemaurl extension attribute. | ||
// It may be a JSON schema, a protobuf schema, etc. It is optional. | ||
// +optional | ||
Schema *apis.URL `json:"schema,omitempty"` | ||
// SchemaData allows the CloudEvents schema to be stored directly in the | ||
// EventType. Content is dependent on the encoding. Optional attribute. | ||
// The contents are not validated or manipulated by the system. | ||
// +optional | ||
SchemaData string `json:"schemaData,omitempty"` | ||
// TODO remove https://github.com/knative/eventing/issues/2750 | ||
// Broker refers to the Broker that can provide the EventType. | ||
// +optional | ||
Broker string `json:"broker,omitempty"` | ||
// Description is an optional field used to describe the EventType, in any meaningful way. | ||
// +optional | ||
Description string `json:"description,omitempty"` | ||
} | ||
|
||
// EventTypeStatus represents the current state of a EventType. | ||
type EventTypeStatus 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"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// EventTypeList is a collection of EventTypes. | ||
type EventTypeList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []EventType `json:"items"` | ||
} | ||
|
||
// GetGroupVersionKind returns GroupVersionKind for EventType | ||
func (p *EventType) GetGroupVersionKind() schema.GroupVersionKind { | ||
return SchemeGroupVersion.WithKind("EventType") | ||
} | ||
|
||
// GetUntypedSpec returns the spec of the EventType. | ||
func (e *EventType) GetUntypedSpec() interface{} { | ||
return e.Spec | ||
} | ||
|
||
// GetStatus retrieves the status of the EventType. Implements the KRShaped interface. | ||
func (t *EventType) GetStatus() *duckv1.Status { | ||
return &t.Status.Status | ||
} |
Oops, something went wrong.