Skip to content

Duplicate shorter domain in both autogen and custom ingress #454

@xantrix

Description

@xantrix

Describe the bug

If the custom domain exceeds 63 characters, a shorter version is added to both autogenerated and custom ingresses.
But having the same host in two ingresses on the same namespace can lead to unpredictable behavior.
See

// autogenerated domains that are too long break when creating the acme challenge k8s resource

To Reproduce

Set something like this .lagoon.yml 
# .lagoon.yml
 environments:
    master:
       routes:
        - nginx:
            - a-domain-name-that-exceeds-the-limit-of-six-three-characters.domain.com:
                hsts: max-age=31536000
                insecure: Redirect
                tls-acme: 'false'

# autogenerated-ingress yaml output snippet
spec:
  ingressClassName: nginx
  rules:
  - host: nginx-a-domain-name-that-exceeds-the-limit-of-six-three-characters.domain.com
    http:
      paths:
      - backend:
          service:
            name: nginx
            port:
              name: http
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - nginx-hdjshhs-7rqtwtp5.domain.com
    - nginx-a-domain-name-that-exceeds-the-limit-of-six-three-characters.domain.com
    secretName: nginx-tls

# custom-ingress yaml output snippet
spec:
  ingressClassName: nginx
  rules:
  - host: a-domain-name-that-exceeds-the-limit-of-six-three-characters.domain.com
    http:
      paths:
      - backend:
          service:
            name: nginx
            port:
              name: http
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - nginx-hdjshhs-7rqtwtp5.domain.com
    - a-domain-name-that-exceeds-the-limit-of-six-three-characters.domain.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions