{"record":{"id":"146761faf78ddac7","repo":"kubernetes/kops","slug":"kubernetes-feature-gate-must-not-be-empty","errorCode":null,"errorMessage":"kubernetes feature gate must not be empty","messagePattern":"kubernetes feature gate must not be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":621,"sourceCode":"\t\tif len(g.Spec.Subnets) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"unable to infer any Subnets for InstanceGroup %s \", g.ObjectMeta.Name)\n\t\t}\n\n\t\tig.AddInstanceGroupNodeLabel()\n\t}\n\n\tresult := NewClusterResult{\n\t\tCluster:        cluster,\n\t\tInstanceGroups: instanceGroups,\n\t\tChannel:        channel,\n\t}\n\treturn &result, nil\n}\n\nfunc parseKubernetesFeatureGate(featureGate string) (string, bool, error) {\n\tfeatureGate = strings.TrimSpace(featureGate)\n\tif featureGate == \"\" {\n\t\treturn \"\", false, fmt.Errorf(\"kubernetes feature gate must not be empty\")\n\t}\n\n\tenabled := true\n\tswitch featureGate[0] {\n\tcase '+':\n\t\tfeatureGate = strings.TrimSpace(featureGate[1:])\n\tcase '-':\n\t\tenabled = false\n\t\tfeatureGate = strings.TrimSpace(featureGate[1:])\n\t}\n\n\tif featureGate == \"\" {\n\t\treturn \"\", false, fmt.Errorf(\"kubernetes feature gate must include a feature name\")\n\t}\n\n\treturn featureGate, enabled, nil\n}\n","sourceCodeStart":603,"sourceCodeEnd":639,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L603-L639","documentation":"parseKubernetesFeatureGate returns this sentinel validation error when the --set-feature-gates entry is empty or whitespace after trimming. It fires before any +/- sign parsing, so an empty string among the feature-gate list aborts cluster creation.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/new_cluster.go:621 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove empty entries from the feature-gate list (check for trailing/double commas)","Pass gates in the form FeatureName=true/false or +FeatureName/-FeatureName"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}