Skip to content

Commit d1d32de

Browse files
committed
Adds default parent to pool status
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 707ce60 commit d1d32de

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

api/v1alpha2/inferencepool_types.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type InferencePool struct {
3535

3636
// Status defines the observed state of InferencePool.
3737
//
38-
// +kubebuilder:default={parent: {{parentRef: {}, conditions: {{type: "Accepted", status: "Unknown", reason: "Pending", message: "Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}}}
38+
// +kubebuilder:default={parent: {{parentRef: {kind: "Status", name: "default"}, conditions: {{type: "Accepted", status: "Unknown", reason: "Pending", message: "Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}}}
3939
Status InferencePoolStatus `json:"status,omitempty"`
4040
}
4141

@@ -154,14 +154,19 @@ const (
154154
FailClose ExtensionFailureMode = "FailClose"
155155
)
156156

157-
// InferencePoolStatus defines the observed state of InferencePool
157+
// InferencePoolStatus defines the observed state of InferencePool.
158158
type InferencePoolStatus struct {
159159
// Parents is a list of parent resources (usually Gateways) that are
160-
// associated with the route, and the status of the InferencePool with respect to
160+
// associated with the InferencePool, and the status of the InferencePool with respect to
161161
// each parent.
162162
//
163-
// A maximum of 32 Gateways will be represented in this list. An empty list
164-
// means the route has not been attached to any Gateway.
163+
// A maximum of 32 Gateways will be represented in this list. When the list contains
164+
// `kind: Status, name: default`, it indicates that the InferencePool is not
165+
// associated with any Gateway and a controller must perform the following:
166+
//
167+
// - Remove the parent when setting the "Accepted" condition.
168+
// - Add the parent when the controller will no longer manage the InferencePool
169+
// and no other parents exist.
165170
//
166171
// +kubebuilder:validation:MaxItems=32
167172
Parents []PoolStatus `json:"parent,omitempty"`
@@ -194,7 +199,7 @@ type InferencePoolConditionType string
194199
type InferencePoolReason string
195200

196201
const (
197-
// This condition indicates whether the route has been accepted or rejected
202+
// This condition indicates whether the InferencePool has been accepted or rejected
198203
// by a Gateway, and why.
199204
//
200205
// Possible reasons for this condition to be True are:
@@ -213,7 +218,7 @@ const (
213218
// prefer to use the reasons listed above to improve interoperability.
214219
InferencePoolConditionAccepted InferencePoolConditionType = "Accepted"
215220

216-
// This reason is used with the "Accepted" condition when the Route has been
221+
// This reason is used with the "Accepted" condition when the InferencePool has been
217222
// accepted by the Gateway.
218223
InferencePoolReasonAccepted InferencePoolReason = "Accepted"
219224

@@ -223,7 +228,7 @@ const (
223228
InferencePoolReasonNotSupportedByGateway InferencePoolReason = "NotSupportedByGateway"
224229

225230
// This reason is used with the "Accepted" when a controller has not yet
226-
// reconciled the route.
231+
// reconciled the InferencePool.
227232
InferencePoolReasonPending InferencePoolReason = "Pending"
228233
)
229234

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,24 @@ spec:
142142
reason: Pending
143143
status: Unknown
144144
type: Accepted
145-
parentRef: {}
145+
parentRef:
146+
kind: Status
147+
name: default
146148
description: Status defines the observed state of InferencePool.
147149
properties:
148150
parent:
149151
description: |-
150152
Parents is a list of parent resources (usually Gateways) that are
151-
associated with the route, and the status of the InferencePool with respect to
153+
associated with the InferencePool, and the status of the InferencePool with respect to
152154
each parent.
153155
154-
A maximum of 32 Gateways will be represented in this list. An empty list
155-
means the route has not been attached to any Gateway.
156+
A maximum of 32 Gateways will be represented in this list. When the list contains
157+
`kind: Status, name: default`, it indicates that the InferencePool is not
158+
associated with any Gateway and a controller must perform the following:
159+
160+
- Remove the parent when setting the "Accepted" condition.
161+
- Add the parent when the controller will no longer manage the InferencePool
162+
and no other parents exist.
156163
items:
157164
description: PoolStatus defines the observed state of InferencePool
158165
from a Gateway.

0 commit comments

Comments
 (0)