@@ -50,7 +50,7 @@ type BpfApplicationProgramState struct {
5050 // +unionDiscriminator
5151 // +required
5252 // +kubebuilder:validation:Enum:="XDP";"TC";"TCX";"UProbe";"URetProbe"
53- Type EBPFProgType `json:"type"`
53+ Type EBPFProgType `json:"type,omitempty "`
5454
5555 // xdp contains the attachment data for an XDP program when type is set to XDP.
5656 // +unionMember
@@ -81,14 +81,30 @@ type BpfApplicationProgramState struct {
8181}
8282
8383type BpfApplicationStateStatus struct {
84- // UpdateCount tracks the number of times the BpfApplicationState object has
84+ // conditions contains the summary state of the BpfApplication for the given
85+ // Kubernetes node. If one or more programs failed to load or attach to the
86+ // designated attachment point, the condition will report the error. If more
87+ // than one error has occurred, condition will contain the first error
88+ // encountered.
89+ // +patchMergeKey=type
90+ // +patchStrategy=merge
91+ // +listType=map
92+ // +listMapKey=type
93+ // +optional
94+ // +kubebuilder:validation:MaxItems=1023
95+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
96+ // updateCount tracks the number of times the BpfApplicationState object has
8597 // been updated. The bpfman agent initializes it to 1 when it creates the
8698 // object, and then increments it before each subsequent update. It serves
8799 // as a lightweight sequence number to verify that the API server is serving
88100 // the most recent version of the object before beginning a new Reconcile
89101 // operation.
102+ // +kubebuilder:validation:Minimum=0
103+ // +optional
90104 UpdateCount int64 `json:"updateCount"`
91- // node is the name of the Kubernets node for this BpfApplicationState.
105+ // node is the name of the Kubernetes node for this BpfApplicationState.
106+ // +kubebuilder:validation:MaxLength=253
107+ // +optional
92108 Node string `json:"node"`
93109 // appLoadStatus reflects the status of loading the eBPF application on the
94110 // given node.
@@ -111,21 +127,15 @@ type BpfApplicationStateStatus struct {
111127 //
112128 // UnloadError is returned if one or more programs encountered an error when
113129 // being unloaded.
130+ // +optional
114131 AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
115132 // programs is a list of eBPF programs contained in the parent BpfApplication
116133 // instance. Each entry in the list contains the derived program attributes as
117134 // well as the attach status for each program on the given Kubernetes node.
135+ // +kubebuilder:validation:MaxItems=1023
136+ // +listType=atomic
137+ // +optional
118138 Programs []BpfApplicationProgramState `json:"programs,omitempty"`
119- // conditions contains the summary state of the BpfApplication for the given
120- // Kubernetes node. If one or more programs failed to load or attach to the
121- // designated attachment point, the condition will report the error. If more
122- // than one error has occurred, condition will contain the first error
123- // encountered.
124- // +patchMergeKey=type
125- // +patchStrategy=merge
126- // +listType=map
127- // +listMapKey=type
128- Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
129139}
130140
131141// +genclient
@@ -141,13 +151,16 @@ type BpfApplicationStateStatus struct {
141151// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
142152// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
143153type BpfApplicationState struct {
144- metav1.TypeMeta `json:",inline"`
154+ metav1.TypeMeta `json:",inline"`
155+ // metadata is the object's metadata.
156+ // +optional
145157 metav1.ObjectMeta `json:"metadata,omitempty"`
146158
147159 // status reflects the status of a BpfApplication instance for the given node.
148160 // appLoadStatus and conditions provide an overall status for the given node,
149161 // while each item in the programs list provides a per eBPF program status for
150162 // the given node.
163+ // +optional
151164 Status BpfApplicationStateStatus `json:"status,omitempty"`
152165}
153166
0 commit comments