Skip to content

Commit 5475676

Browse files
committed
Adding Accepted and ResolvedRefs conditions to InferencePool
1 parent 406ffee commit 5475676

File tree

2 files changed

+53
-11
lines changed

2 files changed

+53
-11
lines changed

api/v1alpha2/inferencepool_types.go

+52-10
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ type InferencePoolStatus struct {
159159
Parents []PoolStatus `json:"parent,omitempty"`
160160
}
161161

162-
// PoolStatus defines the observed state of InferencePool from a gateway.
162+
// PoolStatus defines the observed state of InferencePool from a Gateway.
163163
type PoolStatus struct {
164164
// GatewayRef indicates the gateway that observed state of InferencePool.
165165
GatewayRef corev1.ObjectReference `json:"parentRef"`
166+
166167
// Conditions track the state of the InferencePool.
167168
//
168169
// Known condition types are:
@@ -180,27 +181,68 @@ type PoolStatus struct {
180181
// InferencePoolConditionType is a type of condition for the InferencePool
181182
type InferencePoolConditionType string
182183

183-
// InferencePoolConditionReason is the reason for a given InferencePoolConditionType
184-
type InferencePoolConditionReason string
184+
// InferencePoolReason is the reason for a given InferencePoolConditionType
185+
type InferencePoolReason string
185186

186187
const (
187-
// PoolConditionReady indicates if the pool is ready to accept traffic, and if not, why.
188+
// This condition indicates whether the route has been accepted or rejected
189+
// by a Gateway, and why.
188190
//
189191
// Possible reasons for this condition to be True are:
190192
//
191-
// * "Ready"
193+
// * "Accepted"
194+
//
195+
// Possible reasons for this condition to be False are:
196+
//
197+
// * "NotAllowedByListeners"
198+
// * "NotSupportedByGateway"
192199
//
193200
// Possible reasons for this condition to be Unknown are:
194201
//
195202
// * "Pending"
196203
//
197-
PoolConditionReady InferencePoolConditionType = "Ready"
204+
// Controllers MAY raise this condition with other reasons, but should
205+
// prefer to use the reasons listed above to improve interoperability.
206+
InferencePoolConditionAccepted InferencePoolConditionType = "Accepted"
207+
208+
// This reason is used with the "Accepted" condition when the Route has been
209+
// accepted by the Gateway.
210+
InferencePoolReasonAccepted InferencePoolReason = "Accepted"
211+
212+
// This reason is used with the "Accepted" condition when the InferencePool
213+
// has not been accepted by a Gateway because the Gateway does not support
214+
// InferencePool as a backend.
215+
InferencePoolReasonNotSupportedByGateway InferencePoolReason = "NotSupportedByGateway"
216+
217+
// This reason is used with the "Accepted" when a controller has not yet
218+
// reconciled the route.
219+
InferencePoolReasonPending InferencePoolReason = "Pending"
220+
)
221+
222+
const (
223+
// This condition indicates whether the controller was able to
224+
// resolve all the object references for the Listener.
225+
//
226+
// Possible reasons for this condition to be true are:
227+
//
228+
// * "ResolvedRefs"
229+
//
230+
// Possible reasons for this condition to be False are:
231+
//
232+
// * "InvalidExtnesionRef"
233+
//
234+
// Controllers MAY raise this condition with other reasons, but should
235+
// prefer to use the reasons listed above to improve interoperability.
236+
ModelConditionResolvedRefs InferencePoolConditionType = "ResolvedRefs"
198237

199-
// PoolReasonReady is the desired state. The pool and its components are initialized and ready for traffic.
200-
PoolReasonReady InferencePoolConditionReason = "Ready"
238+
// This reason is used with the "ResolvedRefs" condition when the condition
239+
// is true.
240+
ModelReasonResolvedRefs InferencePoolReason = "ResolvedRefs"
201241

202-
// PoolReasonPending is the initial state, and indicates that the controller has not yet reconciled this pool.
203-
PoolReasonPending InferencePoolConditionReason = "Pending"
242+
// This reason is used with the "ResolvedRefs" condition when the
243+
// ExtensionRef is invalid in some way. This can include an unsupported kind
244+
// or API group, or a reference to a resource that can not be found.
245+
ListenerReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
204246
)
205247

206248
func init() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ spec:
146146
means the route has not been attached to any Gateway.
147147
items:
148148
description: PoolStatus defines the observed state of InferencePool
149-
from a gateway.
149+
from a Gateway.
150150
properties:
151151
conditions:
152152
default:

0 commit comments

Comments
 (0)