Skip to content

Commit e5b2167

Browse files
committed
Handle max length name
1 parent dcde38c commit e5b2167

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+
poolName := fmt.Sprintf("%s%s", name, inferencePoolServiceSuffix)
21+
// if InferencePool name is already at or near max length, just use that name
22+
if len(poolName) > 253 {
23+
return name
24+
}
25+
return poolName
2126
}
2227

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

0 commit comments

Comments
 (0)