{"record":{"id":"5d0fb1e97b9e6a49","repo":"kubernetes/kops","slug":"unknown-phase-q","errorCode":null,"errorMessage":"unknown phase %q","messagePattern":"unknown phase %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/apply_cluster.go","lineNumber":244,"sourceCode":"\tcase PhaseNetwork:\n\t\tsecurityLifecycle = fi.LifecycleIgnore\n\t\tclusterLifecycle = fi.LifecycleIgnore\n\n\tcase PhaseSecurity:\n\t\tnetworkLifecycle = fi.LifecycleExistsAndWarnIfChanges\n\t\tclusterLifecycle = fi.LifecycleIgnore\n\n\tcase PhaseCluster:\n\t\tif c.TargetName == TargetDryRun {\n\t\t\tsecurityLifecycle = fi.LifecycleExistsAndWarnIfChanges\n\t\t\tnetworkLifecycle = fi.LifecycleExistsAndWarnIfChanges\n\t\t} else {\n\t\t\tnetworkLifecycle = fi.LifecycleExistsAndValidates\n\t\t\tsecurityLifecycle = fi.LifecycleExistsAndValidates\n\t\t}\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown phase %q\", c.Phase)\n\t}\n\n\tassetBuilder := assets.NewAssetBuilder(c.Clientset.VFSContext(), c.Cluster.Spec.Assets, c.GetAssets)\n\t// Use HasSuffix for CI builds where the cluster spec contains a GCS url like\n\t// https://storage.googleapis.com/k8s-release-dev/ci/v1.36.0-alpha.0.615+cc55e3447816e4\n\t// and ControlPlaneRunningVersion is a build like v1.36.0-alpha.0.615+cc55e3447816e4\n\t// Release versions will be an exact match\n\tif len(c.ControlPlaneRunningVersion) > 0 && !strings.HasSuffix(c.Cluster.Spec.KubernetesVersion, c.ControlPlaneRunningVersion) {\n\t\tassetBuilder.KubeletSupportedVersion = c.ControlPlaneRunningVersion\n\t}\n\terr = c.upgradeSpecs(ctx, assetBuilder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.validateKopsVersion()\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/apply_cluster.go#L226-L262","documentation":"Run() switches on c.Phase to determine which lifecycles apply; the default branch rejects any Phase value that is not one of the recognized phases (e.g. Apply, Plan, or specific lifecycle phases). The user supplied an invalid --phase value, so Run aborts before doing any work.","triggerScenarios":"kops update cluster --phase=bogus (or Phase set programmatically on UpdateClusterOptions) with a string that does not exactly match a supported phase constant such as Cluster, Network, Security, ControlPlane, Node, or the empty string for full apply.","commonSituations":"Typo in --phase (e.g. 'master' instead of 'ControlPlane', lowercase names); scripts carrying a phase name from an older kops version where phases were renamed; CI configs passing an empty or whitespace value.","solutions":["Rerun with a valid --phase value (run 'kops update cluster --help' to list phases); phase names are case-sensitive.","Omit --phase entirely to run the full apply.","If a script hardcodes an old phase name, update it to the phase name supported by the installed kops version."],"exampleFix":"// before\nOptions.Phase = \"masters\"\n// after\nOptions.Phase = fi.LifecyclePhase(\"ControlPlane\")","handlingStrategy":"validation","validationCode":"var validPhases = map[string]bool{\"\": true, \"Cluster\": true, \"Network\": true, \"Security\": true, \"ControlPlane\": true, \"Node\": true, \"Additional\": true}\nif !validPhases[string(opts.Phase)] {\n    return fmt.Errorf(\"unsupported phase %q\", opts.Phase)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hardcode --phase strings in scripts; use kops CLI help to source valid values.","Add a shell-completion/enum check for the phase flag in wrapper scripts.","Re-verify phase names after kops upgrades."],"tags":["cli","validation","phase"],"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"}