{"record":{"id":"0dbcdfc4bf8d6fe1","repo":"kubernetes/kops","slug":"instancegroupvfs-patch-not-implemented-for-vfs-sto","errorCode":null,"errorMessage":"InstanceGroupVFS Patch not implemented for vfs store","messagePattern":"InstanceGroupVFS Patch not implemented for vfs store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/instancegroup.go","lineNumber":142,"sourceCode":"\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":124,"sourceCodeEnd":144,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/instancegroup.go#L124-L144","documentation":"The VFS-backed InstanceGroup client does not implement the Kubernetes-style Patch operation; the method always returns this error. Patching requires server-side apply/merge semantics the plain file store cannot provide. Use Update (read-modify-write) instead.","triggerScenarios":"Calling Patch(ctx, name, patchType, data, opts, subresources...) on InstanceGroupVFS against a VFS state store.","commonSituations":"Tools using strategic-merge or JSON patch calls generated from client-go interfaces; automation that patches instance-group specs (e.g. updating node counts) via the VFS clientset.","solutions":["Replace Patch with Get followed by modifying the field and Update to persist changes.","Perform patches through the Kubernetes API server (kops rolling-update / kubectl) instead of the VFS clientset.","Implement Patch in InstanceGroupVFS as read-modify-apply-update if you own the code."],"exampleFix":"// before\nig, err := client.Patch(ctx, \"nodes\", types.StrategicMergePatchType, data, metav1.PatchOptions{})\n// after\nig, err := client.Get(ctx, \"nodes\", metav1.GetOptions{})\nif err != nil { return err }\nig.Spec.MachineType = \"m5.large\"\n_, err = client.Update(ctx, ig, metav1.UpdateOptions{})","handlingStrategy":"fallback","validationCode":"// avoid patch paths entirely on VFS stores\nconst vfsSupportsPatch = false\nif vfsSupportsPatch { /* never */ }","typeGuard":null,"tryCatchPattern":"result, err := igClient.Patch(ctx, name, pt, data, opts)\nif err != nil && strings.Contains(err.Error(), \"not implemented\") {\n  return getModifyUpdate(ctx, igClient, name, data)\n}","preventionTips":["Use Get+Update (read-modify-write) with VFS stores.","Route patch operations through the API server instead of VFS.","Wrap the VFS clientset to hide unimplemented methods at compile time."],"tags":["vfs","patch","unimplemented","instancegroup"],"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-12T07:17:12.445Z"}