Skip to content

Commit fdec92c

Browse files
committed
add gcp-auth to logs output if enabled
1 parent 24865cd commit fdec92c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/minikube/logs/logs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030

3131
"github.com/pkg/errors"
3232
"k8s.io/klog/v2"
33+
"k8s.io/minikube/pkg/minikube/assets"
3334
"k8s.io/minikube/pkg/minikube/audit"
3435
"k8s.io/minikube/pkg/minikube/bootstrapper"
3536
"k8s.io/minikube/pkg/minikube/command"
@@ -265,7 +266,11 @@ func OutputOffline(lines int, logOutput *os.File) {
265266
// logCommands returns a list of commands that would be run to receive the anticipated logs
266267
func logCommands(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.ClusterConfig, length int, follow bool) map[string]string {
267268
cmds := bs.LogCommands(cfg, bootstrapper.LogOptions{Lines: length, Follow: follow})
268-
for _, pod := range importantPods {
269+
pods := importantPods
270+
if assets.Addons["gcp-auth"].IsEnabled(&cfg) {
271+
pods = append(pods, "gcp-auth")
272+
}
273+
for _, pod := range pods {
269274
ids, err := r.ListContainers(cruntime.ListContainersOptions{Name: pod})
270275
if err != nil {
271276
klog.Errorf("Failed to list containers for %q: %v", pod, err)

0 commit comments

Comments
 (0)