{"record":{"id":"52fbdd2623adbe7e","repo":"kubernetes/kops","slug":"kubernetespath-readtree-not-supported","errorCode":null,"errorMessage":"KubernetesPath::ReadTree not supported","messagePattern":"KubernetesPath::ReadTree not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/k8sfs.go","lineNumber":121,"sourceCode":"\tvar b bytes.Buffer\n\t_, err := p.WriteTo(&b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}\n\n// WriteTo implements io.WriterTo\nfunc (p *KubernetesPath) WriteTo(out io.Writer) (int64, error) {\n\treturn 0, fmt.Errorf(\"KubernetesPath::WriteTo not supported\")\n}\n\nfunc (p *KubernetesPath) ReadDir() ([]Path, error) {\n\treturn nil, fmt.Errorf(\"KubernetesPath::ReadDir not supported\")\n}\n\nfunc (p *KubernetesPath) ReadTree(ctx context.Context) ([]Path, error) {\n\treturn nil, fmt.Errorf(\"KubernetesPath::ReadTree not supported\")\n}\n\nfunc (p *KubernetesPath) Base() string {\n\treturn path.Base(p.key)\n}\n\nfunc (p *KubernetesPath) PreferredHash() (*hashing.Hash, error) {\n\treturn p.Hash(hashing.HashAlgorithmMD5)\n}\n\nfunc (p *KubernetesPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) {\n\treturn nil, fmt.Errorf(\"KubernetesPath::Hash not supported\")\n}\n","sourceCodeStart":103,"sourceCodeEnd":135,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/k8sfs.go#L103-L135","documentation":"Hard guard: recursive tree walking is not implemented for k8s:// paths, so KubernetesPath.ReadTree always returns this error. There is no hierarchical namespace to walk on the API server, so any generic code that tries to enumerate a subtree under a KubernetesPath fails here deterministically.","triggerScenarios":"Thrown at util/pkg/vfs/k8sfs.go:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Query the Kubernetes API directly for the objects you need","Branch on the path scheme before calling ReadTree so k8s:// paths take an API-based code path"],"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-12T07:17:12.445Z"}