Skip to content

Commit

Permalink
Delete only the trainedmodel in the namespace where the isvc (kubeflo…
Browse files Browse the repository at this point in the history
…w#2166)

Signed-off-by: hehe04 <hehe04@qq.com>
  • Loading branch information
hehe04 authored May 1, 2022
1 parent 27f9052 commit befef6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/v1beta1/inferenceservice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ func (r *InferenceServiceReconciler) deleteExternalResources(isvc *v1beta1api.In
// Delete all the TrainedModel that uses this InferenceService as parent
r.Log.Info("Deleting external resources", "InferenceService", isvc.Name)
var trainedModels v1alpha1api.TrainedModelList
if err := r.List(context.TODO(), &trainedModels, client.MatchingLabels{constants.ParentInferenceServiceLabel: isvc.Name}); err != nil {
if err := r.List(context.TODO(),
&trainedModels,
client.MatchingLabels{constants.ParentInferenceServiceLabel: isvc.Name},
client.InNamespace(isvc.Namespace),
); err != nil {
r.Log.Error(err, "unable to list trained models", "inferenceservice", isvc.Name)
return err
}
Expand Down

0 comments on commit befef6d

Please sign in to comment.