{"record":{"id":"559f1b6e1f171bda","repo":"kubernetes/kops","slug":"unknown-lifecycle-q-available-lifecycle-s","errorCode":null,"errorMessage":"unknown lifecycle %q, available lifecycle: %s","messagePattern":"unknown lifecycle %q, available lifecycle: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/update_cluster.go","lineNumber":508,"sourceCode":"\t\t\tfmt.Fprintf(sb, \"\\n\")\n\t\t\tfmt.Fprintf(sb, \"Changes may require instances to restart: kops rolling-update cluster\\n\")\n\t\t\tfmt.Fprintf(sb, \"\\n\")\n\t\t}\n\n\t\t_, err := out.Write(sb.Bytes())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error writing to output: %v\", err)\n\t\t}\n\t}\n\n\treturn results, nil\n}\n\nfunc parseLifecycle(lifecycle string) (fi.Lifecycle, error) {\n\tif v, ok := fi.LifecycleNameMap[lifecycle]; ok {\n\t\treturn v, nil\n\t}\n\treturn \"\", fmt.Errorf(\"unknown lifecycle %q, available lifecycle: %s\", lifecycle, strings.Join(fi.Lifecycles.List(), \",\"))\n}\n\nfunc usesBastion(instanceGroups []*kops.InstanceGroup) bool {\n\tfor _, ig := range instanceGroups {\n\t\tif ig.Spec.Role.HasBastion() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc findBastionPublicName(c *kops.Cluster) string {\n\ttopology := c.Spec.Networking.Topology\n\tif topology == nil {\n\t\treturn \"\"\n\t}\n\tbastion := topology.Bastion","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/update_cluster.go#L490-L526","documentation":"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.","triggerScenarios":"`--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'.","commonSituations":"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.","solutions":["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","Split TaskName from lifecycleName correctly: the error is about the right-hand side of '='","Run `kops update cluster --help` to confirm the accepted lifecycle spellings for your version"],"exampleFix":"// before\n--lifecycle-overrides \"VPC=create\"\n// after\n--lifecycle-overrides \"VPC=ExistsAndWarnIfChanges\"","handlingStrategy":"validation","validationCode":"func validLifecycle(name string) bool {\n\t_, ok := fi.LifecycleNameMap[name]\n\treturn ok\n}\n// pre-check each override before calling update:\nfor _, ov := range overrides {\n\tif lifecycle := strings.SplitN(ov, \"=\", 2)[1]; !validLifecycle(lifecycle) {\n\t\treturn fmt.Errorf(\"override %q uses unknown lifecycle %q\", ov, lifecycle)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference lifecycle names from a constants list matching fi.Lifecycles, not ad-hoc strings","Mind case sensitivity: names are CamelCase (Apply, Ignore, ExistsAndWarnIfChanges)","Check `kops update cluster --help` for accepted lifecycle values in your version","Validate generated override strings in CI before applying cluster changes"],"tags":["cli","lifecycle","flag-validation"],"backgroundTag":"invalid-enum-value","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"}