-
Notifications
You must be signed in to change notification settings - Fork 672
-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeepCopy unstructured HTTPProxy causes panic #2123
Comments
Thanks for raising this issue. I think we can change some of these uints to ints pretty painlessly but there might be some that have a direct correlation with the value that envoy consumes so some care might need to be taken there. The thing about using unsigned ints in general is the json schema makes harder for people to give negative values for weights. |
Perfectly understand the reasoning behind the use of the uints. Is it possible to use validation rules in the schema to enforce that negative values aren't used? i.e. |
…dd validation This commit replaces the unsigned integers in the HTTPProxy and IngressRoute CRDs with signed integers. Unsigned integers are discouraged due to API compatibility issues. Validation rules have been added to the fields to ensure that the value provided is always positive. Fixes projectcontour#2123 Signed-off-by: Alex Price <aprice@atlassian.com>
…dd validation This commit replaces the unsigned integers in the HTTPProxy and IngressRoute CRDs with signed integers. Unsigned integers are discouraged due to API compatibility issues. Validation rules have been added to the fields to ensure that the value provided is always positive. Fixes projectcontour#2123 Signed-off-by: Alex Price <aprice@atlassian.com>
…dd validation This commit replaces the unsigned integers in the HTTPProxy and IngressRoute CRDs with signed integers. Unsigned integers are discouraged due to API compatibility issues. Validation rules have been added to the fields to ensure that the value provided is always positive. Fixes #2123 Signed-off-by: Alex Price <aprice@atlassian.com>
What steps did you take and what happened:
When converting an HTTPProxy object to an unstructured object and then performing a DeepCopy on that unstructured object, a panic is experienced.
The following code can be used to replicate:
When run, results in:
What did you expect to happen:
For the above code to run without issue.
Anything else you would like to add:
I believe this is occurring due to the use of
uint32
for theweight
(and other fields) in the HTTPProxy struct. I've manually changed theweight
field in theService
struct fromuint32
to a signed integer and the code above runs fine.Works:
Looking at the Kubernetes external API codebase, no unsigned integers are used in the public structs - https://github.com/kubernetes/api, most likely for this reason.
Environment:
kubectl version
): v1.15.7/etc/os-release
): N/AThe text was updated successfully, but these errors were encountered: