solo-io / wasm

Web Assembly tools and SDKs for extending cloud-native infrastructure
Apache License 2.0
306 stars 40 forks source link

Update wasme deploy envoy to use new config format when running locally #250

Open Sodman opened 3 years ago

Sodman commented 3 years ago

Describe the bug Using wasme deploy envoy with a newer runtime, (eg istio/proxyv2:v1.9.1) works - However if we pass a configuration with --config, the deployed filter can't read from the configuration correctly. This is because it's mangling the string as the type now needs to be explicitly set (it was previously just always a string).

It should be noted that running wasme deploy istio already works correctly and determines the correct configuration format automatically, based on the istio version. This only affects "wasme deploy envoy", when a custom --envoy-image is passed, with the value of a newer image.

To Reproduce Steps to reproduce the behavior:

wasme deploy envoy webassemblyhub.io/username/my-filter:v1.0 --envoy-image docker.io/istio/proxyv2:1.9.1 --config "{'@type': 'type.googleapis.com/google.protobuf.StringValue', 'value': 'envoy'}"

Expected behavior At this point, as Istio 1.6 is the "newest" version that uses the old config, and is itself already End-Of-Life'd (as is 1.7 as of this writing), we should simply always use the newer behavior, where the configuration takes a type and a value.

Additional context This impacts all istio versions running version >= 1.7.0, and essentially all supported versions of Gloo Edge.

Here's the code in the wasme istio provider that swaps out the config based on if it's pre or post Istio 1.6 (which works): https://github.com/solo-io/wasm/blob/master/tools/wasme/cli/pkg/deploy/istio/istio_provider.go#L476-L491

Here's the code for envoy/local deploys, which only ever uses the older config - https://github.com/solo-io/wasm/blob/master/tools/wasme/cli/pkg/deploy/local/local_provider.go#L215

Related: