snowdrop / istio-java-api

A Java API to generate Istio descriptors, inspired by Fabric8's kubernetes-model.
Apache License 2.0
112 stars 33 forks source link

VirtualService Uri parameter is not set correctly #25

Closed bgokden closed 6 years ago

bgokden commented 6 years ago

Hi,

We are having some problem in setting VirtualService uri parameters as in example:

`apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews-route spec: hosts:

We were using additional parameters to set "prefix: /url", but it is not working on this field. We are using StringMatch class to create uri. We tried several variations but always failed.

Maybe it is fixed with 0.11 but it is not pushed to maven yet so we didn't tried.

geoand commented 6 years ago

@bgokden 0.11 is identical to 0.10 I think with the only change being a bump in the Kubernetes Client and Model.

So I doubt that 0.11 will fix your issue

metacosm commented 6 years ago

@bgokden I will look at it ASAP

metacosm commented 6 years ago

The issue is that the code doesn't know how to deal with oneof at the moment. I am going to investigate what can be done.

metacosm commented 6 years ago

I think I'm going to have to hand-code StringMatch for now…

metacosm commented 6 years ago

@bgokden actually, I think that this particular example is wrong, though I do need to fix the StringMatch part: a match element can only have one uri element, not an array, so I think it's an error in the documentation.

bgokden commented 6 years ago

@metacosm I think you are right, there should only one uri inside httpmatch as in this documentation: https://istio.io/docs/reference/config/istio.networking.v1alpha3/#HTTPMatchRequest

It seems like they have conflicting examples in their documentation. @ avalcepina

metacosm commented 6 years ago

Actually, the example is correct, it's just YAML being YAML… :(

metacosm commented 6 years ago

@bgokden do you still require pre-0.8 resources? I'm considering removing them to make things simpler so would appreciate hearing from you on that subject…

bgokden commented 6 years ago

@metacosm no, we are not using anything pre-0.8. You can remove them. Thanks 👍

metacosm commented 6 years ago

Thanks!