From 0b7e6291dc1b307da7dc259db03f8cb2a7d8b18a Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Mon, 1 Jul 2024 01:43:53 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/eventing a6ac811...3b1bfb4: > 3b1bfb4 feat(test): create knsubscribe rolebinding to current user in e2e test setup (# 8055) > beb71be Add EventPolicy Reconciler (# 8024) > 6992e6f Avoid fatal errors for unknown features flags that can be added in a future release (# 8051) Signed-off-by: Knative Automation --- go.mod | 2 +- go.sum | 4 +- .../v1alpha1/eventpolicy_lifecycle.go | 44 ++++++++++++++----- .../eventing/pkg/apis/feature/features.go | 4 +- vendor/modules.txt | 2 +- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 479c34e8..8f5e2646 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 - knative.dev/eventing v0.41.1-0.20240627060150-a6ac8111e82f + knative.dev/eventing v0.41.1-0.20240628173119-3b1bfb4674ca knative.dev/hack v0.0.0-20240607132042-09143140a254 knative.dev/pkg v0.0.0-20240626134149-3f6a546ac3a4 ) diff --git a/go.sum b/go.sum index cb0d5ffa..542a6a32 100644 --- a/go.sum +++ b/go.sum @@ -701,8 +701,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.41.1-0.20240627060150-a6ac8111e82f h1:FuJQSlda7F1Yk1eaSSvWXq7ic9h4Lo/s9EjMnKCoFcg= -knative.dev/eventing v0.41.1-0.20240627060150-a6ac8111e82f/go.mod h1:3h0QrfHELs61mrTI4GDPEQh4rwsap0YYA5XgRrNgnlc= +knative.dev/eventing v0.41.1-0.20240628173119-3b1bfb4674ca h1:taxxQ07d3zNfCLNeG2200VOnMWGFB5OL3YA6JB4tqQY= +knative.dev/eventing v0.41.1-0.20240628173119-3b1bfb4674ca/go.mod h1:3h0QrfHELs61mrTI4GDPEQh4rwsap0YYA5XgRrNgnlc= knative.dev/hack v0.0.0-20240607132042-09143140a254 h1:1YFnu3U6dWZg0oxm6GU8kEdA9A+BvSWKJO7sg3N0kq8= knative.dev/hack v0.0.0-20240607132042-09143140a254/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/pkg v0.0.0-20240626134149-3f6a546ac3a4 h1:slPKf3UKdBFZlz+hFy+KXzTgY9yOePLzRuEhKzgc5a4= diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go index 30c8575e..a74431f0 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Knative Authors +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. @@ -20,10 +20,12 @@ import ( "knative.dev/pkg/apis" ) -var eventPolicyCondSet = apis.NewLivingConditionSet() +var eventPolicyCondSet = apis.NewLivingConditionSet(EventPolicyConditionAuthenticationEnabled, EventPolicyConditionSubjectsResolved) const ( - EventPolicyConditionReady = apis.ConditionReady + EventPolicyConditionReady = apis.ConditionReady + EventPolicyConditionAuthenticationEnabled apis.ConditionType = "AuthenticationEnabled" + EventPolicyConditionSubjectsResolved apis.ConditionType = "SubjectsResolved" ) // GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. @@ -32,21 +34,41 @@ func (*EventPolicy) GetConditionSet() apis.ConditionSet { } // GetCondition returns the condition currently associated with the given type, or nil. -func (et *EventPolicyStatus) GetCondition(t apis.ConditionType) *apis.Condition { - return eventPolicyCondSet.Manage(et).GetCondition(t) +func (ep *EventPolicyStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return eventPolicyCondSet.Manage(ep).GetCondition(t) } // IsReady returns true if the resource is ready overall. -func (et *EventPolicyStatus) IsReady() bool { - return et.GetTopLevelCondition().IsTrue() +func (ep *EventPolicyStatus) IsReady() bool { + return ep.GetTopLevelCondition().IsTrue() } // GetTopLevelCondition returns the top level Condition. -func (et *EventPolicyStatus) GetTopLevelCondition() *apis.Condition { - return eventPolicyCondSet.Manage(et).GetTopLevelCondition() +func (ep *EventPolicyStatus) GetTopLevelCondition() *apis.Condition { + return eventPolicyCondSet.Manage(ep).GetTopLevelCondition() } // InitializeConditions sets relevant unset conditions to Unknown state. -func (et *EventPolicyStatus) InitializeConditions() { - eventPolicyCondSet.Manage(et).InitializeConditions() +func (ep *EventPolicyStatus) InitializeConditions() { + eventPolicyCondSet.Manage(ep).InitializeConditions() +} + +// MarkOIDCAuthenticationEnabled sets EventPolicyConditionAuthenticationEnabled condition to true. +func (ep *EventPolicyStatus) MarkOIDCAuthenticationEnabled() { + eventPolicyCondSet.Manage(ep).MarkTrue(EventPolicyConditionAuthenticationEnabled) +} + +// MarkOIDCAuthenticationDisabled sets EventPolicyConditionAuthenticationEnabled condition to false. +func (ep *EventPolicyStatus) MarkOIDCAuthenticationDisabled(reason, messageFormat string, messageA ...interface{}) { + eventPolicyCondSet.Manage(ep).MarkFalse(EventPolicyConditionAuthenticationEnabled, reason, messageFormat, messageA...) +} + +// MarkSubjectsResolved sets EventPolicyConditionSubjectsResolved condition to true. +func (ep *EventPolicyStatus) MarkSubjectsResolvedSucceeded() { + eventPolicyCondSet.Manage(ep).MarkTrue(EventPolicyConditionSubjectsResolved) +} + +// MarkSubjectsNotResolved sets EventPolicyConditionSubjectsResolved condition to false. +func (ep *EventPolicyStatus) MarkSubjectsResolvedFailed(reason, messageFormat string, messageA ...interface{}) { + eventPolicyCondSet.Manage(ep).MarkFalse(EventPolicyConditionSubjectsResolved, reason, messageFormat, messageA...) } diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/features.go b/vendor/knative.dev/eventing/pkg/apis/feature/features.go index 982ca8c6..4d6c235d 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/features.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/features.go @@ -18,6 +18,7 @@ package feature import ( "fmt" + "log" "strings" corev1 "k8s.io/api/core/v1" @@ -186,7 +187,8 @@ func NewFlagsConfigFromMap(data map[string]string) (Flags, error) { } else if strings.Contains(k, NodeSelectorLabel) { flags[sanitizedKey] = Flag(v) } else { - return flags, fmt.Errorf("cannot parse the feature flag '%s' = '%s'", k, v) + flags[k] = Flag(v) + log.Printf("Warning: unknown feature flag value %q=%q\n", k, v) } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 759ad853..929eb748 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -938,7 +938,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.41.1-0.20240627060150-a6ac8111e82f +# knative.dev/eventing v0.41.1-0.20240628173119-3b1bfb4674ca ## explicit; go 1.22 knative.dev/eventing/pkg/adapter/v2 knative.dev/eventing/pkg/adapter/v2/util/crstatusevent