kubernetes/kops · error

KubernetesPath::WriteTo not supported

Error message

KubernetesPath::WriteTo not supported

What it means

Hard guard: streaming a k8s:// path to a writer is not implemented, so KubernetesPath.WriteTo always returns this error. ReadFile calls WriteTo internally, so reading a KubernetesPath through the generic VFS read path also surfaces this error — content must be fetched via the Kubernetes API instead.

Source

Thrown at util/pkg/vfs/k8sfs.go:113

}

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) {
	return 0, fmt.Errorf("KubernetesPath::WriteTo not supported")
}

func (p *KubernetesPath) ReadDir() ([]Path, error) {
	return nil, fmt.Errorf("KubernetesPath::ReadDir not supported")
}

func (p *KubernetesPath) ReadTree(ctx context.Context) ([]Path, error) {
	return nil, fmt.Errorf("KubernetesPath::ReadTree not supported")
}

func (p *KubernetesPath) Base() string {
	return path.Base(p.key)
}

func (p *KubernetesPath) PreferredHash() (*hashing.Hash, error) {
	return p.Hash(hashing.HashAlgorithmMD5)
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fetch the object (ConfigMap/Secret) with client-go and write the bytes yourself
  2. Implement or use a Kubernetes-aware reader rather than the generic io.WriterTo path
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at util/pkg/vfs/k8sfs.go:113 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/a7dc9d68535526aa. Report an issue: GitHub.