1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-26 18:20:59 +00:00

fix: sanitize network aliases to be valid DNS names (part 2) (#197)

- prefer the lowercase version of the DNS name which is more common they are case insensitive anyway
- fix the inverted information when sanitation happens

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/197
Reviewed-by: msrd0 <msrd0@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-07-26 11:31:05 +00:00 committed by earl-warren
parent b1ea5424b9
commit 28c639e48b
2 changed files with 6 additions and 6 deletions

View file

@ -712,10 +712,10 @@ func Test_createSimpleContainerName(t *testing.T) {
}
func TestSanitizeNetworkAlias(t *testing.T) {
same := "SAME"
same := "same"
assert.Equal(t, same, sanitizeNetworkAlias(context.Background(), same))
original := "OR.IGIN'A-L"
sanitized := "OR_IGIN_A-L"
original := "or.igin'A-L"
sanitized := "or_igin_a-l"
assert.Equal(t, sanitized, sanitizeNetworkAlias(context.Background(), original))
}