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

Error parsing Policy YAML #48

Closed geoand closed 5 years ago

geoand commented 5 years ago

When attempting to parse the following:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  creationTimestamp: null
  name: recommendation
  namespace: tutorial
spec:
  hosts:
  - recommendation
  http:
  - match:
    - headers:
        baggage-user-agent:
          regex: .*DarkLaunch.*
    route:
    - destination:
        host: recommendation
        subset: version-v2
  - route:
    - destination:
        host: recommendation
        subset: version-v1

via mapper.readValue(inputStream, VirtualService.class) we get the following error: https://gist.github.com/geoand/98395a190f83949407305ef6bed8f868

geoand commented 5 years ago

cc @lordofthejars

geoand commented 5 years ago

The problem seems to be in the generated HTTPMatchRequest and more specifically the headers field.

metacosm commented 5 years ago

@lordofthejars which version of the API are you using?

geoand commented 5 years ago

@metacosm the same error occurs for the both 1.0.0.Beta1 and the 0.13 which is used in Arquillian,

For what I have found so far, it has to do with the deserialization of Map<String, me.snowdrop.istio.api.networking.v1alpha3.StringMatch>

metacosm commented 5 years ago

@geoand looking into it

geoand commented 5 years ago

@metacosm me too :P

geoand commented 5 years ago

It's looks like a weird Jackson deserialization issue like the ones we love :P

metacosm commented 5 years ago

1.0.0.Beta2 has been released with the fix. Note that the mixer adapter packages have changed to be consistent with the other packages (adapter.* -> mixer.adapter.*)