Commit 992b1806 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #42183 from sttts/sttts-bool-parse-warning

Automatic merge from submit-queue (batch tested with PRs 42216, 42136, 42183, 42149, 36828) Fix bool parse warning in apimachinery ```golang var DefaultConverter = NewConverter(parseBool(os.Getenv("KUBE_PATCH_CONVERSION_DETECTOR"))) func parseBool(key string) bool { value, err := strconv.ParseBool(key) if err != nil { utilruntime.HandleError(fmt.Errorf("Couldn't parse '%s' as bool for unstructured mismatch detection", key)) } return value } ```` leading to ``` W0227 10:06:01.037] E0227 10:06:01.023502 16550 converter.go:87] Couldn't parse '' as bool for unstructured mismatch detection ```
parents 9442f1aa 1900810f
......@@ -82,6 +82,9 @@ var (
)
func parseBool(key string) bool {
if len(key) == 0 {
return false
}
value, err := strconv.ParseBool(key)
if err != nil {
utilruntime.HandleError(fmt.Errorf("Couldn't parse '%s' as bool for unstructured mismatch detection", key))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment