nginx-gateway-fabric
nginx-gateway-fabric copied to clipboard
Validate Data Plane resources name length
trafficstars
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 <GatewayClass name>-<Gateway name>, 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.