@@ -279,6 +279,17 @@ func (n *NIMService) GetStandardEnv() []corev1.EnvVar {
279279 Name : "NIM_CACHE_PATH" ,
280280 Value : utils .DefaultModelStorePath ,
281281 },
282+ {
283+ Name : "NGC_API_KEY" ,
284+ ValueFrom : & corev1.EnvVarSource {
285+ SecretKeyRef : & corev1.SecretKeySelector {
286+ LocalObjectReference : corev1.LocalObjectReference {
287+ Name : n .Spec .AuthSecret ,
288+ },
289+ Key : "NGC_API_KEY" ,
290+ },
291+ },
292+ },
282293 {
283294 Name : "OUTLINES_CACHE_DIR" ,
284295 Value : "/tmp/outlines" ,
@@ -355,11 +366,6 @@ func (n *NIMService) getLWSCommonEnv() []corev1.EnvVar {
355366 return env
356367}
357368
358- // GetLWSLeaderEnvFrom returns the env from sources for the leader worker set.
359- func (n * NIMService ) GetLWSCommonEnvFrom () []corev1.EnvFromSource {
360- return n .GetEnvFrom ()
361- }
362-
363369func (n * NIMService ) GetLWSLeaderEnv () []corev1.EnvVar {
364370 env := n .getLWSCommonEnv ()
365371
@@ -564,23 +570,6 @@ func (n *NIMService) GetEnv() []corev1.EnvVar {
564570 return envVarList
565571}
566572
567- // GetEnvFrom returns merged slice of standard and user specified env from sources.
568- func (n * NIMService ) GetEnvFrom () []corev1.EnvFromSource {
569- if n .Spec .AuthSecret != "" {
570- return []corev1.EnvFromSource {
571- {
572- SecretRef : & corev1.SecretEnvSource {
573- LocalObjectReference : corev1.LocalObjectReference {
574- Name : n .Spec .AuthSecret ,
575- },
576- },
577- },
578- }
579- }
580- // no secrets to source the env variables
581- return []corev1.EnvFromSource {}
582- }
583-
584573// GetImage returns container image for the NIMService.
585574func (n * NIMService ) GetImage () string {
586575 return fmt .Sprintf ("%s:%s" , n .Spec .Image .Repository , n .Spec .Image .Tag )
@@ -1065,7 +1054,6 @@ func (n *NIMService) GetDeploymentParams() *rendertypes.DeploymentParams {
10651054 // Set container spec
10661055 params .ContainerName = n .GetContainerName ()
10671056 params .Env = n .GetEnv ()
1068- params .EnvFrom = n .GetEnvFrom ()
10691057 params .Args = n .GetArgs ()
10701058 params .Command = n .GetCommand ()
10711059 params .Resources = n .GetResources ()
@@ -1137,8 +1125,6 @@ func (n *NIMService) GetLWSParams() *rendertypes.LeaderWorkerSetParams {
11371125 params .Command = n .GetCommand ()
11381126 params .LeaderEnvs = n .GetLWSLeaderEnv ()
11391127 params .WorkerEnvs = n .GetLWSWorkerEnv ()
1140- params .LeaderEnvFrom = n .GetLWSCommonEnvFrom ()
1141- params .WorkerEnvFrom = n .GetLWSCommonEnvFrom ()
11421128 params .UserID = n .GetUserID ()
11431129 params .GroupID = n .GetGroupID ()
11441130 params .Image = n .GetImage ()
0 commit comments