Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
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
knative-automation committed Apr 28, 2023
1 parent 2d6ee7f commit 83753db
Show file tree
Hide file tree
Showing 29 changed files with 1,572 additions and 23 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ require (
k8s.io/client-go v0.25.4
k8s.io/code-generator v0.25.4
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2
knative.dev/caching v0.0.0-20230428013936-e773a6225cfe
knative.dev/eventing v0.37.1-0.20230428013435-e2f1c7743c23
knative.dev/caching v0.0.0-20230428120151-d563a6163387
knative.dev/eventing v0.37.1-0.20230428060039-7f4deb572cd1
knative.dev/hack v0.0.0-20230428013635-6e4569cc679d
knative.dev/pkg v0.0.0-20230428013435-aacec7fd7a8e
knative.dev/serving v0.37.1-0.20230428023332-1dd07a7cd5e1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1409,10 +1409,10 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/caching v0.0.0-20230428013936-e773a6225cfe h1:6xySIps24whmdQJe2a9lNgDLY8jEQJYXdTqAyR2BQh8=
knative.dev/caching v0.0.0-20230428013936-e773a6225cfe/go.mod h1:d261UN7aE93sODDnqVuhlaRcEUPjSBOyrUlBxuBp+UU=
knative.dev/eventing v0.37.1-0.20230428013435-e2f1c7743c23 h1:4MfO7wW2C2uPpD5bKFDwGkpou72tIgxQeWluB3hUAO0=
knative.dev/eventing v0.37.1-0.20230428013435-e2f1c7743c23/go.mod h1:jkRCS2JQWe9hzRRuzx5GnWZ43xowbWHPntoCNsnmsV0=
knative.dev/caching v0.0.0-20230428120151-d563a6163387 h1:RHBoXr8nlzqESMnFFjj8Tn8S3DBOtSDT9kxVkuV2Ft8=
knative.dev/caching v0.0.0-20230428120151-d563a6163387/go.mod h1:T9o6a5CZohhIezyujdVOz4lOkuV8QgjQlUNqq9N1k+4=
knative.dev/eventing v0.37.1-0.20230428060039-7f4deb572cd1 h1:k5qzh2MwVsW2G5TBqarbNU4aFO06cyKV7+dbvs06HiQ=
knative.dev/eventing v0.37.1-0.20230428060039-7f4deb572cd1/go.mod h1:jkRCS2JQWe9hzRRuzx5GnWZ43xowbWHPntoCNsnmsV0=
knative.dev/hack v0.0.0-20230428013635-6e4569cc679d h1:cteEZUC7WpZA+bSl4ZEt0MXpk/FeUpI3pX1q2TIjHJI=
knative.dev/hack v0.0.0-20230428013635-6e4569cc679d/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20230419144338-e5d04e805e50 h1:X9rPBYr7Vrm075q0iXTr7/0oklkYoyqvlnrUwNzcUhI=
Expand Down
20 changes: 20 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/doc.go
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
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)
}
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"
}
}
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)
}
}
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
}
Loading

0 comments on commit 83753db

Please sign in to comment.