{"record":{"id":"a72d14dbb4de39c5","repo":"kubernetes/kops","slug":"upgrade-is-not-for-use-with-imported-clusters","errorCode":null,"errorMessage":"upgrade is not for use with imported clusters.)","messagePattern":"upgrade is not for use with imported clusters\\.\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/upgrade_cluster.go","lineNumber":117,"sourceCode":"\nfunc RunUpgradeCluster(ctx context.Context, f *util.Factory, out io.Writer, options *UpgradeClusterOptions) error {\n\tcluster, err := GetCluster(ctx, f, options.ClusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstanceGroups, err := commands.ReadAllInstanceGroups(ctx, clientset, cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cluster.ObjectMeta.Annotations[kopsapi.AnnotationNameManagement] == kopsapi.AnnotationValueManagementImported {\n\t\treturn fmt.Errorf(\"upgrade is not for use with imported clusters.)\")\n\t}\n\n\tchannelLocation := options.Channel\n\tif channelLocation == \"\" {\n\t\tchannelLocation = cluster.Spec.Channel\n\t}\n\tif channelLocation == \"\" {\n\t\tchannelLocation = kopsapi.DefaultChannel\n\t}\n\n\tvar actions []*upgradeAction\n\tif channelLocation != cluster.Spec.Channel {\n\t\tactions = append(actions, &upgradeAction{\n\t\t\tItem:     \"Cluster\",\n\t\t\tProperty: \"Channel\",\n\t\t\tOld:      cluster.Spec.Channel,\n\t\t\tNew:      channelLocation,\n\t\t\tapply: func() {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/upgrade_cluster.go#L99-L135","documentation":"Guard in RunUpgradeCluster: the cluster carries the kops.k8s.io/management=imported annotation, meaning it was imported rather than created by kOps. `kops upgrade` only manages kOps-created clusters and refuses to modify imported configuration. (Note the stray ')' in the message.)","triggerScenarios":"Thrown at cmd/kops/upgrade_cluster.go:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Manage upgrades of imported clusters with the upstream tooling","Remove the imported annotation only if the cluster is actually kOps-managed","Use kops edit cluster for manual spec changes instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}