Skip to content
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

reduce yaml output verbosity #67

Merged
merged 1 commit into from
May 1, 2024
Merged

reduce yaml output verbosity #67

merged 1 commit into from
May 1, 2024

Conversation

jasonmadigan
Copy link
Member

@jasonmadigan jasonmadigan commented May 1, 2024

Reducing yaml output verbosity (similar to the JSON output, which uses omit's empties)

Before:

./kuadrantctl generate gatewayapi httproute -o yaml --oas examples/oas3/petstore-with-rate-limit-kuadrant-extensions.yaml
typemeta:
  kind: HTTPRoute
  apiversion: gateway.networking.k8s.io/v1beta1
objectmeta:
  name: petstore
  generatename: ""
  namespace: petstore
  selflink: ""
  uid: ""
  resourceversion: ""
  generation: 0
  creationtimestamp: "0001-01-01T00:00:00Z"
  deletiontimestamp: null
  deletiongraceperiodseconds: null
  labels: {}
  annotations: {}
  ownerreferences: []
  finalizers: []
  managedfields: []
spec:
  commonroutespec:
    parentrefs:
    - group: null
      kind: null
      namespace: istio-system
      name: istio-ingressgateway
      sectionname: null
      port: null
  hostnames:
  - example.com
  rules:
  - matches:
    - path:
        type: Exact
        value: /api/v1/cat
      headers: []
      queryparams: []
      method: GET
    filters: []
    backendrefs:
    - backendref:
        backendobjectreference:
          group: null
          kind: null
          name: petstore
          namespace: petstore
          port: 80
        weight: null
      filters: []
  - matches:
    - path:
        type: Exact
        value: /api/v1/dog
      headers: []
      queryparams: []
      method: GET
    filters: []
    backendrefs:
    - backendref:
        backendobjectreference:
          group: null
          kind: null
          name: petstore
          namespace: petstore
          port: 80
        weight: null
      filters: []
  - matches:
    - path:
        type: Exact
        value: /api/v1/dog
      headers: []
      queryparams: []
      method: POST
    filters: []
    backendrefs:
    - backendref:
        backendobjectreference:
          group: null
          kind: null
          name: petstore
          namespace: petstore
          port: 80
        weight: null
      filters: []
status:
  routestatus:
    parents: []

After:

./kuadrantctl generate gatewayapi httproute -o yaml --oas examples/oas3/petstore-with-rate-limit-kuadrant-extensions.yaml
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  creationTimestamp: null
  name: petstore
  namespace: petstore
spec:
  hostnames:
  - example.com
  parentRefs:
  - name: istio-ingressgateway
    namespace: istio-system
  rules:
  - backendRefs:
    - name: petstore
      namespace: petstore
      port: 80
    matches:
    - method: GET
      path:
        type: Exact
        value: /api/v1/cat
  - backendRefs:
    - name: petstore
      namespace: petstore
      port: 80
    matches:
    - method: POST
      path:
        type: Exact
        value: /api/v1/dog
  - backendRefs:
    - name: petstore
      namespace: petstore
      port: 80
    matches:
    - method: GET
      path:
        type: Exact
        value: /api/v1/dog
status:
  parents: null

Copy link

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple enough looking change
/lgtm

@jasonmadigan jasonmadigan merged commit b87543f into main May 1, 2024
5 checks passed
@eguzki eguzki deleted the reduce-yaml-verbosity branch May 15, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants