Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion internal/controller/nimcache_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,21 @@ func getManifestConfigName(nimCache *appsv1alpha1.NIMCache) string {
return fmt.Sprintf("%s-manifest", nimCache.GetName())
}

func getCommand() []string {
return []string{
"sh",
"-c",
strings.Join([]string{
"if [ -f /opt/nim/etc/default/model_manifest.yaml ]; then",
"cat /opt/nim/etc/default/model_manifest.yaml;",
"else",
"cat /etc/nim/config/model_manifest.yaml;",
"fi;",
"sleep infinity",
}, " "),
}
}

// constructPodSpec constructs a Pod specification
func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.OrchestratorType) *corev1.Pod {
labels := map[string]string{
Expand Down Expand Up @@ -938,7 +953,7 @@ func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.Orch
{
Name: NIMCacheContainerName,
Image: nimCache.Spec.Source.NGC.ModelPuller,
Command: []string{"sh", "-c", "cat /etc/nim/config/model_manifest.yaml; sleep infinity"},
Command: getCommand(),
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.To[bool](false),
Capabilities: &corev1.Capabilities{
Expand Down
Loading