Skip to content

Validate Data Plane resources name length #4177

@salonichf5

Description

@salonichf5

Describe the bug
Validate data plane resource name length against RFC 1123 DNS Label standard, as all NGF Data Plane resources (Service, Deployment, Secrets, ConfigMap, ServiceAccount) use a name formed out of -, which for Services is limited to 63 characters.

To Reproduce
Choose a very long name for your service and apply it. Error seen

{"level":"error","ts":"2025-10-22T13:49:17Z","logger":"eventHandler","msg":"error getting Gateway Service IP address","error":"error finding Service gw-ingress-dev-nonprodtotocorpnetwork-ngf-nonprodtotocorpnetwork-dev for Gateway: context deadline exceeded","stacktrace":"github.com/nginx/nginx-gateway-fabric/v2/internal/controller.(*eventHandlerImpl).updateStatuses\n\t/home/runner/work/nginx-gateway-fabric/nginx-gateway-fabric/internal/controller/handler.go:333\ngithub.com/nginx/nginx-gateway-fabric/v2/internal/controller.(*eventHandlerImpl).waitForStatusUpdates\n\t/home/runner/work/nginx-gateway-fabric/nginx-gateway-fabric/internal/controller/handler.go:280"}

community issue

Expected behavior

  • name for resource is truncated when exceeds 63 characters and handled properly

Your environment

  • Version of the NGINX Gateway Fabric - release version or a specific commit. The first line of the nginx-gateway container logs includes the commit info. v2.2

Additional context
Add any other context about the problem here. Any log files you want to share.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions