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

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

Closed
nothinux opened this issue Nov 27, 2024 · 2 comments · Fixed by #4822 · May be fixed by #4803
Closed

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

nothinux opened this issue Nov 27, 2024 · 2 comments · Fixed by #4822 · May be fixed by #4803
Labels
help wanted Extra attention is needed kind/bug Something isn't working
Milestone

Comments

@nothinux
Copy link
Contributor

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
@arkodg arkodg added kind/bug Something isn't working help wanted Extra attention is needed and removed triage labels Nov 27, 2024
@arkodg arkodg added this to the v1.3.0-rc.1 milestone Nov 27, 2024
@nothinux
Copy link
Contributor Author

nothinux commented Dec 2, 2024

@zhaohuabing the fix actually on this PR #4803, can you help to check?

@guydc
Copy link
Contributor

guydc commented Dec 2, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/bug Something isn't working
Projects
None yet
3 participants