-
Notifications
You must be signed in to change notification settings - Fork 1.2k
VPC: fix Python exception processing static routes with next hop when private gateway is also present #11967
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
base: 4.22
Are you sure you want to change the base?
Conversation
static routes that don't reference a private gateway don't have an
ip_address and therefore will throw a key error:
```
root@r-359-VM:/var/cache/cloud# update_config.py ip_associations.json.7407b8bd-21c6-4d99-aae0-f2193412650c
Traceback (most recent call last):
File "/opt/cloud/bin/update_config.py", line 147, in <module>
process_file()
File "/opt/cloud/bin/update_config.py", line 57, in process_file
finish_config()
File "/opt/cloud/bin/update_config.py", line 42, in finish_config
returncode = configure.main(sys.argv)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/cloud/bin/configure.py", line 1647, in main
config.address().process()
File "/opt/cloud/bin/cs/CsAddress.py", line 138, in process
ip.configure(address)
File "/opt/cloud/bin/cs/CsAddress.py", line 348, in configure
self.post_configure(address)
File "/opt/cloud/bin/cs/CsAddress.py", line 370, in post_configure
self.post_config_change("add")
File "/opt/cloud/bin/cs/CsAddress.py", line 824, in post_config_change
self.fw_vpcrouter()
File "/opt/cloud/bin/cs/CsAddress.py", line 606, in fw_vpcrouter
if static_route['ip_address'] == self.address['public_ip'] and not static_route['revoke']:
~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'ip_address'
```
Example static routes:
```
root@r-359-VM:/var/cache/cloud# cat /etc/cloudstack/staticroutes.json
{
"10.10.48.0/20": {
"gateway": "10.252.240.10",
"network": "10.10.48.0/20",
"revoke": false
},
"10.250.0.0/16": {
"gateway": "10.252.240.10",
"network": "10.250.0.0/16",
"revoke": false
},
"id": "staticroutes"
}
```
|
@bradh352 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11967 +/- ##
=========================================
Coverage 17.56% 17.56%
- Complexity 15542 15545 +3
=========================================
Files 5909 5909
Lines 529058 529056 -2
Branches 64617 64617
=========================================
+ Hits 92922 92948 +26
+ Misses 425683 425654 -29
- Partials 10453 10454 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not actually seeing a 4.22 branch upstream unless I'm missing it. I see some release-candidate branches. Is there any possibility in getting this into 4.22.0? This is actually a blocker for us. |
oh my bad. I thought there is already a 4.22 branch 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
I am not sure if this is a blocker for 4.22.0.0 release if this will not be in 4.22.0.0, you can refer to #10184 (reply in thread) how to patch the kvm hosts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
pretty please? :) |
|
you can download the tarball and save as /usr/share/cloudstack-common/vms/cloud-scripts.tgz on all kvm hosts and mgmt servers (if you use other hypervisor types) note: ACS 4.22.0.0 only |
Description
static routes that don't reference a private gateway don't have an ip_address and therefore will throw a key error:
Example static routes:
Fixes #11965
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested in a production environment by manually editing the file and observe the changes no longer cause an exception.
How did you try to break this feature and the system with this change?