Skip to content

Hostname doesn't support subdomain with single character in Backend Object #4793

@nothinux

Description

@nothinux

Description:
Hi, we have an issue with backend object when trying to set the hostname with subdomain that has single character in it. For example if we set the hostname to this subdomain backend.s.collector.example.com it will trigger this error

The Backend "backend" is invalid: spec.endpoints[0].fqdn.hostname: Invalid value: "backend.s.collector.example.com": spec.endpoints[0].fqdn.hostname in body should match '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9]))*$'

However when we set it to backend.staging.collector.example.com there's no issue

Is the regex is expected to not allow subdomain with single character?

// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9]))*$`
Hostname string `json:"hostname"`

Example manifest

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
  name: backend
  namespace: envoy-gateway-system
spec:
  endpoints:
  - fqdn:
      hostname: backend.s.collector.example.com
      port: 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededkind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions