Kuadrant / Kuadrant/kuadrantctl

Generated HTTPRoute contains null fields

Open
#91 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
8
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

Open the contributing guide

Research direction

The issue provides a generated HTTPRoute and its source OpenAPI document, but names no files or tests. Reproduce generation with the supplied example, trace the HTTPRoute output path, and verify that the result contains no null fields and can be supplied directly to kubectl apply without disabling validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.