api icon indicating copy to clipboard operation
api copied to clipboard

WasmPlugin.Priority field should be an int32 to avoid failing on creating the resource with Go lang client

Open jonathanvila opened this issue 3 years ago • 1 comments

(NOTE: This is used to report product bugs: To report a security vulnerability, please visit https://istio.io/about/security-vulnerabilities/ To ask questions about how to use Istio, please visit https://discuss.istio.io )

Bug description Currently WasmPlugin proto definition contains the field Priority of type Int64. When using Protobuf with Go lang to apply an instance of a WasmPlugin to Kubernetes, this marshal will set the value as a string, quoting the contents. https://github.com/gogo/protobuf/blob/master/jsonpb/jsonpb.go#L739 https://github.com/golang/protobuf/issues/1414

This will make Kubernetes to complain and not allowing to apply the resource.

Also considering that a Pod.Priority is an int32 field, I wonder why an int64 is needed to express the plugin priority.

Affected product area (please put an X in all that apply)

[X] Configuration Infrastructure [ ] Docs [ ] Installation [ ] Networking [ ] Performance and Scalability [ ] Policies and Telemetry [ ] Security [ ] Test and Release [ ] User Experience

Expected behavior Set the numeric value for WasmPlugin.Priority and no errors expected.

Steps to reproduce the bug Execute this code : https://gist.github.com/acbbae4ba6a00768b1e7c21db8454d91

Version (include the output of istioctl version --remote and kubectl version) istio : 1.15.1 kubectl : Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.2", GitCommit:"5835544ca568b757a8ecae5c153f317e5736700e", GitTreeState:"clean", BuildDate:"2022-09-21T14:25:45Z", GoVersion:"go1.19.1", Compiler:"gc", Platform:"linux/amd64"} Kustomize Version: v4.5.7

How was Istio installed? helm

Environment where bug was observed (cloud vendor, OS, etc) kind clusters in GCP

Additionally, please consider attaching a cluster state archive by attaching the dump file to this issue.

jonathanvila avatar Oct 10 '22 16:10 jonathanvila

same as https://github.com/istio/istio/issues/41256, we should use the same solution for both

howardjohn avatar Oct 10 '22 16:10 howardjohn

Reopening as this isn't fully merged yet. The changes haven't made it to istio/istio.

ericvn avatar May 24 '23 14:05 ericvn

https://github.com/istio/istio/pull/45103 has a manual merge with updates.

ericvn avatar May 24 '23 16:05 ericvn

https://github.com/istio/istio/pull/45103 has merged

ericvn avatar May 24 '23 17:05 ericvn