Skip to content
Snippets Groups Projects
Commit 1b7df30f authored by Rodrigo Chacon's avatar Rodrigo Chacon Committed by Lars Seipel
Browse files

wip DNS-1123 compatibility

parent 4028ab21
No related branches found
No related tags found
No related merge requests found
Pipeline #6635 failed
......@@ -440,6 +440,10 @@ func (s *executor) setupBuildPod() error {
_, _, _, aliases := common.SplitServiceAndVersion(service.Name)
for _, a := range aliases {
// skip Docker-like host aliases, respecting DNS-1123
if strings.Contains(a, "__") {
continue
}
servicesHostAlias.Hostnames = append(servicesHostAlias.Hostnames, a)
}
if service.Alias != "" {
......
......@@ -1266,15 +1266,19 @@ func TestSetupBuildPod(t *testing.T) {
{
Name: "docker:dind",
},
{
Name: "selenium/standalone-chrome",
},
},
},
VerifyFn: func(t *testing.T, test setupBuildPodTestDef, pod *api.Pod) {
require.Len(t, pod.Spec.Containers, 4)
require.Len(t, pod.Spec.Containers, 5)
expectedHostnames := []string{
"test-service",
"svc-alias",
"docker",
"selenium-standalone-chrome",
}
assert.Equal(t, "127.0.0.1", pod.Spec.HostAliases[0].IP)
assert.Equal(t, expectedHostnames, pod.Spec.HostAliases[0].Hostnames)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment