-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CLOUDSTACK-9266: Make deleting static routes in private gw work #1386
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
LGTM 👍 based on code review Already running in PROD at SBP. |
Contributor
|
makes sense looks good, was it put in production without test? |
Contributor
Author
|
Test results, tested together with #1383: Result: And: Result: This means nothing else broke. The manual tests above test the actual feature. |
asfgit
pushed a commit
that referenced
this pull request
Feb 4, 2016
CLOUDSTACK-9266: Make deleting static routes in private gw workThe to-be-deleted static routes were removed from the json file, instead of putting them there with revoke=true. The script that parses the json now doesn't find it and thus does not delete it.
Example after adding/removing some:
```
root@r-3-VM:/var/cache/cloud# cat /etc/cloudstack/staticroutes.json
{
"1.2.3.0/24": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "1.2.3.0/24",
"revoke": true
},
"1.2.3.4/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "1.2.3.4/32",
"revoke": true
},
"1.2.33.3/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "1.2.33.3/32",
"revoke": true
},
"1.22.2.2/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "1.22.2.2/32",
"revoke": true
},
"10.1.2.1/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "10.1.2.1/32",
"revoke": true
},
"10.1.200.0/25": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "10.1.200.0/25",
"revoke": true
},
"10.11.12.13/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "10.11.12.13/32",
"revoke": true
},
"172.16.1.3/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "172.16.1.3/32",
"revoke": true
},
"172.16.15.14/32": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "172.16.15.14/32",
"revoke": false
},
"172.16.17.0/25": {
"gateway": "172.16.0.1",
"ip_address": "172.16.0.2",
"network": "172.16.17.0/25",
"revoke": false
},
"id": "staticroutes"
}
```
This results in:
```
root@r-3-VM:/var/cache/cloud# ip route show
default via 192.168.23.1 dev eth1
169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.1.67
172.16.0.0/24 dev eth2 proto kernel scope link src 172.16.0.2
172.16.15.14 via 172.16.0.1 dev eth2
172.16.17.0/25 via 172.16.0.1 dev eth2
192.168.23.0/24 dev eth1 proto kernel scope link src 192.168.23.4
```
Two static routes left, the rest deleted:
```
172.16.15.14 via 172.16.0.1 dev eth2
172.16.17.0/25 via 172.16.0.1 dev eth2
```
That also matches the UI:
<img width="1327" alt="screen shot 2016-01-30 at 06 34 06" src="https://cloud.githubusercontent.com/assets/1630096/12693933/83e67d80-c71b-11e5-9241-9f478522b7a4.png">
* pr/1386:
CLOUDSTACK-9266: Make deleting static routes in private gw work
Signed-off-by: Remi Bergsma <github@remi.nl>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The to-be-deleted static routes were removed from the json file, instead of putting them there with revoke=true. The script that parses the json now doesn't find it and thus does not delete it.
Example after adding/removing some:
This results in:
Two static routes left, the rest deleted:
That also matches the UI: