kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
260 stars 21 forks source link

Validation is different in manager and CLI with the title of the OpenAPI #903

Closed aabedraba closed 1 year ago

aabedraba commented 1 year ago

Apply the following OpenAPI definition:

openapi: 3.0.0
info:
  title: With Nginx
  version: 1.0.0
servers:
  - url: http://localhost:8080
paths:
  /app1:
    x-kusk: 
      upstream:
        service:
          name: app1-svc
          namespace: default
          port: 8080
    get:
      summary: App1
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string

When applying, it passes CLI validation, but not manager validation:

kusk deploy -i openapi.yaml
🎉 successfully parsed openapi.yaml
✅ initiallizing deployment to fleet kusk-gateway-envoy-fleet
❌ API.gateway.kusk.io "With Nginx" is invalid: metadata.name: Invalid value: "With Nginx": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')