Skip to content

ProtocolType may not work as expected because of the case #3184

@spacewander

Description

@spacewander

What happened:

Provide a configuration like:

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: default
spec:
  gatewayClassName: istio
  listeners:
  - name: tcp
    port: 10001
    protocol: tcp
    allowedRoutes:
      kinds:
      - kind: TCPRoute

The result is that this resource is accepted (because "tcp" is valid protocol name), but doesn't treat it as TCP protocol (because it is not equal to TCPProtocolType constant).

What you expected to happen:

Either this resource is rejected (because the TCP protocol name is "TCP", no "tcp"), or handle it as TCP protocol.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

IMHO, we can either require the ProtocolType to be treated as case-insensitive, or require all Core protocols to be uppercase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions