{"record":{"id":"745568c626e14f61","repo":"kubernetes/kops","slug":"instancegroupvfs-deletecollection-not-implemented","errorCode":null,"errorMessage":"InstanceGroupVFS DeleteCollection not implemented for vfs store","messagePattern":"InstanceGroupVFS DeleteCollection not implemented for vfs store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/instancegroup.go","lineNumber":134,"sourceCode":"\n\tif !apiequality.Semantic.DeepEqual(old.Spec, g.Spec) {\n\t\tg.SetGeneration(old.GetGeneration() + 1)\n\t}\n\n\tvalidation.ValidateInstanceGroup(g, nil, true)\n\terr = c.update(ctx, c.cluster, g)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn g, nil\n}\n\nfunc (c *InstanceGroupVFS) Delete(ctx context.Context, name string, options metav1.DeleteOptions) error {\n\treturn c.delete(ctx, name, options)\n}\n\nfunc (r *InstanceGroupVFS) DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error {\n\treturn fmt.Errorf(\"InstanceGroupVFS DeleteCollection not implemented for vfs store\")\n}\n\nfunc (r *InstanceGroupVFS) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {\n\treturn nil, fmt.Errorf(\"InstanceGroupVFS Watch not implemented for vfs store\")\n}\n\nfunc (r *InstanceGroupVFS) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kopsapi.InstanceGroup, err error) {\n\treturn nil, fmt.Errorf(\"InstanceGroupVFS Patch not implemented for vfs store\")\n}\n","sourceCodeStart":116,"sourceCodeEnd":144,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/instancegroup.go#L116-L144","documentation":"InstanceGroupVFS does not implement bulk deletion for the VFS-backed state store; DeleteCollection always returns this error. The capability simply is not available for vfs-based clientsets (Watch is likewise unimplemented).","triggerScenarios":"Any call to InstanceGroupVFS.DeleteCollection, e.g. generic cleanup code that deletes all instance groups matching a list/label selector against a VFS-backed client.","commonSituations":"Code shared between the API-server clientset and the VFS clientset hitting the unimplemented method; tooling assuming full k8s client semantics against the kops state store.","solutions":["Enumerate instance groups with List and call Delete per item instead.","Restructure the code path to avoid DeleteCollection when using the VFS clientset.","If the feature is needed, implement DeleteCollection in InstanceGroupVFS by iterating names and deleting each."],"exampleFix":"// before\nc.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{})\n// after\nlist, _ := c.List(ctx, metav1.ListOptions{})\nfor _, ig := range list.Items {\n    _ = c.Delete(ctx, ig.Name, metav1.DeleteOptions{})\n}","handlingStrategy":"fallback","validationCode":"if needsBulkDelete {\n    return fmt.Errorf(\"use per-item Delete with the VFS clientset; DeleteCollection is unsupported\")\n}","typeGuard":null,"tryCatchPattern":"if err := client.DeleteCollection(ctx, opts, listOpts); err != nil {\n    if strings.Contains(err.Error(), \"not implemented\") {\n        return deleteAllIndividually(ctx, client) // fallback path\n    }\n    return err\n}","preventionTips":["Never assume full k8s clientset semantics for VFS-backed clients","Check the interface documentation for unimplemented methods (DeleteCollection, Watch)","Implement fallback per-item deletion in shared code paths"],"tags":["vfs","not-implemented","instancegroup"],"backgroundTag":"operation-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"}