Skip to content

Commit

Permalink
fix(kollama): init resource list before modifications
Browse files Browse the repository at this point in the history
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
  • Loading branch information
nekomeowww committed Apr 25, 2024
1 parent ed35340 commit 44b1947
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions internal/cli/kollama/cmd_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func (o *CmdDeployOptions) runE(cmd *cobra.Command, args []string) error {
if len(parts) != 2 {
return fmt.Errorf("invalid resource limit format: %s", limit)
}
if resourceRequirements.Limits == nil {
resourceRequirements.Limits = make(corev1.ResourceList)
}

resourceRequirements.Limits[corev1.ResourceName(parts[0])] = resource.MustParse(parts[1])
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewOllamaServerContainer(readOnly bool, resources corev1.ResourceRequiremen
Port: intstr.FromString("ollama"),
},
},
InitialDelaySeconds: 15,
InitialDelaySeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 2500,
TimeoutSeconds: 5,
Expand All @@ -62,7 +62,7 @@ func NewOllamaServerContainer(readOnly bool, resources corev1.ResourceRequiremen
Port: intstr.FromString("ollama"),
},
},
InitialDelaySeconds: 15,
InitialDelaySeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 2500,
TimeoutSeconds: 1,
Expand Down

0 comments on commit 44b1947

Please sign in to comment.