{"record":{"id":"559ca29a67e89d30","repo":"kubernetes/kops","slug":"cluster-watch-not-implemented-for-vfs-store","errorCode":null,"errorMessage":"cluster Watch not implemented for vfs store","messagePattern":"cluster Watch not implemented for vfs store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/cluster.go","lineNumber":227,"sourceCode":"\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":209,"sourceCodeEnd":233,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/cluster.go#L209-L233","documentation":"The vfs-backed cluster client cannot provide watch streams: VFS is a static file store with no server-side event mechanism, so Watch always returns this error. Any code that requires change notifications must poll instead.","triggerScenarios":"Calling ClusterVFS.Watch(opts) — e.g. informers, reflectors, or controllers expecting streaming updates on kops Cluster objects stored in VFS (S3/GCS/etc.).","commonSituations":"Reusing kubernetes informer/controller machinery against kops vfs clientset; code migrated from an API-server-backed client to vfs; resync loops expecting live updates.","solutions":["Replace Watch with periodic polling: call List()/Find() on a ticker to detect changes.","Use an API-server-backed kops client (grpc-clientset) if watch semantics are required.","If implementing the client, return watch.NewEmptyWatch() style stubs plus error only where the interface forces it."],"exampleFix":"// before\nw, err := clusterClient.Watch(metav1.ListOptions{})\n// after\nticker := time.NewTicker(30 * time.Second)\nfor range ticker.C {\n    obj, err := clusterClient.List(ctx, metav1.ListOptions{})\n    if err != nil { return err }\n    reconcile(obj)\n}","handlingStrategy":"fallback","validationCode":"if _, ok := clusterClient.(interface{ Watch(metav1.ListOptions) (watch.Interface, error) }); !ok {\n    return errors.New(\"watch unsupported on vfs store; use polling\")\n}","typeGuard":"func supportsWatch(c interface{}) bool {\n    _, ok := c.(interface{ Watch(metav1.ListOptions) (watch.Interface, error) })\n    return ok\n}","tryCatchPattern":"w, err := client.Watch(opts)\nif err != nil && strings.Contains(err.Error(), \"not implemented for vfs store\") {\n    // fall back to polling List() on a ticker\n}","preventionTips":["Never wire vfs-backed clients into informer/reflector machinery.","Use polling with List/Find for change detection on VFS state stores."],"tags":["vfs","unimplemented","watch","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-12T07:17:12.445Z"}