kubernetes/kops · error

unknown lifecycle %q, available lifecycle: %s

Error message

unknown lifecycle %q, available lifecycle: %s

What it means

parseLifecycle maps a human lifecycle name (e.g. ignore, warn, apply) to fi.Lifecycle via fi.LifecycleNameMap. If the string is not a known lifecycle name, it returns this error listing all valid lifecycles. It is called while validating --lifecycle-overrides values.

Source

Thrown at cmd/kops/update_cluster.go:508

			fmt.Fprintf(sb, "\n")
			fmt.Fprintf(sb, "Changes may require instances to restart: kops rolling-update cluster\n")
			fmt.Fprintf(sb, "\n")
		}

		_, err := out.Write(sb.Bytes())
		if err != nil {
			return nil, fmt.Errorf("error writing to output: %v", err)
		}
	}

	return results, nil
}

func parseLifecycle(lifecycle string) (fi.Lifecycle, error) {
	if v, ok := fi.LifecycleNameMap[lifecycle]; ok {
		return v, nil
	}
	return "", fmt.Errorf("unknown lifecycle %q, available lifecycle: %s", lifecycle, strings.Join(fi.Lifecycles.List(), ","))
}

func usesBastion(instanceGroups []*kops.InstanceGroup) bool {
	for _, ig := range instanceGroups {
		if ig.Spec.Role.HasBastion() {
			return true
		}
	}

	return false
}

func findBastionPublicName(c *kops.Cluster) string {
	topology := c.Spec.Networking.Topology
	if topology == nil {
		return ""
	}
	bastion := topology.Bastion

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Use an exact name from the error message's list (e.g. Ignore, ExistsAndWarnIfChanges, Apply) — check the casing in fi.Lifecycles for your kOps version
  2. Split TaskName from lifecycleName correctly: the error is about the right-hand side of '='
  3. Run `kops update cluster --help` to confirm the accepted lifecycle spellings for your version

Example fix

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

Strategy: validation

Validate before calling

func validLifecycle(name string) bool {
	_, ok := fi.LifecycleNameMap[name]
	return ok
}
// pre-check each override before calling update:
for _, ov := range overrides {
	if lifecycle := strings.SplitN(ov, "=", 2)[1]; !validLifecycle(lifecycle) {
		return fmt.Errorf("override %q uses unknown lifecycle %q", ov, lifecycle)
	}
}

Prevention

When it happens

Trigger: `--lifecycle-overrides Task=xyz` where xyz is not in fi.Lifecycles (typical valid names: ignore, exists, exists-and-warn-if-changes, warn, apply); wrong case such as Apply; or using a synonym like 'create' instead of 'apply'.

Common situations: Typos in scripted override lists; case-sensitivity mistakes; copying lifecycle names from other IaC tools (terraform's 'create', pulumi's 'update'); versions of kOps with slightly different lifecycle vocabularies.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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