replicatedhq/troubleshoot

exec collector is running in all pods matched the selector

nvanthao opened this issue · 1 comments

Bug Description

Our doc states that

When the selector refers to more than one replica of a pod, the exec collector will execute in only one of the pods

Expected Behavior
Only exec in 1 pod rather than all pods matched the selector

Steps To Reproduce

  • Run exec collector to a Deployment with 2 replicas
  • Notice exec are running in 2 pods

Additional Context

  • Troubleshoot version: 0.93.2

for _, pod := range pods {
stdout, stderr, execErrors := getExecOutputs(ctx, clientConfig, client, pod, execCollector)
path := filepath.Join(execCollector.Name, pod.Namespace, pod.Name)
if len(stdout) > 0 {
output.SaveResult(bundlePath, filepath.Join(path, execCollector.CollectorName+"-stdout.txt"), bytes.NewBuffer(stdout))
}

Is this a bug in the collector, or the docs? I would have expected a deployment with 2 replicas to run 2.