Skip to content

Commit

Permalink
fix: status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva64 committed Oct 20, 2024
1 parent ce5ec66 commit 5d4fdbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/controller/custommodel_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/model_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d4fdbc

Please sign in to comment.