@@ -71,7 +71,7 @@ type ClBpfApplicationProgramState struct {
7171 // +unionDiscriminator
7272 // +required
7373 // +kubebuilder:validation:Enum:="FEntry";"FExit";"KProbe";"KRetProbe";"TC";"TCX";"TracePoint";"UProbe";"URetProbe";"XDP"
74- Type EBPFProgType `json:"type"`
74+ Type EBPFProgType `json:"type,omitempty "`
7575
7676 // xdp contains the attachment data for an XDP program when type is set to XDP.
7777 // +unionMember
@@ -132,15 +132,32 @@ type ClBpfApplicationProgramState struct {
132132}
133133
134134type ClBpfApplicationStateStatus struct {
135- // UpdateCount tracks the number of times the BpfApplicationState object has
135+ // conditions contains the summary state of the ClusterBpfApplication for the
136+ // given Kubernetes node. If one or more programs failed to load or attach to
137+ // the designated attachment point, the condition will report the error. If
138+ // more than one error has occurred, condition will contain the first error
139+ // encountered.
140+ // +patchMergeKey=type
141+ // +patchStrategy=merge
142+ // +listType=map
143+ // +listMapKey=type
144+ // +optional
145+ // +kubebuilder:validation:MaxItems=1023
146+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
147+ // updateCount tracks the number of times the BpfApplicationState object has
136148 // been updated. The bpfman agent initializes it to 1 when it creates the
137149 // object, and then increments it before each subsequent update. It serves
138150 // as a lightweight sequence number to verify that the API server is serving
139151 // the most recent version of the object before beginning a new Reconcile
140152 // operation.
141- UpdateCount int64 `json:"updateCount"`
153+ // +kubebuilder:validation:Minimum=1
154+ // +optional
155+ UpdateCount int64 `json:"updateCount,omitempty"`
142156 // node is the name of the Kubernetes node for this ClusterBpfApplicationState.
143- Node string `json:"node"`
157+ // +kubebuilder:validation:MinLength=1
158+ // +kubebuilder:validation:MaxLength=253
159+ // +optional
160+ Node string `json:"node,omitempty"`
144161 // appLoadStatus reflects the status of loading the eBPF application on the
145162 // given node.
146163 //
@@ -160,22 +177,16 @@ type ClBpfApplicationStateStatus struct {
160177 //
161178 // UnloadError is returned if one or more programs encountered an error when
162179 // being unloaded.
163- AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
180+ // +optional
181+ AppLoadStatus AppLoadStatus `json:"appLoadStatus,omitempty"`
164182 // programs is a list of eBPF programs contained in the parent
165183 // ClusterBpfApplication instance. Each entry in the list contains the derived
166184 // program attributes as well as the attach status for each program on the
167185 // given Kubernetes node.
186+ // +kubebuilder:validation:MaxItems=1023
187+ // +listType=atomic
188+ // +optional
168189 Programs []ClBpfApplicationProgramState `json:"programs,omitempty"`
169- // conditions contains the summary state of the ClusterBpfApplication for the
170- // given Kubernetes node. If one or more programs failed to load or attach to
171- // the designated attachment point, the condition will report the error. If
172- // more than one error has occurred, condition will contain the first error
173- // encountered.
174- // +patchMergeKey=type
175- // +patchStrategy=merge
176- // +listType=map
177- // +listMapKey=type
178- Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
179190}
180191
181192// +genclient
@@ -192,13 +203,16 @@ type ClBpfApplicationStateStatus struct {
192203// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
193204// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
194205type ClusterBpfApplicationState struct {
195- metav1.TypeMeta `json:",inline"`
206+ metav1.TypeMeta `json:",inline"`
207+ // metadata is the object's metadata.
208+ // +optional
196209 metav1.ObjectMeta `json:"metadata,omitempty"`
197210
198211 // status reflects the status of a ClusterBpfApplication instance for the given
199212 // node. appLoadStatus and conditions provide an overall status for the given
200213 // node, while each item in the programs list provides a per eBPF program
201214 // status for the given node.
215+ // +optional
202216 Status ClBpfApplicationStateStatus `json:"status,omitempty"`
203217}
204218
0 commit comments