Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#253: Add IPAM warnings when configuration doesn't match existing networks #254

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ matrix:
docker inspect amazeeio-mailhog | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-mailhog | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";

# Test for IPAM misconfiguration warnings.
- ./pygmy-go-linux-x86 --config examples/pygmy.travis.yml clean;
- docker network create amazeeio-network
- ./pygmy-go-linux-x86 --config examples/pygmy.travis.yml up | grep 'IP Address ranges for amazeeio-network'
- ./pygmy-go-linux-x86 --config examples/pygmy.travis.yml clean;
- ./pygmy-go-linux-x86 --config examples/pygmy.travis.yml up;

# Drupal 8 (Drupal Example):
- git clone https://github.com/amazeeio/drupal-example.git drupal8-lagoon && cd drupal8-lagoon
- docker-compose -p drupal8-example up -d
Expand Down
5 changes: 5 additions & 0 deletions service/library/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func Up(c Config) {
} else {
fmt.Printf("Could not create network %v\n", Network.Name)
}
} else {
n, _ := docker.DockerNetworkGet(Network.Name)
if fmt.Sprint(n.IPAM.Config) != fmt.Sprint(c.Networks[Network.Name].IPAM.Config) {
fmt.Printf("Warning: IP Address ranges for %v don't match configuration\n", Network.Name)
}
}
}
}
Expand Down