Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing a9320dc...32d7dd8:
  > 32d7dd8 Allow configuring whether to allow cross namespaces Brokers configuration references (# 7455)
  > 203fa93 Add deprecation warnings for EventType v1beta1 (# 7453)
  > e5f2814 support auto generation of Sequence identity service account [OIDC] (# 7361)
  > 8ebe869 Deprecate EventType v1b1 API (# 7303)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Nov 17, 2023
1 parent 3ba8f3a commit 5617da2
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
k8s.io/code-generator v0.27.6
k8s.io/utils v0.0.0-20230209194617-a36077c30491
knative.dev/caching v0.0.0-20231115015816-e58c04ff4f9a
knative.dev/eventing v0.39.1-0.20231115163654-a9320dc13582
knative.dev/eventing v0.39.1-0.20231116194852-32d7dd83e764
knative.dev/hack v0.0.0-20231109190034-5deaddeb51a7
knative.dev/pkg v0.0.0-20231115001034-97c7258e3a98
knative.dev/serving v0.39.1-0.20231116002444-75613869a913
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,8 @@ k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPB
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/caching v0.0.0-20231115015816-e58c04ff4f9a h1:7Gn7IImFTdTXW5DG/PYQVHZuWPltRz2kr381wtwuh2Q=
knative.dev/caching v0.0.0-20231115015816-e58c04ff4f9a/go.mod h1:kOQlfb6k1kHQcl4yGD58h3soJXioXdRVbHjvXKmrFzU=
knative.dev/eventing v0.39.1-0.20231115163654-a9320dc13582 h1:4DuZYXwxfJHTQOKcUoQjdKzogXVJ0R1t9DqoupxtLXw=
knative.dev/eventing v0.39.1-0.20231115163654-a9320dc13582/go.mod h1:LGZfBR1ykKiLBF06aX+C7vqe4HogiNc9MmFpJz9lvtw=
knative.dev/eventing v0.39.1-0.20231116194852-32d7dd83e764 h1:LCaVi6gvluCqSf2FwOpUXHrKcrUAZ6N92/PJ8b/TgE0=
knative.dev/eventing v0.39.1-0.20231116194852-32d7dd83e764/go.mod h1:LGZfBR1ykKiLBF06aX+C7vqe4HogiNc9MmFpJz9lvtw=
knative.dev/hack v0.0.0-20231109190034-5deaddeb51a7 h1:HXf7M7n9jwn+Hp904r0HXRSymf+DLXSciFpXVpCg+Bs=
knative.dev/hack v0.0.0-20231109190034-5deaddeb51a7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20231109233957-8f3c5211035b h1:xdj40UcZBX4QeZiOOuCZDDGLM7gB+Wg07AKT7KVFlD0=
Expand Down
2 changes: 2 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type Defaults struct {
type ClassAndBrokerConfig struct {
BrokerClass string `json:"brokerClass,omitempty"`
*BrokerConfig `json:",inline"`

DisallowDifferentNamespaceConfig *bool `json:"disallowDifferentNamespaceConfig,omitempty"`
}

// BrokerConfig contains configuration for a given namespace for broker. Allows
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,31 @@ import (

"knative.dev/pkg/apis"
"knative.dev/pkg/kmp"

"knative.dev/eventing/pkg/apis/config"
)

const (
BrokerClassAnnotationKey = "eventing.knative.dev/broker.class"
)

func (b *Broker) Validate(ctx context.Context) *apis.FieldError {
withNS := apis.AllowDifferentNamespace(apis.WithinParent(ctx, b.ObjectMeta))
ctx = apis.WithinParent(ctx, b.ObjectMeta)

cfg := config.FromContextOrDefaults(ctx)
var brConfig *config.ClassAndBrokerConfig
if cfg.Defaults != nil {
if c, ok := cfg.Defaults.NamespaceDefaultsConfig[b.GetNamespace()]; ok {
brConfig = c
} else {
brConfig = cfg.Defaults.ClusterDefault
}
}

withNS := ctx
if brConfig == nil || brConfig.DisallowDifferentNamespaceConfig == nil || !*brConfig.DisallowDifferentNamespaceConfig {
withNS = apis.AllowDifferentNamespace(ctx)
}

// Make sure a BrokerClassAnnotation exists
var errs *apis.FieldError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// EventType represents a type of event that can be consumed from a Broker.
// Deprecated: use v1beta2.EventType instead.
type EventType struct {
metav1.TypeMeta `json:",inline"`
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import (
duckv1 "knative.dev/pkg/apis/duck/v1"
)

var sCondSet = apis.NewLivingConditionSet(SequenceConditionReady, SequenceConditionChannelsReady, SequenceConditionSubscriptionsReady, SequenceConditionAddressable)
var sCondSet = apis.NewLivingConditionSet(SequenceConditionReady, SequenceConditionChannelsReady, SequenceConditionSubscriptionsReady, SequenceConditionAddressable,
SequenceConditionOIDCIdentityCreated)

const (
// SequenceConditionReady has status True when all subconditions below have been set to True.
Expand All @@ -45,6 +46,10 @@ const (
// SequenceConditionAddressable has status true when this Sequence meets
// the Addressable contract and has a non-empty hostname.
SequenceConditionAddressable apis.ConditionType = "Addressable"

// SequenceConditionOIDCIdentityCreated has status True when the OIDCIdentity has been created.
// This condition is only relevant if the OIDC feature is enabled.
SequenceConditionOIDCIdentityCreated apis.ConditionType = "OIDCIdentityCreated"
)

// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
Expand Down Expand Up @@ -190,3 +195,23 @@ func (ss *SequenceStatus) setAddress(address *duckv1.Addressable) {
sCondSet.Manage(ss).MarkTrue(SequenceConditionAddressable)
}
}

// MarkOIDCIdentityCreatedSucceeded marks the OIDCIdentityCreated condition as true.
func (ss *SequenceStatus) MarkOIDCIdentityCreatedSucceeded() {
sCondSet.Manage(ss).MarkTrue(SequenceConditionOIDCIdentityCreated)
}

// MarkOIDCIdentityCreatedSucceededWithReason marks the OIDCIdentityCreated condition as true with the given reason.
func (ss *SequenceStatus) MarkOIDCIdentityCreatedSucceededWithReason(reason, messageFormat string, messageA ...interface{}) {
sCondSet.Manage(ss).MarkTrueWithReason(SequenceConditionOIDCIdentityCreated, reason, messageFormat, messageA...)
}

// MarkOIDCIdentityCreatedFailed marks the OIDCIdentityCreated condition as false with the given reason.
func (ss *SequenceStatus) MarkOIDCIdentityCreatedFailed(reason, messageFormat string, messageA ...interface{}) {
sCondSet.Manage(ss).MarkFalse(SequenceConditionOIDCIdentityCreated, reason, messageFormat, messageA...)
}

// MarkOIDCIdentityCreatedUnknown marks the OIDCIdentityCreated condition as unknown with the given reason.
func (ss *SequenceStatus) MarkOIDCIdentityCreatedUnknown(reason, messageFormat string, messageA ...interface{}) {
sCondSet.Manage(ss).MarkUnknown(SequenceConditionOIDCIdentityCreated, reason, messageFormat, messageA...)
}
30 changes: 30 additions & 0 deletions vendor/knative.dev/eventing/pkg/reconciler/testing/v1/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ package testing

import (
"context"
"fmt"
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/eventing/pkg/apis/feature"
flowsv1 "knative.dev/eventing/pkg/apis/flows/v1"
messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"
duckv1 "knative.dev/pkg/apis/duck/v1"
Expand Down Expand Up @@ -113,3 +115,31 @@ func WithSequenceAddressableNotReady(reason, message string) SequenceOption {
p.Status.MarkAddressableNotReady(reason, message)
}
}

func WithSequenceOIDCIdentityCreatedSucceeded() SequenceOption {
return func(s *flowsv1.Sequence) {
s.Status.MarkOIDCIdentityCreatedSucceeded()
}
}

func WithSequenceOIDCIdentityCreatedSucceededBecauseOIDCFeatureDisabled() SequenceOption {
return func(s *flowsv1.Sequence) {
s.Status.MarkOIDCIdentityCreatedSucceededWithReason(fmt.Sprintf("%s feature disabled", feature.OIDCAuthentication), "")
}
}

func WithSequenceOIDCIdentityCreatedFailed(reason, message string) SequenceOption {
return func(s *flowsv1.Sequence) {
s.Status.MarkOIDCIdentityCreatedFailed(reason, message)
}
}

func WithSequenceOIDCServiceAccountName(name string) SequenceOption {
return func(s *flowsv1.Sequence) {
if s.Status.Auth == nil {
s.Status.Auth = &duckv1.AuthStatus{}
}

s.Status.Auth.ServiceAccountName = &name
}
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ k8s.io/utils/trace
## explicit; go 1.18
knative.dev/caching/pkg/apis/caching
knative.dev/caching/pkg/apis/caching/v1alpha1
# knative.dev/eventing v0.39.1-0.20231115163654-a9320dc13582
# knative.dev/eventing v0.39.1-0.20231116194852-32d7dd83e764
## explicit; go 1.19
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck
Expand Down

0 comments on commit 5617da2

Please sign in to comment.