Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't pollute minikube profile list with errors if exitcode is absent #19728

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions pkg/minikube/cluster/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,22 +292,29 @@ func GetState(sts []*Status, profile string, cc *config.ClusterConfig) State {
finalStep = data
klog.Infof("transient code %d (%q) for step: %+v", transientCode, codeNames[transientCode], data)
}

if ev.Type() == "io.k8s.sigs.minikube.error" {
var data map[string]string
err := ev.DataAs(&data)
if err != nil {
klog.Errorf("unable to parse data: %v\nraw data: %s", err, ev.Data())
continue
}
exitCode, err := strconv.Atoi(data["exitcode"])
if err != nil {
klog.Errorf("exit code not found: %v", err)
continue
// process exit code, if present
if ec, ok := data["exitcode"]; ok && ec != "" {
exitCode, err := strconv.Atoi(ec)
if err != nil {
klog.Errorf("exit code not found: %v", err)
continue
}

if val, ok := exitCodeToHTTPCode[exitCode]; ok {
exitCode = val
}

transientCode = exitCode
}
if val, ok := exitCodeToHTTPCode[exitCode]; ok {
exitCode = val
}
transientCode = exitCode

for _, n := range cs.Nodes {
n.StatusCode = transientCode
n.StatusName = codeNames[n.StatusCode]
Expand Down
Loading