diff --git a/CHANGELOG.md b/CHANGELOG.md index 2107124..f633059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Go Library -## [v1.14.5 - 2024-08-18] +## [v1.14.6 - 2024-08-18] ### Changed -- netlib: change docker network range +- netlib,dblib: change docker network range - update dependencies ### Fixed - fix new linter issues diff --git a/dblib/tns_dns_docker_test.go b/dblib/tns_dns_docker_test.go index bc88e49..e4312d5 100644 --- a/dblib/tns_dns_docker_test.go +++ b/dblib/tns_dns_docker_test.go @@ -18,6 +18,7 @@ import ( const dblibDNSContainerTimeout = 10 const dblibNetworkName = "dblib-dns" +const dblibNetworkPrefix = "172.24.0" var dblibDNSContainerName string var dblibDNSContainer *dockertest.Resource @@ -49,8 +50,8 @@ func prepareDNSContainer() (container *dockertest.Resource, err error) { options.IPAM = &docker.IPAMOptions{ Driver: "default", Config: []docker.IPAMConfig{{ - Subnet: "172.24.0.0/16", - Gateway: "172.24.0.1", + Subnet: dblibNetworkPrefix + ".0/24", + Gateway: dblibNetworkPrefix + ".1", }}, } options.EnableIPv6 = false @@ -89,22 +90,6 @@ func prepareDNSContainer() (container *dockertest.Resource, err error) { Name: dblibDNSContainerName, Networks: []*dockertest.Network{dblibDNSNetwork}, ExposedPorts: []string{"53/tcp", "53/udp", "953/tcp"}, - - /* - // need fixed mapping here - PortBindings: map[docker.Port][]docker.PortBinding{ - "53/tcp": { - {HostIP: "0.0.0.0", HostPort: dblibDNSPort}, - }, - - "53/udp": { - {HostIP: "0.0.0.0", HostPort: dblibDNSPort}, - }, - "953/tcp": { - {HostIP: "127.0.0.1", HostPort: "953"}, - }, - }, - */ }, func(config *docker.HostConfig) { // set AutoRemove to true so that stopped container goes away by itself config.AutoRemove = true @@ -117,7 +102,7 @@ func prepareDNSContainer() (container *dockertest.Resource, err error) { } // ip := container.Container.NetworkSettings.Networks[dblibNetworkName].IPAddress ip := container.GetIPInNetwork(dblibDNSNetwork) - if ip != "172.24.0.2" { + if ip != dblibNetworkPrefix+".2" { err = fmt.Errorf("internal ip not as expected: %s", ip) return } diff --git a/netlib/dns_docker_test.go b/netlib/dns_docker_test.go index 4b46c4d..202d1c4 100644 --- a/netlib/dns_docker_test.go +++ b/netlib/dns_docker_test.go @@ -91,22 +91,6 @@ func prepareNetlibDNSContainer() (container *dockertest.Resource, err error) { Name: netlibDNSContainerName, Networks: []*dockertest.Network{netlibDNSNetwork}, ExposedPorts: []string{"53/tcp", "53/udp", "953/tcp"}, - - /* - // need fixed mapping here - PortBindings: map[docker.Port][]docker.PortBinding{ - "53/tcp": { - {HostIP: "0.0.0.0", HostPort: netlibDNSPort}, - }, - - "53/udp": { - {HostIP: "0.0.0.0", HostPort: netlibDNSPort}, - }, - "953/tcp": { - {HostIP: "127.0.0.1", HostPort: "953"}, - }, - }, - */ }, func(config *docker.HostConfig) { // set AutoRemove to true so that stopped container goes away by itself config.AutoRemove = true @@ -119,7 +103,7 @@ func prepareNetlibDNSContainer() (container *dockertest.Resource, err error) { } // ip := container.Container.NetworkSettings.Networks[netlibNetworkName].IPAddress ip := container.GetIPInNetwork(netlibDNSNetwork) - if ip != "172.25.0.2" { + if ip != netlibNetworkPrefix+".2" { err = fmt.Errorf("internal ip not as expected: %s", ip) return }