Support dots in image names (#6431)

This commit is contained in:
qwerty287
2026-04-13 12:27:03 +02:00
committed by GitHub
parent 055da211a5
commit 360ccb48ba
2 changed files with 2 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ var validDockerImageString = regexp.MustCompile(
`(:\d+)?` + // optional port
`/)?` + // optional hostname + port
`([\w\d\-_\.][\w\d\-_\.\/]*/)?` + // optional url prefix
`([\w\d\-_]+)` + // image name
`([\w\d\-_\.]+)` + // image name
`(:[\w\d\-_]+)?` + // optional image tag
`$`,
)

View File

@@ -30,7 +30,7 @@ func TestSecretValidate(t *testing.T) {
Name: "secretname",
Value: "secretvalue",
Events: []WebhookEvent{EventPush},
Images: []string{"docker.io/library/mysql:latest", "alpine:latest", "localregistry.test:8443/mysql:latest", "localregistry.test:8443/library/mysql:latest", "docker.io/library/mysql", "alpine", "localregistry.test:8443/mysql", "localregistry.test:8443/library/mysql"},
Images: []string{"docker.io/library/mysql:latest", "alpine:latest", "localregistry.test:8443/mysql:latest", "localregistry.test:8443/library/mysql:latest", "docker.io/library/mysql", "alpine", "localregistry.test:8443/mysql", "localregistry.test:8443/library/mysql", "code.thinkaboutit.tech/pandora/woodpecker-config-server.goapp"},
},
err: false,
},