Skip to content

Commit

Permalink
change dblib/netlib network range
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommi2Day committed Aug 18, 2024
1 parent 3e61757 commit 0d9afdc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 38 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 4 additions & 19 deletions dblib/tns_dns_docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

const dblibDNSContainerTimeout = 10
const dblibNetworkName = "dblib-dns"
const dblibNetworkPrefix = "172.24.0"

var dblibDNSContainerName string
var dblibDNSContainer *dockertest.Resource
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down
18 changes: 1 addition & 17 deletions netlib/dns_docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 0d9afdc

Please sign in to comment.