Переглянути джерело

remove env vars from /api/allPods

Ajay Tripathy 4 роки тому
батько
коміт
88043afad1
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      pkg/costmodel/router.go

+ 3 - 0
pkg/costmodel/router.go

@@ -1093,6 +1093,9 @@ func (a *Accesses) GetPod(w http.ResponseWriter, r *http.Request, ps httprouter.
 	// TODO: ClusterCache API could probably afford to have some better filtering
 	allPods := a.ClusterCache.GetAllPods()
 	for _, pod := range allPods {
+		for _, container := range pod.Spec.Containers {
+			container.Env = make([]v1.EnvVar, 0)
+		}
 		if pod.Namespace == podNamespace && pod.Name == podName {
 			body, err := json.Marshal(pod)
 			if err != nil {