@@ -187,12 +187,12 @@ func (r *LLMInferenceServiceReconciler) reconcileSchedulerInferencePool(ctx cont
187
187
188
188
// Fetch current v1 to read Status (expected has no Status).
189
189
cur := & igwv1.InferencePool {}
190
- if err := r .Client .Get (ctx , crclient.ObjectKey {
190
+ // Intentionally ignore error - if v1 pool doesn't exist or can't be fetched,
191
+ // cur remains empty and isV1PoolReady will return false, allowing fallback to alpha2
192
+ _ = r .Client .Get (ctx , crclient.ObjectKey {
191
193
Namespace : expected .Namespace ,
192
- Name : expected .Name ,
193
- }, cur ); err != nil {
194
- // If we can't fetch v1, treat v1 as not ready and rely on alpha2 below.
195
- }
194
+ Name : expected .Name ,
195
+ }, cur )
196
196
197
197
v1Ready := isV1PoolReady (cur )
198
198
alpha2Ready := r .isAlpha2PoolReady (ctx , llmSvc .GetNamespace (), expected .GetName ())
@@ -662,10 +662,11 @@ func isV1PoolReady(p *igwv1.InferencePool) bool {
662
662
for _ , ps := range p .Status .Parents {
663
663
accepted , resolved := false , false
664
664
for _ , c := range ps .Conditions {
665
- if string (c .Type ) == "Accepted" && string (c .Status ) == "True" {
665
+ // c.Type is string, c.Status is ConditionStatus (string alias) - no conversion needed
666
+ if c .Type == "Accepted" && c .Status == "True" {
666
667
accepted = true
667
668
}
668
- if string ( c .Type ) == "ResolvedRefs" && string ( c .Status ) == "True" {
669
+ if c .Type == "ResolvedRefs" && c .Status == "True" {
669
670
resolved = true
670
671
}
671
672
}
@@ -935,7 +936,12 @@ func (r *LLMInferenceServiceReconciler) deleteAlpha2PoolIfExists(ctx context.Con
935
936
res := r .DynamicClient .Resource (GVRInferencePoolV1Alpha2 ).Namespace (llmSvc .Namespace )
936
937
_ , err := res .Get (ctx , name , metav1.GetOptions {})
937
938
if err != nil {
938
- return nil // nothing to delete or not found
939
+ // If resource doesn't exist (NotFound), that's fine - nothing to delete
940
+ if apierrors .IsNotFound (err ) {
941
+ return nil
942
+ }
943
+ // For other errors, propagate them
944
+ return err
939
945
}
940
946
return res .Delete (ctx , name , metav1.DeleteOptions {})
941
947
}
@@ -945,7 +951,12 @@ func (r *LLMInferenceServiceReconciler) deleteAlpha2InferenceModelIfExists(ctx c
945
951
res := r .DynamicClient .Resource (GVRInferenceModelV1Alpha2 ).Namespace (llmSvc .Namespace )
946
952
_ , err := res .Get (ctx , name , metav1.GetOptions {})
947
953
if err != nil {
948
- return nil // not found or not installed so ignore
954
+ // If resource doesn't exist (NotFound) or CRD not installed, that's fine
955
+ if apierrors .IsNotFound (err ) {
956
+ return nil
957
+ }
958
+ // For other errors, propagate them
959
+ return err
949
960
}
950
961
return res .Delete (ctx , name , metav1.DeleteOptions {})
951
962
}
0 commit comments