Skip to content

Commit

Permalink
fix: exist check
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva64 committed Oct 20, 2024
1 parent cb75780 commit 9b639cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
args:
- --leader-elect
- --health-probe-bind-address=:8081
image: ghcr.io/startupnationlabs/simple-ollama-operator/operator:b8eda45ff032d75a3a19b55591782aa5d758bbb3
image: ghcr.io/startupnationlabs/simple-ollama-operator/operator:cb75780e3ab2a3933ec48f86baf6eaa83fadb99b
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down
4 changes: 2 additions & 2 deletions config/samples/ollama_v1_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
labels:
app.kubernetes.io/name: simple-ollama-operator
app.kubernetes.io/managed-by: kustomize
name: model-sample
name: lamamode3.2
spec:
modelName: llama3.2:1b
modelName: llama3.2:3b
4 changes: 2 additions & 2 deletions internal/controller/model_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func (r *ModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl
res, err := ollamaClient.PostApiShowWithResponse(ctx, ollama_client.PostApiShowJSONRequestBody{
Name: &model.Spec.ModelName,
})
if err == nil {
if err == nil && res.Status() == "200" {
logger.Info("Model exists", "Model Name", model.Spec.ModelName, "Ollama URL", modelUrl)
if res.JSON200 != nil {
logger.Info("Model exists", "Model Name", model.Spec.ModelName, "Ollama URL", modelUrl)
logger.Info("Model exists", "Model Name", res.JSON200.Parameters, "Ollama URL", modelUrl)
return ctrl.Result{}, nil
}
return ctrl.Result{}, err
Expand Down

0 comments on commit 9b639cb

Please sign in to comment.