From 5d4fdbc529683145f154d4c81591db3fc6406210 Mon Sep 17 00:00:00 2001 From: Apoorva Appadoo Srinivas Date: Sun, 20 Oct 2024 19:03:22 +0200 Subject: [PATCH] fix: status code --- internal/controller/custommodel_controller.go | 2 +- internal/controller/model_controller.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)