Kuadrant / kuadrantctl

Kuadrant configuration command line utility
Apache License 2.0
6 stars 12 forks source link

Generated HTTPRoute contains null fields #91

Open pehala opened 3 weeks ago

pehala commented 3 weeks ago

When generating HTTPRoute, it contains null fields. This can cause validation errors (incorrect status in this case) when supplying output directly to kubectl apply (Can be fixed by using --validate=false) Version: 0.2.3

Generated HTTPRoute:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  creationTimestamp: null
  name: route-phala--a3ji
spec:
  hostnames:
  - test.com
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: gw-phala--cynv
    namespace: kuadrant
  rules:
  - matches:
    - method: GET
      path:
        type: Exact
        value: /get
  - matches:
    - method: PUT
      path:
        type: Exact
        value: /anything
  - matches:
    - method: GET
      path:
        type: Exact
        value: /anything
status:
  parents: null

Source OAS:

info:
  title: Httpbin
  version: 0.0.51
  x-kuadrant:
    route:
      hostnames:
      - test.com
      name: route-phala--a3ji
      parentRefs:
      - group: gateway.networking.k8s.io
        kind: Gateway
        name: gw-phala--cynv
        namespace: kuadrant
openapi: 3.1.0
paths:
  /anything:
    get:
      operationId: get_anything
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
          description: Successful Response
    put:
      operationId: put_anything
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
          description: Successful Response
  /get:
    get:
      operationId: get_get
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
          description: Successful Response