mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
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 ```
This commit is contained in:
commit
992b18065d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user