From 8b29fb6bdf13088ffb8cfaf2d1856ee0fcd712b2 Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Fri, 12 Jan 2018 12:23:43 -0600 Subject: [PATCH] Fix for 2.3 metadata_url bug This is a temporary workaround patch to resolve https://bugs.launchpad.net/maas/+bug/1743005 - Update chart to point at patched image sthussey/maas-region:2.3_patch Change-Id: I8c631da1b4b555523485d666cea22cb2dbaeff26 --- charts/maas/values.yaml | 2 +- .../maas-region-controller/2.3_nat_fix.patch | 18 ++++++++++++++++++ images/maas-region-controller/Dockerfile | 5 +++-- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 images/maas-region-controller/2.3_nat_fix.patch diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml index f65bc03..ab8df9a 100644 --- a/charts/maas/values.yaml +++ b/charts/maas/values.yaml @@ -71,7 +71,7 @@ images: db_init: docker.io/postgres:9.5 db_sync: sthussey/maas-region-controller:2.3 maas_rack: sthussey/maas-rack-controller:2.3 - maas_region: sthussey/maas-region-controller:2.3 + maas_region: sthussey/maas-region:2.3_patch bootstrap: sthussey/maas-region-controller:2.3 export_api_key: sthussey/maas-region-controller:2.3 maas_cache: quay.io/attcomdev/maas-cache:master diff --git a/images/maas-region-controller/2.3_nat_fix.patch b/images/maas-region-controller/2.3_nat_fix.patch new file mode 100644 index 0000000..b07d48c --- /dev/null +++ b/images/maas-region-controller/2.3_nat_fix.patch @@ -0,0 +1,18 @@ +diff --git a/src/maasserver/utils/__init__.py b/src/maasserver/utils/__init__.py +index 1c58859..f8e673d 100644 +--- a/src/maasserver/utils/__init__.py ++++ b/src/maasserver/utils/__init__.py +@@ -66,8 +66,11 @@ def absolute_reverse( + if not base_url: + with RegionConfiguration.open() as config: + base_url = config.maas_url +- if default_region_ip is not None: +- base_url = compose_URL(base_url, default_region_ip) ++ # NOTE(sh8121att) ++ # Commenting out as workaround to ++ # https://bugs.launchpad.net/maas/+bug/1743005 ++ #if default_region_ip is not None: ++ # base_url = compose_URL(base_url, default_region_ip) + url = urljoin(base_url, reverse(view_name, *args, **kwargs)) + if query is not None: + url += '?%s' % urlencode(query, doseq=True) diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile index ce68802..5bd3234 100644 --- a/images/maas-region-controller/Dockerfile +++ b/images/maas-region-controller/Dockerfile @@ -50,8 +50,9 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \ dpkg -i maas-region-controller.deb && \ pg_dropcluster --stop 9.5 main -# potentially used to calculate cidrs -# RUN pip3 install netaddr +# 2.3 workaround +COPY 2.3_nat_fix.patch /tmp/2.3_nat_fix.patch +RUN cd /usr/lib/python3/dist-packages/maasserver/utils && patch __init__.py < /tmp/2.3_nat_fix.patch # initalize systemd CMD ["/sbin/init"]