{"record":{"id":"25a78030365ffe3a","repo":"kubernetes/kops","slug":"cluster-deletecollection-not-implemented-for-vfs-s","errorCode":null,"errorMessage":"cluster DeleteCollection not implemented for vfs store","messagePattern":"cluster DeleteCollection not implemented for vfs store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/cluster.go","lineNumber":223,"sourceCode":"\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":205,"sourceCodeEnd":233,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/cluster.go#L205-L233","documentation":"The vfs-backed cluster REST client does not implement the DeleteCollection operation. The VFS (file-system) clientset only supports the subset of REST verbs kOps actually uses via the state store, so unsupported methods deliberately return this error. It is a hard capability limit, not a transient failure.","triggerScenarios":"Calling ClusterVFS.DeleteCollection(options, listOptions) — e.g. bulk-deleting clusters through the simple clientset interface against a vfs-backed client.","commonSituations":"Code written against the generic clientset interface (assuming k8s-style DeleteCollection semantics) run against kOps' vfs store; batch cleanup scripts; controllers reusing the interface for kops Cluster resources.","solutions":["Do not call DeleteCollection on a vfs-backed cluster client; delete clusters individually via Delete/Get on the concrete client or the kops CLI (`kops delete cluster`).","List clusters with List()/Find() and loop over names, calling Delete for each, implementing the collection semantics yourself.","If you control the code, add an implementation to ClusterVFS.DeleteCollection following the Delete pattern in vfsclientset."],"exampleFix":"// before\nerr := clusterClient.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{})\n// after\nitems, err := clusterClient.List(ctx, metav1.ListOptions{})\nif err != nil { return err }\nfor _, c := range items.Items {\n    if err := clusterClient.Delete(ctx, c.ObjectMeta.Name, metav1.DeleteOptions{}); err != nil { return err }\n}","handlingStrategy":"validation","validationCode":"if _, ok := clusterClient.(interface{ DeleteCollection(metav1.DeleteOptions, metav1.ListOptions) error }); !ok {\n    return errors.New(\"vfs-backed clientset does not support DeleteCollection\")\n}","typeGuard":"func supportsDeleteCollection(c interface{}) bool {\n    _, ok := c.(interface{ DeleteCollection(*metav1.DeleteOptions, metav1.ListOptions) error })\n    return ok\n}","tryCatchPattern":"if err := client.DeleteCollection(opts, listOpts); err != nil && strings.Contains(err.Error(), \"not implemented for vfs store\") {\n    // fall back to per-object deletes\n}","preventionTips":["Check vfsclientset docs/source for supported verbs before using generic clientset helpers.","Prefer kops CLI (`kops delete cluster`) for bulk cluster deletion against vfs state stores."],"tags":["vfs","unimplemented","deletecollection","clientset"],"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"}