Merge pull request #31669 from brendenehlers/fix/31665

fix: #31665 add default cases to switch statements
pull/31574/head
George Jenkins 9 months ago committed by GitHub
commit f562a36d58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -32,6 +32,7 @@ linters:
- unused - unused
- usestdlibvars - usestdlibvars
- usetesting - usetesting
- exhaustive
exclusions: exclusions:
@ -73,6 +74,9 @@ linters:
recommendations: recommendations:
- github.com/evanphx/json-patch/v5 - github.com/evanphx/json-patch/v5
exhaustive:
default-signifies-exhaustive: true
run: run:
timeout: 10m timeout: 10m

@ -86,19 +86,19 @@ func podConditions(u *unstructured.Unstructured) (*status.Result, error) {
}, },
}, },
}, nil }, nil
} default:
message := "Pod in progress"
message := "Pod in progress" return &status.Result{
return &status.Result{ Status: status.InProgressStatus,
Status: status.InProgressStatus, Message: message,
Message: message, Conditions: []status.Condition{
Conditions: []status.Condition{ {
{ Type: status.ConditionReconciling,
Type: status.ConditionReconciling, Status: corev1.ConditionTrue,
Status: corev1.ConditionTrue, Reason: "PodInProgress",
Reason: "PodInProgress", Message: message,
Message: message, },
}, },
}, }, nil
}, nil }
} }

@ -103,11 +103,11 @@ func (r *repoListWriter) encodeByFormat(out io.Writer, format output.Format) err
return output.EncodeJSON(out, repolist) return output.EncodeJSON(out, repolist)
case output.YAML: case output.YAML:
return output.EncodeYAML(out, repolist) return output.EncodeYAML(out, repolist)
default:
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }
// Returns all repos from repos, except those with names matching ignoredRepoNames // Returns all repos from repos, except those with names matching ignoredRepoNames

@ -190,9 +190,10 @@ func (h *hubSearchWriter) encodeByFormat(out io.Writer, format output.Format) er
return output.EncodeJSON(out, chartList) return output.EncodeJSON(out, chartList)
case output.YAML: case output.YAML:
return output.EncodeYAML(out, chartList) return output.EncodeYAML(out, chartList)
default:
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }

@ -260,11 +260,11 @@ func (r *repoSearchWriter) encodeByFormat(out io.Writer, format output.Format) e
return output.EncodeJSON(out, chartList) return output.EncodeJSON(out, chartList)
case output.YAML: case output.YAML:
return output.EncodeYAML(out, chartList) return output.EncodeYAML(out, chartList)
default:
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }
// Because this is a non-exported function and only called internally by
// WriteJSON and WriteYAML, we shouldn't get invalid types
return nil
} }
// Provides the list of charts that are part of the specified repo, and that starts with 'prefix'. // Provides the list of charts that are part of the specified repo, and that starts with 'prefix'.

@ -354,6 +354,8 @@ func (c *ReadyChecker) crdBetaReady(crd apiextv1beta1.CustomResourceDefinition)
// continue. // continue.
return true return true
} }
default:
// intentionally left empty
} }
} }
return false return false
@ -374,6 +376,8 @@ func (c *ReadyChecker) crdReady(crd apiextv1.CustomResourceDefinition) bool {
// continue. // continue.
return true return true
} }
default:
// intentionally left empty
} }
} }
return false return false

@ -333,6 +333,8 @@ func (hw *legacyWaiter) waitForPodSuccess(obj runtime.Object, name string) (bool
slog.Debug("pod pending", "pod", o.Name) slog.Debug("pod pending", "pod", o.Name)
case corev1.PodRunning: case corev1.PodRunning:
slog.Debug("pod running", "pod", o.Name) slog.Debug("pod running", "pod", o.Name)
case corev1.PodUnknown:
slog.Debug("pod unknown", "pod", o.Name)
} }
return false, nil return false, nil

Loading…
Cancel
Save