Skip to content

Commit 76a8f77

Browse files
Added proper regex and validation message for container registry check too
Signed-off-by: Alexandra Dragodan <[email protected]>
1 parent 01aa322 commit 76a8f77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/devspace/configure/image.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ func (m *manager) AddImage(imageName, image, projectNamespace, dockerfile string
174174
registryHostname, err = m.log.Question(&survey.QuestionOptions{
175175
Question: "Please provide the registry hostname without the image path (e.g. gcr.io, ghcr.io, ecr.io)",
176176
DefaultValue: "gcr.io",
177-
ValidationRegexPattern: "^[^A-Z\\s]+\\.[^A-Z\\s]+$",
178-
ValidationMessage: "Error parsing registry username: must only include lowercase letters.",
177+
ValidationRegexPattern: "^(?!-)[a-z0-9-]{1,63}(\\.[a-z0-9-]{1,63})*$",
178+
ValidationMessage: "Error parsing registry hostname: must only include letters, digits, dots and hyphens and cannot exceed 253 characters.",
179179
})
180180
if err != nil {
181181
return err

0 commit comments

Comments
 (0)