{"record":{"id":"ef27b8c4a73e55c1","repo":"kubernetes/kops","slug":"kubernetespath-remove-not-supported","errorCode":null,"errorMessage":"KubernetesPath::Remove not supported","messagePattern":"KubernetesPath::Remove not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/k8sfs.go","lineNumber":71,"sourceCode":"\nfunc (p *KubernetesPath) Path() string {\n\treturn \"k8s://\" + p.host + \"/\" + p.key\n}\n\nfunc (p *KubernetesPath) Host() string {\n\treturn p.host\n}\n\nfunc (p *KubernetesPath) Key() string {\n\treturn p.key\n}\n\nfunc (p *KubernetesPath) String() string {\n\treturn p.Path()\n}\n\nfunc (p *KubernetesPath) Remove(ctx context.Context) error {\n\treturn fmt.Errorf(\"KubernetesPath::Remove not supported\")\n}\n\nfunc (p *KubernetesPath) RemoveAll(ctx context.Context) error {\n\treturn fmt.Errorf(\"KubernetesPath::RemoveAll not supported\")\n}\n\nfunc (p *KubernetesPath) RemoveAllVersions(ctx context.Context) error {\n\treturn p.Remove(ctx)\n}\n\nfunc (p *KubernetesPath) Join(relativePath ...string) Path {\n\targs := []string{p.key}\n\targs = append(args, relativePath...)\n\tjoined := path.Join(args...)\n\treturn &KubernetesPath{\n\t\tk8sContext: p.k8sContext,\n\t\thost:       p.host,\n\t\tkey:        joined,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/k8sfs.go#L53-L89","documentation":"Hard guard: KubernetesPath (k8s:// VFS paths backed by the API server) is read-mostly and does not implement deletion, so Remove always returns this error. RemoveAllVersions delegates to Remove, so versioned cleanup hits the same wall. Any code attempting to delete through a k8s:// path will always fail here.","triggerScenarios":"Thrown at util/pkg/vfs/k8sfs.go:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the Kubernetes API (client-go) to delete ConfigMaps/Secrets instead of the VFS layer","Filter out k8s:// paths before calling Remove in generic VFS code","Use an S3/GCS/mem path if write-then-delete semantics are required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}