mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-13 06:04:02 +00:00
Automatic merge from submit-queue (batch tested with PRs 38751, 44282, 46382, 47603, 47606) kubectl logs with label selector supports specifying a container name **What this PR does / why we need it**: Allows `kubectl logs` to take both a label selector and container name. This allows me to fetch logs from pods by selector whose pods have multiple containers with a common name. This is a common action when debugging components like the service-catalog that ship more than one container in their pod. With this change, the following command lets me get logs for service-catalog. ``` $ kubectl logs -l app=sc-catalog-apiserver --namespace=service-catalog --container=apiserver ```