Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppliedEventPoliciesStatus type #7999

Merged
merged 12 commits into from
Jun 13, 2024
12 changes: 12 additions & 0 deletions config/channels/in-memory-channel/resources/in-memory-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ spec:
description: Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.
type: object
x-kubernetes-preserve-unknown-fields: true
policies:
description: List of applied EventPolicies
type: array
items:
type: object
properties:
apiVersion:
description: The API version of the applied EventPolicy. This indicates, which version of EventPolicy is supported by the resource.
type: string
name:
description: The name of the applied EventPolicy
type: string
conditions:
description: Conditions the latest available observations of a resource's current state.
type: array
Expand Down
12 changes: 12 additions & 0 deletions config/core/resources/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ spec:
description: Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.
type: object
x-kubernetes-preserve-unknown-fields: true
policies:
description: List of applied EventPolicies
type: array
items:
type: object
properties:
apiVersion:
description: The API version of the applied EventPolicy. This indicates, which version of EventPolicy is supported by the resource.
type: string
name:
description: The name of the applied EventPolicy
type: string
conditions:
description: Conditions the latest available observations of a resource's current state.
type: array
Expand Down
12 changes: 12 additions & 0 deletions config/core/resources/parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,18 @@ spec:
description: 'UID of the referent. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
policies:
description: List of applied EventPolicies
type: array
items:
type: object
properties:
apiVersion:
description: The API version of the applied EventPolicy. This indicates, which version of EventPolicy is supported by the resource.
type: string
name:
description: The name of the applied EventPolicy
type: string
conditions:
description: Conditions the latest available observations of a resource's
current state.
Expand Down
12 changes: 12 additions & 0 deletions config/core/resources/sequence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,18 @@ spec:
type:
description: Type of condition.
type: string
policies:
description: List of applied EventPolicies
type: array
items:
type: object
properties:
apiVersion:
description: The API version of the applied EventPolicy. This indicates, which version of EventPolicy is supported by the resource.
type: string
name:
description: The name of the applied EventPolicy
type: string
conditions:
description: Conditions the latest available observations of a resource's current state.
type: array
Expand Down
142 changes: 142 additions & 0 deletions docs/eventing-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,80 @@
</p>
Resource Types:
<ul></ul>
<h3 id="duck.knative.dev/v1.AppliedEventPoliciesStatus">AppliedEventPoliciesStatus
</h3>
<p>
(<em>Appears on:</em><a href="#eventing.knative.dev/v1.BrokerStatus">BrokerStatus</a>, <a href="#flows.knative.dev/v1.ParallelStatus">ParallelStatus</a>, <a href="#flows.knative.dev/v1.SequenceStatus">SequenceStatus</a>, <a href="#messaging.knative.dev/v1.InMemoryChannelStatus">InMemoryChannelStatus</a>)
</p>
<p>
<p>AppliedEventPoliciesStatus contains the list of policies which apply to a resource.
This type is intended to be embedded into a status struct.</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>policies</code><br/>
<em>
<a href="#duck.knative.dev/v1.AppliedEventPolicyRef">
[]AppliedEventPolicyRef
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Policies holds the list of applied EventPolicies</p>
</td>
</tr>
</tbody>
</table>
<h3 id="duck.knative.dev/v1.AppliedEventPolicyRef">AppliedEventPolicyRef
</h3>
<p>
(<em>Appears on:</em><a href="#duck.knative.dev/v1.AppliedEventPoliciesStatus">AppliedEventPoliciesStatus</a>)
</p>
<p>
<p>AppliedEventPolicyRef is the reference to an EventPolicy</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>apiVersion</code><br/>
<em>
string
</em>
</td>
<td>
<p>APIVersion of the applied EventPolicy.
This indicates, which version of EventPolicy is supported by the resource.</p>
</td>
</tr>
<tr>
<td>
<code>name</code><br/>
<em>
string
</em>
</td>
<td>
<p>Name of the applied EventPolicy</p>
</td>
</tr>
</tbody>
</table>
<h3 id="duck.knative.dev/v1.BackoffPolicyType">BackoffPolicyType
(<code>string</code> alias)</p></h3>
<p>
Expand Down Expand Up @@ -2099,6 +2173,23 @@ DeliveryStatus
resolved delivery options.</p>
</td>
</tr>
<tr>
<td>
<code>AppliedEventPoliciesStatus</code><br/>
<em>
<a href="#duck.knative.dev/v1.AppliedEventPoliciesStatus">
AppliedEventPoliciesStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>AppliedEventPoliciesStatus</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker</p>
</td>
</tr>
</tbody>
</table>
<h3 id="eventing.knative.dev/v1.SubscriptionsAPIFilter">SubscriptionsAPIFilter
Expand Down Expand Up @@ -3859,6 +3950,23 @@ knative.dev/pkg/apis/duck/v1.AuthStatus
<p>Auth provides the relevant information for OIDC authentication.</p>
</td>
</tr>
<tr>
<td>
<code>AppliedEventPoliciesStatus</code><br/>
<em>
<a href="#duck.knative.dev/v1.AppliedEventPoliciesStatus">
AppliedEventPoliciesStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>AppliedEventPoliciesStatus</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker</p>
</td>
</tr>
</tbody>
</table>
<h3 id="flows.knative.dev/v1.ParallelSubscriptionStatus">ParallelSubscriptionStatus
Expand Down Expand Up @@ -4207,6 +4315,23 @@ knative.dev/pkg/apis/duck/v1.AuthStatus
<p>Auth provides the relevant information for OIDC authentication.</p>
</td>
</tr>
<tr>
<td>
<code>AppliedEventPoliciesStatus</code><br/>
<em>
<a href="#duck.knative.dev/v1.AppliedEventPoliciesStatus">
AppliedEventPoliciesStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>AppliedEventPoliciesStatus</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker</p>
</td>
</tr>
</tbody>
</table>
<h3 id="flows.knative.dev/v1.SequenceStep">SequenceStep
Expand Down Expand Up @@ -4880,6 +5005,23 @@ ChannelableStatus
<p>Channel conforms to Duck type ChannelableStatus.</p>
</td>
</tr>
<tr>
<td>
<code>AppliedEventPoliciesStatus</code><br/>
<em>
<a href="#duck.knative.dev/v1.AppliedEventPoliciesStatus">
AppliedEventPoliciesStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>AppliedEventPoliciesStatus</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker</p>
</td>
</tr>
</tbody>
</table>
<h3 id="messaging.knative.dev/v1.SubscriptionSpec">SubscriptionSpec
Expand Down
35 changes: 35 additions & 0 deletions pkg/apis/duck/v1/eventpoliciesstatus_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
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.
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 v1

// AppliedEventPoliciesStatus contains the list of policies which apply to a resource.
// This type is intended to be embedded into a status struct.
type AppliedEventPoliciesStatus struct {
// Policies holds the list of applied EventPolicies
// +optional
Policies []AppliedEventPolicyRef `json:"policies,omitempty"`
}

// AppliedEventPolicyRef is the reference to an EventPolicy
type AppliedEventPolicyRef struct {
// APIVersion of the applied EventPolicy.
// This indicates, which version of EventPolicy is supported by the resource.
APIVersion string `json:"apiVersion"`

// Name of the applied EventPolicy
Name string `json:"name"`
}
37 changes: 37 additions & 0 deletions pkg/apis/duck/v1/zz_generated.deepcopy.go

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

4 changes: 4 additions & 0 deletions pkg/apis/eventing/v1/broker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ type BrokerStatus struct {
// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
// resolved delivery options.
eventingduckv1.DeliveryStatus `json:",inline"`

// AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker
// +optional
eventingduckv1.AppliedEventPoliciesStatus `json:",inline"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/eventing/v1/zz_generated.deepcopy.go

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

5 changes: 4 additions & 1 deletion pkg/apis/flows/v1/parallel_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"

eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"
"knative.dev/pkg/apis"
Expand Down Expand Up @@ -123,6 +122,10 @@ type ParallelStatus struct {
// Auth provides the relevant information for OIDC authentication.
// +optional
Auth *duckv1.AuthStatus `json:"auth,omitempty"`

// AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker
// +optional
eventingduckv1.AppliedEventPoliciesStatus `json:",inline"`
}

// ParallelBranchStatus represents the current state of a Parallel branch
Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/flows/v1/sequence_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"

"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
"knative.dev/pkg/kmeta"
Expand Down Expand Up @@ -135,6 +134,10 @@ type SequenceStatus struct {
// Auth provides the relevant information for OIDC authentication.
// +optional
Auth *duckv1.AuthStatus `json:"auth,omitempty"`

// AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker
// +optional
eventingduckv1.AppliedEventPoliciesStatus `json:",inline"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
Loading
Loading