@@ -282,6 +282,17 @@ func (n *NIMService) GetStandardEnv() []corev1.EnvVar {
282282 Name : "NIM_CACHE_PATH" ,
283283 Value : utils .DefaultModelStorePath ,
284284 },
285+ {
286+ Name : "NGC_API_KEY" ,
287+ ValueFrom : & corev1.EnvVarSource {
288+ SecretKeyRef : & corev1.SecretKeySelector {
289+ LocalObjectReference : corev1.LocalObjectReference {
290+ Name : n .Spec .AuthSecret ,
291+ },
292+ Key : "NGC_API_KEY" ,
293+ },
294+ },
295+ },
285296 {
286297 Name : "OUTLINES_CACHE_DIR" ,
287298 Value : "/tmp/outlines" ,
@@ -358,11 +369,6 @@ func (n *NIMService) getLWSCommonEnv() []corev1.EnvVar {
358369 return env
359370}
360371
361- // GetLWSLeaderEnvFrom returns the env from sources for the leader worker set.
362- func (n * NIMService ) GetLWSCommonEnvFrom () []corev1.EnvFromSource {
363- return n .GetEnvFrom ()
364- }
365-
366372func (n * NIMService ) GetLWSLeaderEnv () []corev1.EnvVar {
367373 env := n .getLWSCommonEnv ()
368374
@@ -567,23 +573,6 @@ func (n *NIMService) GetEnv() []corev1.EnvVar {
567573 return envVarList
568574}
569575
570- // GetEnvFrom returns merged slice of standard and user specified env from sources.
571- func (n * NIMService ) GetEnvFrom () []corev1.EnvFromSource {
572- if n .Spec .AuthSecret != "" {
573- return []corev1.EnvFromSource {
574- {
575- SecretRef : & corev1.SecretEnvSource {
576- LocalObjectReference : corev1.LocalObjectReference {
577- Name : n .Spec .AuthSecret ,
578- },
579- },
580- },
581- }
582- }
583- // no secrets to source the env variables
584- return []corev1.EnvFromSource {}
585- }
586-
587576// GetImage returns container image for the NIMService.
588577func (n * NIMService ) GetImage () string {
589578 return fmt .Sprintf ("%s:%s" , n .Spec .Image .Repository , n .Spec .Image .Tag )
@@ -1080,7 +1069,6 @@ func (n *NIMService) GetDeploymentParams() *rendertypes.DeploymentParams {
10801069 // Set container spec
10811070 params .ContainerName = n .GetContainerName ()
10821071 params .Env = n .GetEnv ()
1083- params .EnvFrom = n .GetEnvFrom ()
10841072 params .Args = n .GetArgs ()
10851073 params .Command = n .GetCommand ()
10861074 params .Resources = n .GetResources ()
@@ -1152,8 +1140,6 @@ func (n *NIMService) GetLWSParams() *rendertypes.LeaderWorkerSetParams {
11521140 params .Command = n .GetCommand ()
11531141 params .LeaderEnvs = n .GetLWSLeaderEnv ()
11541142 params .WorkerEnvs = n .GetLWSWorkerEnv ()
1155- params .LeaderEnvFrom = n .GetLWSCommonEnvFrom ()
1156- params .WorkerEnvFrom = n .GetLWSCommonEnvFrom ()
11571143 params .UserID = n .GetUserID ()
11581144 params .GroupID = n .GetGroupID ()
11591145 params .Image = n .GetImage ()
0 commit comments