{"record":{"id":"d6ab7189643b1fbd","repo":"kubernetes/kops","slug":"featuregates-w","errorCode":null,"errorMessage":"featureGates: %w","messagePattern":"featureGates: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/kubelet.go","lineNumber":410,"sourceCode":"\tevictionSoft, err := parseKeyValueList(kubeletConfig.EvictionSoft, \"<\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"evictionSoft: %w\", err)\n\t}\n\tcc.EvictionSoft = evictionSoft\n\tevictionSoftGracePeriod, err := parseKeyValueList(kubeletConfig.EvictionSoftGracePeriod, \"=\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"evictionSoftGracePeriod: %w\", err)\n\t}\n\tcc.EvictionSoftGracePeriod = evictionSoftGracePeriod\n\tevictionMinimumReclaim, err := parseKeyValueList(kubeletConfig.EvictionMinimumReclaim, \"=\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"evictionMinimumReclaim: %w\", err)\n\t}\n\tcc.EvictionMinimumReclaim = evictionMinimumReclaim\n\n\tfeatureGates, err := parseFeatureGates(kubeletConfig.FeatureGates)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"featureGates: %w\", err)\n\t}\n\tcc.FeatureGates = featureGates\n\n\tif kubeletConfig.EnforceNodeAllocatable != \"\" {\n\t\tcc.EnforceNodeAllocatable = strings.Split(kubeletConfig.EnforceNodeAllocatable, \",\")\n\t}\n\n\tfor _, t := range kubeletConfig.Taints {\n\t\ttaint, err := parseTaint(t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"taints: %w\", err)\n\t\t}\n\t\tcc.RegisterWithTaints = append(cc.RegisterWithTaints, taint)\n\t}\n\n\treturn cc, nil\n}\n","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/kubelet.go#L392-L428","documentation":"parseFeatureGates converts the kops map[string]string FeatureGates into map[string]bool using strconv.ParseBool. A value that is not a valid Go boolean literal (true/false/1/0/t/f/T/F/TRUE/FALSE etc.) fails ParseBool and is wrapped as \"featureGates: %w\" with detail \"invalid feature gate value \\\"name\\\"=\\\"raw\\\"\".","triggerScenarios":"kubeletConfiguration -> parseFeatureGates(kubeletConfig.FeatureGates) fails when any gate value in spec.kubelet.featureGates is not a parseable boolean string.","commonSituations":"Setting featureGates with YAML-like \"True\" is fine, but \"enabled\", \"yes\", \"on\", or quoted strings with whitespace are not; copying command-line --feature-gates=Foo=true syntax into a map value leaving \"Foo=true\" as the value itself.","solutions":["Set each feature gate value to a boolean literal: true/false (1/0/t/f also accepted)","Check the wrapped message for the offending gate name and value","In kops spec use featureGates: {GateName: \"true\"} format","Upgrade kops if a newly-added gate is being mangled by an old version"],"exampleFix":"// before\nkubelet:\n  featureGates:\n    CSIMigration: \"enabled\"\n// after\nkubelet:\n  featureGates:\n    CSIMigration: \"true\"","handlingStrategy":"validation","validationCode":"func validFeatureGates(gates map[string]string) error {\n    for name, raw := range gates {\n        if _, err := strconv.ParseBool(raw); err != nil {\n            return fmt.Errorf(\"gate %s=%q is not boolean\", name, raw)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := parseFeatureGates(cfg.FeatureGates); err != nil {\n    return fmt.Errorf(\"feature gate values must be true/false: %w\", err)\n}","preventionTips":["Only use boolean literals (true/false/1/0/t/f) as gate values","Never embed 'name=value' strings as map values; keys and values are separate","Check gate names against the Kubernetes version being deployed"],"tags":["kubelet","feature-gates","config-parsing"],"backgroundTag":"feature-gate-value-invalid","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}