{"record":{"id":"f192732aa76e13fa","repo":"kubernetes/kops","slug":"incorrect-syntax-for-lifecyle-overrides-correct-s","errorCode":null,"errorMessage":"incorrect syntax for lifecyle-overrides, correct syntax is TaskName=lifecycleName, override provided: %q","messagePattern":"incorrect syntax for lifecyle-overrides, correct syntax is TaskName=lifecycleName, override provided: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/update_cluster.go","lineNumber":332,"sourceCode":"\t\t\tphase = cloudup.PhaseSecurity\n\t\tcase string(cloudup.PhaseCluster):\n\t\t\tphase = cloudup.PhaseCluster\n\t\tdefault:\n\t\t\treturn results, fmt.Errorf(\"unknown phase %q, available phases: %s\", c.Phase, strings.Join(cloudup.Phases.List(), \",\"))\n\t\t}\n\t}\n\n\tdeletionProcessing := fi.DeletionProcessingModeDeleteIfNotDeferrred\n\tif c.Prune {\n\t\tdeletionProcessing = fi.DeletionProcessingModeDeleteIncludingDeferred\n\t}\n\n\tlifecycleOverrideMap := make(map[string]fi.Lifecycle)\n\n\tfor _, override := range c.LifecycleOverrides {\n\t\tvalues := strings.Split(override, \"=\")\n\t\tif len(values) != 2 {\n\t\t\treturn results, fmt.Errorf(\"incorrect syntax for lifecyle-overrides, correct syntax is TaskName=lifecycleName, override provided: %q\", override)\n\t\t}\n\n\t\ttaskName := values[0]\n\t\tlifecycleName := values[1]\n\n\t\tlifecycleOverride, err := parseLifecycle(lifecycleName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlifecycleOverrideMap[taskName] = lifecycleOverride\n\t}\n\n\tvar instanceGroupFilters []predicates.Predicate[*kops.InstanceGroup]\n\tif len(c.InstanceGroups) != 0 {\n\t\tinstanceGroupFilters = append(instanceGroupFilters, matchInstanceGroupNames(c.InstanceGroups))\n\t} else if len(c.InstanceGroupRoles) != 0 {\n\t\tinstanceGroupFilters = append(instanceGroupFilters, matchInstanceGroupRoles(c.InstanceGroupRoles))","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/update_cluster.go#L314-L350","documentation":"Each --lifecycle-overrides entry must have the form TaskName=lifecycleName, exactly one '='. RunUpdateCluster splits on '=' and rejects any entry that doesn't yield exactly two parts with this syntax error.","triggerScenarios":"`--lifecycle-overrides` values such as `DHCPCloudinit` (no '='), `Task=lifecycle=extra` (two '='), or an empty entry (e.g. trailing comma producing an empty string).","commonSituations":"Multiple overrides joined with spaces instead of commas so one fragment has no '='; copying YAML-style 'Task: lifecycle' syntax; shell mangling that split the argument; trailing commas in scripted flag lists.","solutions":["Format each override as TaskName=lifecycleName, comma-separated: `--lifecycle-overrides InternetGateway=ExistsAndWarnIfChanges,DHCPCloudinit=Ignore`","Quote the whole flag value so the shell doesn't split it","Remove empty segments / trailing commas from the list"],"exampleFix":"// before\n--lifecycle-overrides InternetGateway=ExistsAndWarnIfChanges VPC=ExistsAndWarnIfChanges\n// after\n--lifecycle-overrides \"InternetGateway=ExistsAndWarnIfChanges,VPC=ExistsAndWarnIfChanges\"","handlingStrategy":"validation","validationCode":"for _, ov := range c.LifecycleOverrides {\n\tparts := strings.Split(ov, \"=\")\n\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\treturn fmt.Errorf(\"override %q must be TaskName=lifecycleName\", ov)\n\t}\n}\n_ = runUpdateCluster(c)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always quote the whole --lifecycle-overrides value in shell","Separate multiple overrides with commas, not spaces","Avoid trailing commas in generated flag lists","Unit-test scripts that build the overrides string dynamically"],"tags":["cli","flag-validation","lifecycle"],"backgroundTag":"flag-syntax-error","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"}