{"record":{"id":"cfdbf9051c359cb2","repo":"kubernetes/kops","slug":"must-specify-cloud","errorCode":null,"errorMessage":"must specify cloud","messagePattern":"must specify cloud","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops-controller/main.go","lineNumber":377,"sourceCode":"\t\tidentifier, err = nodeidentityscw.New(opt.CacheNodeidentityInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building node identifier: %w\", err)\n\t\t}\n\n\tcase \"metal\":\n\t\tidentifier, err = nodeidentitymetal.New()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building metal node identifier: %w\", err)\n\t\t}\n\n\tcase \"linode\":\n\t\tidentifier, err = nodeidentitylinode.New(opt.CacheNodeidentityInfo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building linode node identifier: %w\", err)\n\t\t}\n\n\tcase \"\":\n\t\treturn fmt.Errorf(\"must specify cloud\")\n\n\tdefault:\n\t\treturn fmt.Errorf(\"identifier for cloud %q not implemented\", opt.Cloud)\n\t}\n\n\tnodeController, err := controllers.NewNodeReconciler(mgr, identifier)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := nodeController.SetupWithManager(mgr); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Reconciler is the interface for a standard Reconciler.\ntype Reconciler interface {","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L359-L395","documentation":"addNodeController switches on opt.Cloud to pick a NodeIdentifier; when opt.Cloud is the empty string it returns the plain error \"must specify cloud\". kops-controller cannot choose a cloud-specific node identity provider without knowing the cloud, so startup fails fast.","triggerScenarios":"Launching kops-controller without the --cloud flag and without CLOUD set in the environment, so options resolve Cloud to \"\".","commonSituations":"Deployment manifests (Deployment YAML, systemd unit, Helm values) missing the --cloud flag; environment variable not propagated into the container; operator upgraded kOps and dropped the flag from their run command.","solutions":["Add --cloud=<provider> (e.g. aws, gce, openstack, azure, hetzner, digitalocean, scaleway, metal, linode) to the kops-controller invocation","If relying on the CLOUD environment variable, ensure it is set in the pod/container spec","Re-deploy the controller with the complete flag set copied from a known-good configuration"],"exampleFix":"// before (pod args)\nargs:\n  - kops-controller\n  - --config-dir=/etc/kubernetes/kops-controller/\n// after\nargs:\n  - kops-controller\n  - --cloud=aws\n  - --config-dir=/etc/kubernetes/kops-controller/","handlingStrategy":"validation","validationCode":"// validate args before launching\nif opt.Cloud == \"\" {\n\tlog.Error(nil, \"--cloud flag is required\")\n\tos.Exit(2)\n}","typeGuard":null,"tryCatchPattern":"if err := addNodeController(context, opt); err != nil {\n\tlog.Error(err, \"failed to add node controller\")\n\tos.Exit(1)\n}","preventionTips":["Always set --cloud in kops-controller manifests; template it from cluster config","Use a pre-start container script that asserts required flags are non-empty","Copy flag sets from a known-good deployment when upgrading"],"tags":["configuration","missing-flag","kops-controller","startup"],"backgroundTag":"missing-required-flag","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"}