{"record":{"id":"707274441e7ca0ea","repo":"kubernetes/kops","slug":"cluster-delete-not-implemented-for-vfs-store","errorCode":null,"errorMessage":"cluster Delete not implemented for vfs store","messagePattern":"cluster Delete not implemented for vfs store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/cluster.go","lineNumber":219,"sourceCode":"\t}\n\tif c.ObjectMeta.Name != clusterName {\n\t\tklog.Warningf(\"Name of cluster does not match: actual name was %q, but cluster name was %q (using registry path %v).\", c.ObjectMeta.Name, clusterName, registry.PathCluster)\n\t}\n\n\t// TODO: Split this out into real version updates / schema changes\n\tif c.Spec.ConfigStore.Base == \"\" {\n\t\tconfigBase, err := r.configBase(clusterName)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error building ConfigStore.Base for cluster: %v\", err)\n\t\t}\n\t\tc.Spec.ConfigStore.Base = configBase.Path()\n\t}\n\n\treturn c, nil\n}\n\nfunc (r *ClusterVFS) Delete(name string, options *metav1.DeleteOptions) error {\n\treturn fmt.Errorf(\"cluster Delete not implemented for vfs store\")\n}\n\nfunc (r *ClusterVFS) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {\n\treturn fmt.Errorf(\"cluster DeleteCollection not implemented for vfs store\")\n}\n\nfunc (r *ClusterVFS) Watch(opts metav1.ListOptions) (watch.Interface, error) {\n\treturn nil, fmt.Errorf(\"cluster Watch not implemented for vfs store\")\n}\n\nfunc (r *ClusterVFS) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Cluster, err error) {\n\treturn nil, fmt.Errorf(\"cluster Patch not implemented for vfs store\")\n}\n","sourceCodeStart":201,"sourceCodeEnd":233,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/cluster.go#L201-L233","documentation":"The VFS-backed cluster store never implemented Delete; calling ClusterVFS.Delete always returns this error. Deleting cluster state must go through the kops CLI tooling (kops delete cluster), which removes the state-store tree explicitly rather than via this API.","triggerScenarios":"Any call to ClusterVFS.Delete(name, options) — there is no successful path; likewise DeleteCollection returns its own not-implemented error.","commonSituations":"Code written against the clientset interface assuming full CRUD parity; automation scripts using the simple clientset to remove clusters.","solutions":["Use `kops delete cluster --name <name> --yes` (or the equivalent internal tooling) instead of the store API","Implement the deletion manually against the VFS path (basePath/<name>) if embedding the library","Restructure code so it does not call Delete on the vfs clientset"],"exampleFix":"// before\nerr := clusterVFS.Delete(\"prod.example.com\", &metav1.DeleteOptions{})\n// after\n// delete via CLI / vfs directly:\nerr := vfs.Context.Rename(clusterPath, clusterPath.Join(\"deleted\")) // or use kops delete cluster","handlingStrategy":"validation","validationCode":"var errDeleteNotSupported = fmt.Errorf(\"cluster Delete not implemented for vfs store\")\nif errors.Is(err, errDeleteNotSupported) || strings.Contains(err.Error(), \"not implemented for vfs store\") {\n\t// route to CLI-based deletion instead\n}","typeGuard":null,"tryCatchPattern":"err := clusterVFS.Delete(name, &metav1.DeleteOptions{})\nif err != nil && strings.Contains(err.Error(), \"not implemented for vfs store\") {\n\treturn fmt.Errorf(\"use 'kops delete cluster --name %s --yes' to delete\", name)\n}","preventionTips":["Assume the vfs clientset supports only read/create/update, not delete","Use kops CLI (delete cluster) for destructive state-store operations","Check capability before exposing store APIs to automation","Feature-gate delete paths behind real clientset usage"],"tags":["go","vfs","not-implemented","crud"],"backgroundTag":"method-not-implemented","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"}