Fix for unconfigured static routes
- Hot-patch MaaS code so that the cloud-init network configuration YAML places static routes within the interface configuration that is the source network for the route. this should fix route volatility on deployment caused by the default behavior of all static routes going to the bottom of the network configuration and thus being attached to the last interface defined Change-Id: Ibe04000dafc21b37386777968c43e1b34e1a9838
This commit is contained in:
parent
bde0e4260e
commit
1df0ad3c6d
28
images/maas-region-controller/2.3_route.patch
Normal file
28
images/maas-region-controller/2.3_route.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff --git a/src/maasserver/preseed_network.py b/src/maasserver/preseed_network.py
|
||||
index 1be72d6..96ee6a3 100644
|
||||
--- a/src/maasserver/preseed_network.py
|
||||
+++ b/src/maasserver/preseed_network.py
|
||||
@@ -192,7 +192,7 @@ class InterfaceConfiguration:
|
||||
return {
|
||||
route
|
||||
for route in self.routes
|
||||
- if route.source == source
|
||||
+ if str(route.source.cidr) == str(source.cidr)
|
||||
}
|
||||
|
||||
def _generate_addresses(self, version=1):
|
||||
@@ -251,8 +251,12 @@ class InterfaceConfiguration:
|
||||
v2_nameservers["addresses"] = []
|
||||
v2_nameservers["addresses"].extend(
|
||||
[server for server in subnet.dns_servers])
|
||||
- self.matching_routes.update(
|
||||
- self._get_matching_routes(subnet))
|
||||
+ net_routes = self._get_matching_routes(subnet)
|
||||
+ rl = [_generate_route_operation(r, version=version)
|
||||
+ for r
|
||||
+ in net_routes]
|
||||
+ v1_subnet_operation['routes'] = rl
|
||||
+ v2_config['routes'] = rl
|
||||
if dhcp_type:
|
||||
v1_config.append(
|
||||
{"type": dhcp_type}
|
@ -53,8 +53,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
|
||||
# 2.3 workarounds
|
||||
COPY 2.3_nat_fix.patch /tmp/2.3_nat_fix.patch
|
||||
COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
|
||||
COPY 2.3_route.patch /tmp/2.3_route.patch
|
||||
RUN cd /usr/lib/python3/dist-packages/maasserver/utils && patch __init__.py < /tmp/2.3_nat_fix.patch
|
||||
RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
|
||||
RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
|
||||
|
||||
# initalize systemd
|
||||
CMD ["/sbin/init"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user