MCPcopy
hub / github.com/NVIDIA/aistore / setPodEnvVariables

Method setPodEnvVariables

etl/transform.go:553–577  ·  view source on GitHub ↗

Sets environment variables that can be accessed inside the container.

()

Source from the content-addressed store, hash-verified

551
552// Sets environment variables that can be accessed inside the container.
553func (b *etlBootstraper) setPodEnvVariables() {
554 containers := b.pod.Spec.Containers
555 debug.Assert(len(containers) > 0)
556 for idx := range containers {
557 containers[idx].Env = append(containers[idx].Env, corev1.EnvVar{
558 Name: "AIS_TARGET_URL",
559 Value: b.t.Snode().URL(cmn.NetPublic) + apc.URLPathETLObject.Join(reqSecret),
560 })
561 for k, v := range b.env {
562 containers[idx].Env = append(containers[idx].Env, corev1.EnvVar{
563 Name: k,
564 Value: v,
565 })
566 }
567 }
568
569 for idx := range b.pod.Spec.InitContainers {
570 for k, v := range b.env {
571 b.pod.Spec.InitContainers[idx].Env = append(b.pod.Spec.InitContainers[idx].Env, corev1.EnvVar{
572 Name: k,
573 Value: v,
574 })
575 }
576 }
577}
578
579// waitPodReady waits until ETL Pod becomes `Ready`. This happens
580// only after the Pod's containers will have started and the Pod's `readinessProbe`

Callers 1

preparePodSpecMethod · 0.95

Calls 4

AssertFunction · 0.92
JoinMethod · 0.80
SnodeMethod · 0.65
URLMethod · 0.45

Tested by

no test coverage detected