package watch_graph //nolint:staticcheck

import (
	corev1 "k8s.io/api/core/v1"
)

func (vx *wgObject2vertex) collectEnvVarV1Arcs(v *corev1.EnvVar, arcType ArcType) {
	if v.ValueFrom == nil {
		return
	}
	if v.ValueFrom.ConfigMapKeyRef != nil {
		vx.setArcToConfigMap(v.ValueFrom.ConfigMapKeyRef.Name, ArcAttrs{}, arcType)
	}
	if v.ValueFrom.SecretKeyRef != nil {
		vx.setArcToSecret(v.ValueFrom.SecretKeyRef.Name, ArcAttrs{}, arcType)
	}
}
