diff --git a/internal/controller/custommodel_controller.go b/internal/controller/custommodel_controller.go index 30545e3..0c73a72 100644 --- a/internal/controller/custommodel_controller.go +++ b/internal/controller/custommodel_controller.go @@ -115,7 +115,7 @@ func (r *CustomModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) Name: &CustomModel.Spec.ModelName, }) logger.Info("Checking if CustomModel exists", "CustomModel Name", CustomModel.Spec.ModelName, "Ollama URL", ollamaUrl, "status", res.Status()) - if err == nil && res.Status() == "200" { + if err == nil && res.StatusCode() == 200 { logger.Info("CustomModel exists", "CustomModel Name", CustomModel.Spec.ModelName, "Ollama URL", ollamaUrl) if res.JSON200 != nil { logger.Info("Checking if the ModelFile is the same", "CustomModel Name", CustomModel.Spec.ModelName, "Ollama URL", ollamaUrl) diff --git a/internal/controller/model_controller.go b/internal/controller/model_controller.go index 849eea1..794602d 100644 --- a/internal/controller/model_controller.go +++ b/internal/controller/model_controller.go @@ -114,7 +114,7 @@ func (r *ModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl Name: &model.Spec.ModelName, }) logger.Info("Checking if Model exists", "Model Name", model.Spec.ModelName, "Ollama URL", ollamaUrl, "status", res.Status()) - if err == nil && res.Status() == "200" { + if err == nil && res.StatusCode() == 200 { logger.Info("Model exists", "Model Name", model.Spec.ModelName, "Ollama URL", ollamaUrl) if res.JSON200 != nil { logger.Info("Model exists", "Model Name", res.JSON200.Parameters, "Ollama URL", ollamaUrl)