Skip to content

Make kubectl-validate compatible with WASM #79

@eddycharly

Description

@eddycharly

Currently it's not possible to use kubectl-validate and build a wasm module because of dependencies that bring a reference to etcd (that has non supported syscalls).

GOOS=js GOARCH=wasm go build -o ./main.wasm ./main.go

package command-line-arguments
        imports sigs.k8s.io/kubectl-validate/pkg/cmd
        imports k8s.io/apiextensions-apiserver/pkg/apiserver
        imports k8s.io/apiextensions-apiserver/pkg/registry/customresource
        imports k8s.io/apiserver/pkg/registry/generic
        imports k8s.io/apiserver/pkg/storage/storagebackend/factory
        imports go.etcd.io/etcd/client/pkg/v3/transport
        imports golang.org/x/sys/unix: build constraints exclude all Go files in /Users/charled/Documents/dev/eddycharly/kubectl-validate/vendor/golang.org/x/sys/unix

I think there's no reason why it should not be possible, probably requires to change packages organisation a little bit though to avoid the package level reference to etcd ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions