diff --git a/kube/client/client.go b/kube/client/client.go index 0d575cec..7ec1f2e2 100644 --- a/kube/client/client.go +++ b/kube/client/client.go @@ -85,15 +85,21 @@ func (kc KubeClient) GetPod(ctx context.Context, projectName, serviceName string if pods == nil { return nil, nil } - var pod corev1.Pod + + for _, p := range pods.Items { + if p.Name == serviceName { + return &p, nil + } + } + for _, p := range pods.Items { service := p.Labels[api.ServiceLabel] if service == serviceName { - pod = p - break + return &p, nil } } - return &pod, nil + + return nil, nil } // Exec executes a command in a container