Skip to content

Commit e22eecb

Browse files
fix(slugification): kubernetes namespace and release name cannot contain dots
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
1 parent abffc62 commit e22eecb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/slug/slug.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ func ValidateKubernetesNamespace(namespace string) error {
148148
}
149149

150150
func validateKubernetesNamespace(name string) error {
151-
errorMsgPrefix := fmt.Sprintf("kubernetes namespace should be a valid DNS-1123 subdomain")
151+
errorMsgPrefix := fmt.Sprintf("kubernetes namespace should be a valid DNS-1123 label")
152152
if len(name) == 0 {
153153
return nil
154154
} else if len(name) > kubernetesNamespaceMaxSize {
155155
return fmt.Errorf("%s: %q is %d chars long", errorMsgPrefix, name, len(name))
156-
} else if msgs := validation.IsDNS1123Subdomain(name); len(msgs) > 0 {
156+
} else if msgs := validation.IsDNS1123Label(name); len(msgs) > 0 {
157157
return fmt.Errorf("%s: %s", errorMsgPrefix, strings.Join(msgs, ", "))
158158
}
159159
return nil
@@ -171,12 +171,12 @@ func ValidateHelmRelease(name string) error {
171171
}
172172

173173
func validateHelmRelease(name string) error {
174-
errorMsgPrefix := fmt.Sprintf("helm release name should be a valid DNS-1123 subdomain and be maximum %d chars", helmReleaseMaxSize)
174+
errorMsgPrefix := fmt.Sprintf("helm release name should be a valid DNS-1123 label and be maximum %d chars", helmReleaseMaxSize)
175175
if len(name) == 0 {
176176
return nil
177177
} else if len(name) > helmReleaseMaxSize {
178178
return fmt.Errorf("%s: %q is %d chars long", errorMsgPrefix, name, len(name))
179-
} else if msgs := validation.IsDNS1123Subdomain(name); len(msgs) > 0 {
179+
} else if msgs := validation.IsDNS1123Label(name); len(msgs) > 0 {
180180
return fmt.Errorf("%s: %s", errorMsgPrefix, strings.Join(msgs, ", "))
181181
}
182182
return nil

0 commit comments

Comments
 (0)