kubernetes/kops · error

incorrect syntax for lifecyle-overrides, correct syntax is T

Error message

incorrect syntax for lifecyle-overrides, correct syntax is TaskName=lifecycleName, override provided: %q

What it means

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.

Source

Thrown at cmd/kops/update_cluster.go:332

			phase = cloudup.PhaseSecurity
		case string(cloudup.PhaseCluster):
			phase = cloudup.PhaseCluster
		default:
			return results, fmt.Errorf("unknown phase %q, available phases: %s", c.Phase, strings.Join(cloudup.Phases.List(), ","))
		}
	}

	deletionProcessing := fi.DeletionProcessingModeDeleteIfNotDeferrred
	if c.Prune {
		deletionProcessing = fi.DeletionProcessingModeDeleteIncludingDeferred
	}

	lifecycleOverrideMap := make(map[string]fi.Lifecycle)

	for _, override := range c.LifecycleOverrides {
		values := strings.Split(override, "=")
		if len(values) != 2 {
			return results, fmt.Errorf("incorrect syntax for lifecyle-overrides, correct syntax is TaskName=lifecycleName, override provided: %q", override)
		}

		taskName := values[0]
		lifecycleName := values[1]

		lifecycleOverride, err := parseLifecycle(lifecycleName)
		if err != nil {
			return nil, err
		}

		lifecycleOverrideMap[taskName] = lifecycleOverride
	}

	var instanceGroupFilters []predicates.Predicate[*kops.InstanceGroup]
	if len(c.InstanceGroups) != 0 {
		instanceGroupFilters = append(instanceGroupFilters, matchInstanceGroupNames(c.InstanceGroups))
	} else if len(c.InstanceGroupRoles) != 0 {
		instanceGroupFilters = append(instanceGroupFilters, matchInstanceGroupRoles(c.InstanceGroupRoles))

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Format each override as TaskName=lifecycleName, comma-separated: `--lifecycle-overrides InternetGateway=ExistsAndWarnIfChanges,DHCPCloudinit=Ignore`
  2. Quote the whole flag value so the shell doesn't split it
  3. Remove empty segments / trailing commas from the list

Example fix

// before
--lifecycle-overrides InternetGateway=ExistsAndWarnIfChanges VPC=ExistsAndWarnIfChanges
// after
--lifecycle-overrides "InternetGateway=ExistsAndWarnIfChanges,VPC=ExistsAndWarnIfChanges"
Defensive patterns

Strategy: validation

Validate before calling

for _, ov := range c.LifecycleOverrides {
	parts := strings.Split(ov, "=")
	if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
		return fmt.Errorf("override %q must be TaskName=lifecycleName", ov)
	}
}
_ = runUpdateCluster(c)

Prevention

When it happens

Trigger: `--lifecycle-overrides` values such as `DHCPCloudinit` (no '='), `Task=lifecycle=extra` (two '='), or an empty entry (e.g. trailing comma producing an empty string).

Common situations: 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.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/f192732aa76e13fa. Report an issue: GitHub.