Unverified Commit f1dbea4f authored by hhzhang16's avatar hhzhang16 Committed by GitHub
Browse files

fix: sanitize dots in DGD names for DNS-1035 and dynamo namespace endpoint paths (#7032)


Signed-off-by: default avatarHannah Zhang <hannahz@nvidia.com>
parent f596945d
...@@ -21,6 +21,7 @@ package v1alpha1 ...@@ -21,6 +21,7 @@ package v1alpha1
import ( import (
"fmt" "fmt"
"strings"
commonconsts "github.com/ai-dynamo/dynamo/deploy/operator/internal/consts" commonconsts "github.com/ai-dynamo/dynamo/deploy/operator/internal/consts"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
...@@ -351,7 +352,11 @@ func ComputeDynamoNamespace(globalDynamoNamespace bool, k8sNamespace, dgdName st ...@@ -351,7 +352,11 @@ func ComputeDynamoNamespace(globalDynamoNamespace bool, k8sNamespace, dgdName st
if globalDynamoNamespace { if globalDynamoNamespace {
return commonconsts.GlobalDynamoNamespace return commonconsts.GlobalDynamoNamespace
} }
return fmt.Sprintf("%s-%s", k8sNamespace, dgdName) // The dynamo namespace is used as the first segment of endpoint paths
// (e.g. "namespace.component.endpoint"). Dots in resource names (from model
// version strings like "Qwen3-0.6B") would break that parsing, so replace them.
sanitized := strings.ReplaceAll(dgdName, ".", "-")
return fmt.Sprintf("%s-%s", k8sNamespace, sanitized)
} }
// ModelReference identifies a model served by this component // ModelReference identifies a model served by this component
......
...@@ -673,7 +673,9 @@ func GenerateComponentService(params ComponentServiceParams) (*corev1.Service, e ...@@ -673,7 +673,9 @@ func GenerateComponentService(params ComponentServiceParams) (*corev1.Service, e
service := &corev1.Service{ service := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: params.ServiceName, // Service names must be DNS-1035 labels (no dots). Replace dots with
// hyphens so model names like "Qwen3-0.6B" don't cause rejections.
Name: strings.ReplaceAll(params.ServiceName, ".", "-"),
Namespace: params.Namespace, Namespace: params.Namespace,
Labels: labels, Labels: labels,
Annotations: annotations, Annotations: annotations,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment