@@ -43,11 +43,10 @@ type InferencePool struct {
4343 // Status defines the observed state of the InferencePool.
4444 //
4545 // +optional
46- //nolint:kubeapilinter // ignore kubeapilinter to follow K8s conventions of optional but non-pointer.
4746 Status InferencePoolStatus `json:"status,omitempty"`
4847}
4948
50- // InferencePoolList contains a list InferencePools.
49+ // InferencePoolList contains a list of InferencePools.
5150//
5251// +kubebuilder:object:root=true
5352type InferencePoolList struct {
@@ -67,8 +66,7 @@ type InferencePoolSpec struct {
6766 // this configuration into a Service resource.
6867 //
6968 // +required
70- //nolint:kubeapilinter // ignore kubeapilinter here as we don't want to use pointer here.
71- Selector LabelSelector `json:"selector"`
69+ Selector LabelSelector `json:"selector,omitzero"`
7270
7371 // TargetPorts defines a list of ports that are exposed by this InferencePool.
7472 // Currently, the list may only include a single port definition.
@@ -77,8 +75,7 @@ type InferencePoolSpec struct {
7775 // +kubebuilder:validation:MaxItems=1
7876 // +listType=atomic
7977 // +required
80- //nolint:kubeapilinter // ignore kubeapilinter here since the field is required and we don't want omitempty tag.
81- TargetPorts []Port `json:"targetPorts"`
78+ TargetPorts []Port `json:"targetPorts,omitzero"`
8279
8380 // EndpointPickerRef is a reference to the Endpoint Picker extension and its
8481 // associated configuration.
@@ -93,8 +90,7 @@ type Port struct {
9390 // The number must be in the range 1 to 65535.
9491 //
9592 // +required
96- //nolint:kubeapilinter // ignore kubeapilinter here since the field is required and we don't want omitempty tag.
97- Number PortNumber `json:"number"`
93+ Number PortNumber `json:"number,omitzero"`
9894}
9995
10096// EndpointPickerRef specifies a reference to an Endpoint Picker extension and its
@@ -126,23 +122,20 @@ type EndpointPickerRef struct {
126122 // Name is the name of the referent API object.
127123 //
128124 // +required
129- //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer since empty means default value.
130- Name ObjectName `json:"name"`
125+ Name ObjectName `json:"name,omitzero"`
131126
132127 // PortNumber is the port number of the Endpoint Picker extension service. When unspecified,
133128 // implementations SHOULD infer a default value of 9002 when the kind field is "Service" or
134129 // unspecified (defaults to "Service").
135130 //
136131 // +optional
137- //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer here as 0 usually means all ports.
138132 PortNumber * PortNumber `json:"portNumber,omitempty"`
139133
140134 // FailureMode configures how the parent handles the case when the Endpoint Picker extension
141135 // is non-responsive. When unspecified, defaults to "FailClose".
142136 //
143137 // +optional
144138 // +kubebuilder:default="FailClose"
145- //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer since empty means default value.
146139 FailureMode * EndpointPickerFailureMode `json:"failureMode,omitempty"`
147140}
148141
@@ -185,18 +178,18 @@ type ParentStatus struct {
185178 // state of the InferencePool. This field is required to be set by the controller that
186179 // manages the InferencePool.
187180 //
188- // Known condition types are:
181+ // Supported condition types are:
189182 //
190183 // * "Accepted"
191184 // * "ResolvedRefs"
192185 //
193- // +required
186+ // +optional
194187 // +listType=map
195188 // +listMapKey=type
196- // +kubebuilder:validation:MinItems=1
189+ // +patchStrategy=merge
190+ // +patchMergeKey=type
197191 // +kubebuilder:validation:MaxItems=8
198- //nolint:kubeapilinter // ignore kubeapilinter here as we want conditions to be required.
199- Conditions []metav1.Condition `json:"conditions"`
192+ Conditions []metav1.Condition `json:"conditions,omitempty"`
200193
201194 // ParentRef is used to identify the parent resource that this status
202195 // is associated with. It is used to match the InferencePool with the parent
@@ -222,7 +215,7 @@ const (
222215 //
223216 // Possible reasons for this condition to be False are:
224217 //
225- // * "NotSupportedByParent "
218+ // * "Accepted "
226219 // * "HTTPRouteNotAccepted"
227220 //
228221 // Possible reasons for this condition to be Unknown are:
@@ -236,22 +229,18 @@ const (
236229 // InferencePoolReasonAccepted is a reason used with the "Accepted" condition
237230 // when the InferencePool is accepted by a Parent because the Parent supports
238231 // InferencePool as a backend.
239- InferencePoolReasonAccepted InferencePoolReason = "SupportedByParent "
232+ InferencePoolReasonAccepted InferencePoolReason = "Accepted "
240233
241234 // InferencePoolReasonNotSupportedByParent is a reason used with the "Accepted"
242235 // condition when the InferencePool has not been accepted by a Parent because
243236 // the Parent does not support InferencePool as a backend.
244237 InferencePoolReasonNotSupportedByParent InferencePoolReason = "NotSupportedByParent"
245238
246- // InferencePoolReasonHTTPRouteNotAccepted is a reason used with the "Accepted"
247- // condition when the InferencePool is referenced by an HTTPRoute that has been
248- // rejected by the Parent. The user should inspect the status of the referring
249- // HTTPRoute for the specific reason.
239+ // InferencePoolReasonHTTPRouteNotAccepted is an optional reason used with the
240+ // "Accepted" condition when the InferencePool is referenced by an HTTPRoute that
241+ // has been rejected by the Parent. The user should inspect the status of the
242+ // referring HTTPRoute for the specific reason.
250243 InferencePoolReasonHTTPRouteNotAccepted InferencePoolReason = "HTTPRouteNotAccepted"
251-
252- // This reason is used with the "Accepted" when a controller has not yet
253- // reconciled the InferencePool.
254- InferencePoolReasonPending InferencePoolReason = "Pending"
255244)
256245
257246const (
@@ -295,19 +284,21 @@ type ParentReference struct {
295284 //
296285 // +optional
297286 // +kubebuilder:default=Gateway
298- //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer here as empty means default value.
299287 Kind * Kind `json:"kind,omitempty"`
300288
301289 // Name is the name of the referent API object.
302290 //
303291 // +required
304- Name ObjectName `json:"name,omitempty "`
292+ Name ObjectName `json:"name,omitzero "`
305293
306- // Namespace is the namespace of the referent API object. When unspecified,
307- // the namespace of the referent is assumed to be the same as the namespace
308- // of the referring object.
294+ // Namespace is the namespace of the referenced object. When unspecified, the local
295+ // namespace is inferred.
296+ //
297+ // Note that when a namespace different than the local namespace is specified,
298+ // a ReferenceGrant object is required in the referent namespace to allow that
299+ // namespace's owner to accept the reference. See the ReferenceGrant
300+ // documentation for details: https://gateway-api.sigs.k8s.io/api-types/referencegrant/
309301 //
310302 // +optional
311- //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer here as empty means same namespace.
312303 Namespace * Namespace `json:"namespace,omitempty"`
313304}
0 commit comments