kubernetes/kops · error
kubernetes feature gate must not be empty
Error message
kubernetes feature gate must not be empty
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/new_cluster.go:621
if len(g.Spec.Subnets) == 0 {
return nil, fmt.Errorf("unable to infer any Subnets for InstanceGroup %s ", g.ObjectMeta.Name)
}
ig.AddInstanceGroupNodeLabel()
}
result := NewClusterResult{
Cluster: cluster,
InstanceGroups: instanceGroups,
Channel: channel,
}
return &result, nil
}
func parseKubernetesFeatureGate(featureGate string) (string, bool, error) {
featureGate = strings.TrimSpace(featureGate)
if featureGate == "" {
return "", false, fmt.Errorf("kubernetes feature gate must not be empty")
}
enabled := true
switch featureGate[0] {
case '+':
featureGate = strings.TrimSpace(featureGate[1:])
case '-':
enabled = false
featureGate = strings.TrimSpace(featureGate[1:])
}
if featureGate == "" {
return "", false, fmt.Errorf("kubernetes feature gate must include a feature name")
}
return featureGate, enabled, nil
}
View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/new_cluster.go:621 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/146761faf78ddac7.
Report an issue: GitHub.