@@ -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,29 @@ 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+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
95+ // updateCount tracks the number of times the BpfApplicationState object has
8596 // been updated. The bpfman agent initializes it to 1 when it creates the
8697 // object, and then increments it before each subsequent update. It serves
8798 // as a lightweight sequence number to verify that the API server is serving
8899 // the most recent version of the object before beginning a new Reconcile
89100 // operation.
101+ // +kubebuilder:validation:Minimum=0
102+ // +optional
90103 UpdateCount int64 `json:"updateCount"`
91104 // node is the name of the Kubernets node for this BpfApplicationState.
105+ // +kubebuilder:validation:MaxLength=253
106+ // +optional
92107 Node string `json:"node"`
93108 // appLoadStatus reflects the status of loading the eBPF application on the
94109 // given node.
@@ -111,21 +126,15 @@ type BpfApplicationStateStatus struct {
111126 //
112127 // UnloadError is returned if one or more programs encountered an error when
113128 // being unloaded.
129+ // +optional
114130 AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
115131 // programs is a list of eBPF programs contained in the parent BpfApplication
116132 // instance. Each entry in the list contains the derived program attributes as
117133 // well as the attach status for each program on the given Kubernetes node.
134+ // +kubebuilder:validation:MaxItems=1023
135+ // +listType=atomic
136+ // +optional
118137 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"`
129138}
130139
131140// +genclient
@@ -141,13 +150,16 @@ type BpfApplicationStateStatus struct {
141150// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
142151// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
143152type BpfApplicationState struct {
144- metav1.TypeMeta `json:",inline"`
153+ metav1.TypeMeta `json:",inline"`
154+ // metadata is the object's metadata.
155+ // +optional
145156 metav1.ObjectMeta `json:"metadata,omitempty"`
146157
147158 // status reflects the status of a BpfApplication instance for the given node.
148159 // appLoadStatus and conditions provide an overall status for the given node,
149160 // while each item in the programs list provides a per eBPF program status for
150161 // the given node.
162+ // +optional
151163 Status BpfApplicationStateStatus `json:"status,omitempty"`
152164}
153165
0 commit comments