Skip to content

Commit

Permalink
Merge pull request #15666 from spowelljr/gapAuthLogs
Browse files Browse the repository at this point in the history
Add gcp-auth to logs output if enabled
  • Loading branch information
medyagh authored Jan 19, 2023
2 parents 24865cd + fdec92c commit 7cf876c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/minikube/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

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

0 comments on commit 7cf876c

Please sign in to comment.