Skip to content

Commit f0fbeb9

Browse files
committed
Resolves initial review comments
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 94e5e62 commit f0fbeb9

File tree

9 files changed

+79
-98
lines changed

9 files changed

+79
-98
lines changed

api/v1/inferencepool_types.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,11 @@ type ParentStatus struct {
218218
// longer necessary.
219219
//
220220
// +required
221-
ControllerName ParentController `json:"controllerName"`
221+
//nolint:kubeapilinter // should not have omitempty since the field is required
222+
ControllerName ControllerName `json:"controllerName"`
222223
}
223224

224-
// ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed
225+
// ControllerName is the name of a controller that manages ParentStatus. It must be a domain prefixed
225226
// path.
226227
//
227228
// Valid values include:
@@ -236,7 +237,7 @@ type ParentStatus struct {
236237
// +kubebuilder:validation:MinLength=1
237238
// +kubebuilder:validation:MaxLength=253
238239
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
239-
type ParentController string
240+
type ControllerName string
240241

241242
// InferencePoolConditionType is a type of status condition for the InferencePool.
242243
type InferencePoolConditionType string
@@ -318,7 +319,8 @@ const (
318319
//
319320
// Possible reasons for this condition to be False are:
320321
//
321-
// * "Invalid"
322+
// * "NotRequested"
323+
// * "NotSupported"
322324
//
323325
// Controllers MAY raise this condition with other reasons, but should
324326
// prefer to use the reasons listed above to improve interoperability.
@@ -328,10 +330,15 @@ const (
328330
// condition is true.
329331
InferencePoolReasonExported InferencePoolReason = "Exported"
330332

331-
// InferencePoolReasonInvalid is a reason used with the "Exported" condition when the
332-
// InferencePool cannot be exported for some reason. A controller should provide
333-
// additional information in the condition message.
334-
InferencePoolReasonInvalid InferencePoolReason = "Invalid"
333+
// InferencePoolReasonNotRequested is a reason used with the "Exported" condition when the
334+
// the "Exported" condition is false and no export was requested by the InferencePool. This
335+
// indicates a deliberate non-action rather than an error.
336+
InferencePoolReasonNotRequested InferencePoolReason = "NotRequested"
337+
338+
// InferencePoolReasonNotSupported is a reason used with the "Exported" condition when the
339+
// InferencePool condition is false and the export was requested but is not supported by the
340+
// implementation. Controllers should include details in the condition message.
341+
InferencePoolReasonNotSupported InferencePoolReason = "NotSupported"
335342
)
336343

337344
// ParentReference identifies an API object. It is used to associate the InferencePool with a

apix/v1alpha1/inferencepoolimport_types.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ type InferencePoolImport struct {
3535
// +optional
3636
metav1.ObjectMeta `json:"metadata,omitempty"`
3737

38-
// Spec defines the desired state of the InferencePoolImport.
39-
//
40-
// +required
41-
Spec InferencePoolImportSpec `json:"spec,omitzero"`
42-
4338
// Status defines the observed state of the InferencePoolImport.
4439
//
4540
// +optional
@@ -56,9 +51,6 @@ type InferencePoolImportList struct {
5651
Items []InferencePoolImport `json:"items"`
5752
}
5853

59-
// InferencePoolImportSpec defines the desired state of the InferencePoolImport.
60-
type InferencePoolImportSpec struct {}
61-
6254
// InferencePoolImportStatus defines the observed state of the InferencePoolImport.
6355
type InferencePoolImportStatus struct {
6456
// Controllers is a list of controllers that are responsible for managing the InferencePoolImport.
@@ -136,10 +128,16 @@ type ImportController struct {
136128
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
137129
type ControllerName string
138130

139-
// ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport.
131+
// ClusterName is the name of a cluster that exported the InferencePool.
132+
//
133+
// +kubebuilder:validation:MinLength=1
134+
// +kubebuilder:validation:MaxLength=253
135+
type ClusterName string
136+
137+
// ExportingCluster defines a cluster that exported the InferencePool that backs this InferencePoolImport.
140138
type ExportingCluster struct {
141139
// Name of the exporting cluster (must be unique within the list).
142140
//
143141
// +kubebuilder:validation:Required
144-
Name string `json:"name"`
142+
Name ClusterName `json:"name"`
145143
}

apix/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1/parentstatus.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ spec:
3838
type: string
3939
metadata:
4040
type: object
41-
spec:
42-
description: Spec defines the desired state of the InferencePoolImport.
43-
type: object
4441
status:
4542
description: Status defines the observed state of the InferencePoolImport.
4643
properties:
@@ -125,11 +122,13 @@ spec:
125122
from the exported InferencePool(s).
126123
items:
127124
description: ExportingCluster defines a cluster that exported
128-
the InferencePool associated to this InferencePoolImport.
125+
the InferencePool that backs this InferencePoolImport.
129126
properties:
130127
name:
131128
description: Name of the exporting cluster (must be unique
132129
within the list).
130+
maxLength: 253
131+
minLength: 1
133132
type: string
134133
required:
135134
- name
@@ -319,8 +318,6 @@ spec:
319318
required:
320319
- controllers
321320
type: object
322-
required:
323-
- spec
324321
type: object
325322
served: true
326323
storage: true

site-src/reference/spec.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ inference.networking.k8s.io API group.
1515

1616

1717

18+
#### ControllerName
19+
20+
_Underlying type:_ _string_
21+
22+
ControllerName is the name of a controller that manages ParentStatus. It must be a domain prefixed
23+
path.
24+
25+
Valid values include:
26+
27+
* "example.com/bar"
28+
29+
Invalid values include:
30+
31+
* "example.com" - must include path
32+
* "foo.example.com" - must include path
33+
34+
_Validation:_
35+
- MaxLength: 253
36+
- MinLength: 1
37+
- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
38+
39+
_Appears in:_
40+
- [ParentStatus](#parentstatus)
41+
42+
43+
1844
#### EndpointPickerFailureMode
1945

2046
_Underlying type:_ _string_
@@ -124,7 +150,7 @@ _Appears in:_
124150
| Field | Description | Default | Validation |
125151
| --- | --- | --- | --- |
126152
| `selector` _[LabelSelector](#labelselector)_ | Selector determines which Pods are members of this inference pool.<br />It matches Pods by their labels only within the same namespace; cross-namespace<br />selection is not supported.<br />The structure of this LabelSelector is intentionally simple to be compatible<br />with Kubernetes Service selectors, as some implementations may translate<br />this configuration into a Service resource. | | |
127-
| `targetPorts` _[Port](#port) array_ | TargetPorts defines a list of ports that are exposed by this InferencePool.<br />Currently, the list may only include a single port definition. | | MaxItems: 1 <br />MinItems: 1 <br /> |
153+
| `targetPorts` _[Port](#port) array_ | TargetPorts defines a list of ports that are exposed by this InferencePool.<br />Every port will be treated as a distinctive endpoint by EPP,<br />addressable as a 'podIP:portNumber' combination. | | MaxItems: 8 <br />MinItems: 1 <br /> |
128154
| `endpointPickerRef` _[EndpointPickerRef](#endpointpickerref)_ | EndpointPickerRef is a reference to the Endpoint Picker extension and its<br />associated configuration. | | |
129155

130156

@@ -294,32 +320,6 @@ _Appears in:_
294320

295321

296322

297-
#### ParentController
298-
299-
_Underlying type:_ _string_
300-
301-
ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed
302-
path.
303-
304-
Valid values include:
305-
306-
* "example.com/bar"
307-
308-
Invalid values include:
309-
310-
* "example.com" - must include path
311-
* "foo.example.com" - must include path
312-
313-
_Validation:_
314-
- MaxLength: 253
315-
- MinLength: 1
316-
- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
317-
318-
_Appears in:_
319-
- [ParentStatus](#parentstatus)
320-
321-
322-
323323
#### ParentReference
324324

325325

@@ -355,7 +355,7 @@ _Appears in:_
355355
| --- | --- | --- | --- |
356356
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | Conditions is a list of status conditions that provide information about the observed<br />state of the InferencePool. This field is required to be set by the controller that<br />manages the InferencePool.<br />Supported condition types are:<br />* "Accepted"<br />* "ResolvedRefs" | | MaxItems: 8 <br /> |
357357
| `parentRef` _[ParentReference](#parentreference)_ | ParentRef is used to identify the parent resource that this status<br />is associated with. It is used to match the InferencePool with the parent<br />resource, such as a Gateway. | | |
358-
| `controllerName` _[ParentController](#parentcontroller)_ | ControllerName is a domain/path string that indicates the name of the controller that<br />wrote this status. This corresponds with the GatewayClass controllerName field when the<br />parentRef references a Gateway kind.<br />Example: "example.net/gateway-controller".<br />The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:<br /> https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names<br />Controllers MUST populate this field when writing status. Controllers should ensure that<br />entries to status populated with their ControllerName are cleaned up when they are no<br />longer necessary. | | MaxLength: 253 <br />MinLength: 1 <br />Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` <br /> |
358+
| `controllerName` _[ControllerName](#controllername)_ | ControllerName is a domain/path string that indicates the name of the controller that<br />wrote this status. This corresponds with the GatewayClass controllerName field when the<br />parentRef references a Gateway kind.<br />Example: "example.net/gateway-controller".<br />The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:<br /> https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names<br />Controllers MUST populate this field when writing status. Controllers should ensure that<br />entries to status populated with their ControllerName are cleaned up when they are no<br />longer necessary. | | MaxLength: 253 <br />MinLength: 1 <br />Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` <br /> |
359359

360360

361361
#### Port

site-src/reference/x-v1a1-spec.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ inference.networking.x-k8s.io API group.
1515

1616

1717

18+
#### ClusterName
19+
20+
_Underlying type:_ _string_
21+
22+
ClusterName is the name of a cluster that exported the InferencePool.
23+
24+
_Validation:_
25+
- MaxLength: 253
26+
- MinLength: 1
27+
28+
_Appears in:_
29+
- [ExportingCluster](#exportingcluster)
30+
31+
32+
1833
#### ControllerName
1934

2035
_Underlying type:_ _string_
@@ -44,7 +59,7 @@ _Appears in:_
4459

4560

4661

47-
ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport.
62+
ExportingCluster defines a cluster that exported the InferencePool that backs this InferencePoolImport.
4863

4964

5065

@@ -53,7 +68,7 @@ _Appears in:_
5368

5469
| Field | Description | Default | Validation |
5570
| --- | --- | --- | --- |
56-
| `name` _string_ | Name of the exporting cluster (must be unique within the list). | | Required: \{\} <br /> |
71+
| `name` _[ClusterName](#clustername)_ | Name of the exporting cluster (must be unique within the list). | | MaxLength: 253 <br />MinLength: 1 <br />Required: \{\} <br /> |
5772

5873

5974
#### ImportController
@@ -90,23 +105,9 @@ InferencePoolImport is the Schema for the InferencePoolImports API.
90105
| `apiVersion` _string_ | `inference.networking.x-k8s.io/v1alpha1` | | |
91106
| `kind` _string_ | `InferencePoolImport` | | |
92107
| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
93-
| `spec` _[InferencePoolImportSpec](#inferencepoolimportspec)_ | Spec defines the desired state of the InferencePoolImport. | | |
94108
| `status` _[InferencePoolImportStatus](#inferencepoolimportstatus)_ | Status defines the observed state of the InferencePoolImport. | | |
95109

96110

97-
#### InferencePoolImportSpec
98-
99-
100-
101-
InferencePoolImportSpec defines the desired state of the InferencePoolImport.
102-
103-
104-
105-
_Appears in:_
106-
- [InferencePoolImport](#inferencepoolimport)
107-
108-
109-
110111
#### InferencePoolImportStatus
111112

112113

0 commit comments

Comments
 (0)