Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/tests/inferencepool_resolvedrefs_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var InferencePoolParentStatus = suite.ConformanceTest{
t.Logf("Waiting for %v for Gateway conditions to update after deleting HTTPRoute %s", inferenceTimeoutConfig.HTTPRouteDeletionReconciliationTimeout, httpRouteSecondaryNN.String())
time.Sleep(inferenceTimeoutConfig.HTTPRouteDeletionReconciliationTimeout)

k8sutils.InferencePoolMustHaveNoParents(t, s.Client, poolNN)
k8sutils.InferencePoolMustHaveDefaultParent(t, s.Client, poolNN)
t.Logf("InferencePool %s correctly shows no parent statuses, indicating it's no longer referenced.", poolNN.String())

trafficutils.MakeRequestAndExpectEventuallyConsistentResponse(
Expand Down
19 changes: 13 additions & 6 deletions conformance/utils/kubernetes/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ func InferencePoolMustHaveCondition(t *testing.T, c client.Reader, poolNN types.
t.Log(logMsg)
}

// InferencePoolMustHaveNoParents waits for the specified InferencePool resource
// to exist and report that it has no parent references in its status.
// This typically indicates it is no longer referenced by any Gateway API resources.
func InferencePoolMustHaveNoParents(t *testing.T, c client.Reader, poolNN types.NamespacedName) {
// InferencePoolMustHaveDefaultParent waits for the specified InferencePool resource
// to exist and report that it contains the default parent references in its status.
// This indicates no controller is managing the resource.
func InferencePoolMustHaveDefaultParent(t *testing.T, c client.Reader, poolNN types.NamespacedName) {
t.Helper()

var lastObservedPool *inferenceapi.InferencePool
Expand Down Expand Up @@ -193,8 +193,15 @@ func InferencePoolMustHaveNoParents(t *testing.T, c client.Reader, poolNN types.
lastObservedPool = pool
lastError = nil

if len(pool.Status.Parents) == 0 {
t.Logf("InferencePool %s successfully has no parent statuses.", poolNN.String())
if len(pool.Status.Parents) == 1 &&
pool.Status.Parents[0].GatewayRef.Name == "default" &&
pool.Status.Parents[0].Conditions != nil &&
checkCondition(t, pool.Status.Parents[0].Conditions, metav1.Condition{
Type: string(gatewayv1.GatewayConditionAccepted),
Status: "Unknown",
Reason: string(inferenceapi.InferencePoolReasonPending),
}) {
t.Logf("InferencePool %s successfully has the default parent statuses.", poolNN.String())
return true, nil
}
t.Logf("InferencePool %s still has %d parent statuses. Waiting...", poolNN.String(), len(pool.Status.Parents))
Expand Down