kubernetes/kops · error
KubernetesPath::WriteFile not supported
Error message
KubernetesPath::WriteFile not supported
What it means
Hard guard: writing is not supported on k8s:// VFS paths, so KubernetesPath.WriteFile always returns this error. The VFS layer only reads objects from the API server; creating or overwriting objects requires the typed Kubernetes APIs, so any generic VFS write against a KubernetesPath fails here unconditionally.
Source
Thrown at util/pkg/vfs/k8sfs.go:94
}
func (p *KubernetesPath) RemoveAllVersions(ctx context.Context) error {
return p.Remove(ctx)
}
func (p *KubernetesPath) Join(relativePath ...string) Path {
args := []string{p.key}
args = append(args, relativePath...)
joined := path.Join(args...)
return &KubernetesPath{
k8sContext: p.k8sContext,
host: p.host,
key: joined,
}
}
func (p *KubernetesPath) WriteFile(ctx context.Context, data io.ReadSeeker, acl ACL) error {
return fmt.Errorf("KubernetesPath::WriteFile not supported")
}
func (p *KubernetesPath) CreateFile(ctx context.Context, data io.ReadSeeker, acl ACL) error {
return fmt.Errorf("KubernetesPath::CreateFile not supported")
}
// ReadFile implements Path::ReadFile
func (p *KubernetesPath) ReadFile(ctx context.Context) ([]byte, error) {
var b bytes.Buffer
_, err := p.WriteTo(&b)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
// WriteTo implements io.WriterTo
func (p *KubernetesPath) WriteTo(out io.Writer) (int64, error) {View on GitHub (pinned to 4c8573c808)
Solutions
- Write ConfigMaps/Secrets through the Kubernetes clientset instead of VFS
- Choose an S3/GCS/mem destination when generating files during provisioning
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at util/pkg/vfs/k8sfs.go:94 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/24929dd71882ee9f.
Report an issue: GitHub.