mirror of https://github.com/linkerd/linkerd2.git
Fix 'linkerd identity'
This commit is contained in:
parent
39db823fe0
commit
42dbdaddf5
|
@ -161,7 +161,8 @@ func getContainerWithPort(pod corev1.Pod, portName string) (corev1.Container, er
|
||||||
return container, fmt.Errorf("pod not running: %s", pod.GetName())
|
return container, fmt.Errorf("pod not running: %s", pod.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range pod.Spec.Containers {
|
containers := append(pod.Spec.InitContainers, pod.Spec.Containers...)
|
||||||
|
for _, c := range containers {
|
||||||
if c.Name != k8s.ProxyContainerName {
|
if c.Name != k8s.ProxyContainerName {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,8 @@ func PodIdentity(pod *corev1.Pod) (string, error) {
|
||||||
|
|
||||||
podsa := pod.Spec.ServiceAccountName
|
podsa := pod.Spec.ServiceAccountName
|
||||||
podns := pod.ObjectMeta.Namespace
|
podns := pod.ObjectMeta.Namespace
|
||||||
for _, c := range pod.Spec.Containers {
|
containers := append(pod.Spec.InitContainers, pod.Spec.Containers...)
|
||||||
|
for _, c := range containers {
|
||||||
if c.Name == ProxyContainerName {
|
if c.Name == ProxyContainerName {
|
||||||
for _, env := range c.Env {
|
for _, env := range c.Env {
|
||||||
if env.Name == "LINKERD2_PROXY_IDENTITY_LOCAL_NAME" {
|
if env.Name == "LINKERD2_PROXY_IDENTITY_LOCAL_NAME" {
|
||||||
|
|
Loading…
Reference in New Issue