Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing 833f4aa...ecae895:
  > ecae895 AuthZ: Provide function to update AppliedEventPoliciesStatus based on a given list of applying policies (# 8173)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Aug 27, 2024
1 parent ff690ca commit f44d9de
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
k8s.io/apiserver v0.30.3
k8s.io/client-go v0.30.3
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
knative.dev/eventing v0.42.1-0.20240826165623-833f4aa12066
knative.dev/eventing v0.42.1-0.20240827090532-ecae8953ff0c
knative.dev/hack v0.0.0-20240814130635-06f7aff93954
knative.dev/pkg v0.0.0-20240815051656-89743d9bbf7c
knative.dev/reconciler-test v0.0.0-20240820100420-036ce14b8617
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.42.1-0.20240826165623-833f4aa12066 h1:joVzbKyPOjw79jVhGrT4zKA1jrDTqk+UDQ8Mbq2vtAU=
knative.dev/eventing v0.42.1-0.20240826165623-833f4aa12066/go.mod h1:Clx8z37Nwg321H9+vGNxp5C6bVdo4l4XM5g6T5CgZVI=
knative.dev/eventing v0.42.1-0.20240827090532-ecae8953ff0c h1:K8OG+CT1NbgRojpKU49SWDpAQd/4YCElJZH5LJLwBR4=
knative.dev/eventing v0.42.1-0.20240827090532-ecae8953ff0c/go.mod h1:Clx8z37Nwg321H9+vGNxp5C6bVdo4l4XM5g6T5CgZVI=
knative.dev/hack v0.0.0-20240814130635-06f7aff93954 h1:dGMK5VoL75szvrYQTL9NqhPYHu1f5dGaXx1hJI8fAFM=
knative.dev/hack v0.0.0-20240814130635-06f7aff93954/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
knative.dev/pkg v0.0.0-20240815051656-89743d9bbf7c h1:2crXVk4FG0dSG6WHaIT+WKbUzn7qG2wn0AfYmvA22zs=
Expand Down
22 changes: 13 additions & 9 deletions vendor/knative.dev/eventing/pkg/auth/event_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,12 @@ type EventPolicyStatusMarker interface {
MarkEventPoliciesTrueWithReason(reason, messageFormat string, messageA ...interface{})
}

func UpdateStatusWithEventPolicies(featureFlags feature.Flags, status *eventingduckv1.AppliedEventPoliciesStatus, statusMarker EventPolicyStatusMarker, eventPolicyLister listerseventingv1alpha1.EventPolicyLister, gvk schema.GroupVersionKind, objectMeta metav1.ObjectMeta) error {
func UpdateStatusWithProvidedEventPolicies(featureFlags feature.Flags, status *eventingduckv1.AppliedEventPoliciesStatus, statusMarker EventPolicyStatusMarker, applyingEventPolicies []*v1alpha1.EventPolicy) error {
status.Policies = nil

applyingEvenPolicies, err := GetEventPoliciesForResource(eventPolicyLister, gvk, objectMeta)
if err != nil {
statusMarker.MarkEventPoliciesFailed("EventPoliciesGetFailed", "Failed to get applying event policies")
return fmt.Errorf("unable to get applying event policies: %w", err)
}

if len(applyingEvenPolicies) > 0 {
if len(applyingEventPolicies) > 0 {
unreadyEventPolicies := []string{}
for _, policy := range applyingEvenPolicies {
for _, policy := range applyingEventPolicies {
if !policy.Status.IsReady() {
unreadyEventPolicies = append(unreadyEventPolicies, policy.Name)
} else {
Expand Down Expand Up @@ -357,3 +351,13 @@ func UpdateStatusWithEventPolicies(featureFlags feature.Flags, status *eventingd

return nil
}

func UpdateStatusWithEventPolicies(featureFlags feature.Flags, status *eventingduckv1.AppliedEventPoliciesStatus, statusMarker EventPolicyStatusMarker, eventPolicyLister listerseventingv1alpha1.EventPolicyLister, gvk schema.GroupVersionKind, objectMeta metav1.ObjectMeta) error {
applyingEvenPolicies, err := GetEventPoliciesForResource(eventPolicyLister, gvk, objectMeta)
if err != nil {
statusMarker.MarkEventPoliciesFailed("EventPoliciesGetFailed", "Failed to get applying event policies")
return fmt.Errorf("unable to get applying event policies: %w", err)
}

return UpdateStatusWithProvidedEventPolicies(featureFlags, status, statusMarker, applyingEvenPolicies)
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/eventing v0.42.1-0.20240826165623-833f4aa12066
# knative.dev/eventing v0.42.1-0.20240827090532-ecae8953ff0c
## explicit; go 1.22.0
knative.dev/eventing/cmd/event_display
knative.dev/eventing/cmd/heartbeats
Expand Down

0 comments on commit f44d9de

Please sign in to comment.