Skip to content

Commit 53872cf

Browse files
committed
Handle max length name
1 parent dcde38c commit 53872cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/framework/controller/resource.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ func CreateNginxResourceName(prefix, suffix string) string {
1717
// CreateInferencePoolServiceName creates the name for a headless Service that
1818
// we create for an InferencePool.
1919
func CreateInferencePoolServiceName(name string) string {
20-
return fmt.Sprintf("%s%s", name, inferencePoolServiceSuffix)
20+
svcName := fmt.Sprintf("%s%s", name, inferencePoolServiceSuffix)
21+
// if InferencePool name is already at or near max length, just use that name
22+
if len(svcName) > 253 {
23+
return name
24+
}
25+
return svcName
2126
}
2227

2328
// GetInferencePoolName returns the name of the InferencePool for a given headless Service name.

0 commit comments

Comments
 (0)