Skip to content

Commit f265a22

Browse files
authored
Merge pull request #4076 from sharifelgamal/4010
Avoid surfacing "error: no objects passed to apply" non-error from addon-manager
2 parents 14414d1 + da0ce6c commit f265a22

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/minikube/logs/logs.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ import (
3535
// rootCauseRe is a regular expression that matches known failure root causes
3636
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted`)
3737

38+
// ignoreRe is a regular expression that matches spurious errors to not surface
39+
var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply")
40+
3841
// importantPods are a list of pods to retrieve logs for, in addition to the bootstrapper logs.
3942
var importantPods = []string{
4043
"kube-apiserver",
@@ -62,7 +65,7 @@ func Follow(r cruntime.Manager, bs bootstrapper.Bootstrapper, runner bootstrappe
6265

6366
// IsProblem returns whether this line matches a known problem
6467
func IsProblem(line string) bool {
65-
return rootCauseRe.MatchString(line)
68+
return rootCauseRe.MatchString(line) && !ignoreCauseRe.MatchString(line)
6669
}
6770

6871
// FindProblems finds possible root causes among the logs

pkg/minikube/logs/logs_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func TestIsProblem(t *testing.T) {
3333
{"apiserver-auth-mode #2852", true, `{"log":"Error: unknown flag: --Authorization.Mode\n","stream":"stderr","time":"2018-06-17T22:16:35.134161966Z"}`},
3434
{"apiserver-admission #3524", true, "error: unknown flag: --GenericServerRunOptions.AdmissionControl"},
3535
{"no-providers-available #3818", true, ` kubelet.go:1662] Failed creating a mirror pod for "kube-apiserver-minikube_kube-system(c7d572aebd3d33b17fa78ae6395b6d0a)": pods "kube-apiserver-minikube" is forbidden: no providers available to validate pod request`},
36+
{"no-objects-passed-to-apply #4010", false, "error: no objects passed to apply"},
3637
}
3738
for _, tc := range tests {
3839
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)