Browse Source

[WIP] [fix] Patch issues in upstream MAAS

- maas-enlist does not work with hyphenated domains. Backport from
  upstream fix.
- Ignore MAC addresses of '00:00:00:00:00:00' to fix issue of OVS
  break MAAS controller registration

Change-Id: I26b09bb35ef3bfc9424188dbf9fccf0ca3199441
Scott Hussey 5 months ago
parent
commit
2d71c24e0f

+ 6
- 0
images/maas-rack-controller/2.3_mac_address.patch View File

@@ -0,0 +1,6 @@
1
+394a395,399
2
+>     # Exclude interfaces that have duplicate MACs
3
+>     # such as OVS gretap and erspan interfaces
4
+>     ifaces = { k: v
5
+>                for k, v in ifaces.items()
6
+>                if v.get('mac', '') != '00:00:00:00:00:00'}

+ 3
- 0
images/maas-rack-controller/Dockerfile View File

@@ -46,7 +46,10 @@ RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump
46 46
 # Patch so that Calico interfaces are ignored
47 47
 # dc6350: this appears to be fixed in maas master as of 10/4/2018, but that change is not in 2.3.5
48 48
 COPY 2.3_nic_filter.patch /tmp/2.3_nic_filter.patch
49
+# sh8121att: patch so that interfaces with MAC 00:00:00:00:00:00 omit the MAC address
50
+COPY 2.3_mac_address.patch /tmp/2.3_mac_address.patch
49 51
 RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch network.py < /tmp/2.3_nic_filter.patch
52
+RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch ipaddr.py < /tmp/2.3_mac_address.patch
50 53
 
51 54
 # echo journalctl logs to the container's stdout
52 55
 COPY scripts/journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service

+ 13
- 0
images/maas-region-controller/2.3_maas_enlist.patch View File

@@ -0,0 +1,13 @@
1
+diff --git a/src/metadataserver/user_data/templates/snippets/maas_enlist.sh b/src/metadataserver/user_data/templates/snippets/maas_enlist.sh
2
+index cb9515c..394b0bd 100644
3
+--- a/src/metadataserver/user_data/templates/snippets/maas_enlist.sh
4
++++ b/src/metadataserver/user_data/templates/snippets/maas_enlist.sh
5
+@@ -236,7 +236,7 @@ fi
6
+ if echo "$serverurl" | egrep -q '(^[a-z]+://|^)[a-zA-Z0-9\.\-]+($|/$)'; then
7
+ 	api_url="MAAS/api/2.0/machines/"
8
+ else
9
+-	api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)\([a-zA-Z0-9\.]\+\|\(\[[0-9a-fA-F:]\+\]\)\)\(\|\:[0-9]\+\)/##'`
10
++	api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)\([a-zA-Z0-9\.\-]\+\|\(\[[0-9a-fA-F:]\+\]\)\)\(\|\:[0-9]\+\)/##'`
11
+ fi
12
+ 
13
+ if [ -z "$hostname" ] && [ "$quite" != "true" ]; then

+ 6
- 0
images/maas-region-controller/2.3_mac_address.patch View File

@@ -0,0 +1,6 @@
1
+394a395,399
2
+>     # Exclude interfaces that have duplicate MACs
3
+>     # such as OVS gretap and erspan interfaces
4
+>     ifaces = { k: v
5
+>                for k, v in ifaces.items()
6
+>                if v.get('mac', '') != '00:00:00:00:00:00'}

+ 6
- 0
images/maas-region-controller/Dockerfile View File

@@ -65,10 +65,16 @@ COPY 2.3_route.patch /tmp/2.3_route.patch
65 65
 COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch
66 66
 COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch
67 67
 COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch
68
+# sh8121att: patch so that maas-enlist works with domains that contain '-'
69
+COPY 2.3_maas_enlist.patch /tmp/2.3_maas_enlist.patch
70
+# sh8121att: patch so that interfaces with MAC 00:00:00:00:00:00 omit the MAC address
71
+COPY 2.3_mac_address.patch /tmp/2.3_mac_address.patch
68 72
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
69 73
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch
70 74
 RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch
71 75
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_storage.py < /tmp/2.3_bios_grub_preseed.patch
76
+RUN cd /usr/lib/python3/dist-packages/metadataserver/user_data/templates/snippets && patch maas_enlist.sh < /tmp/2.3_maas_enlist.patch
77
+RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch ipaddr.py < /tmp/2.3_mac_address.patch
72 78
 
73 79
 COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service
74 80
 RUN mkdir -p /etc/systemd/system/basic.target.wants ;\

Loading…
Cancel
Save