From 2012a93e5f66232c49fa921811cebe8baeac13b6 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Mon, 26 Dec 2022 19:16:10 +0100 Subject: [PATCH] feat: Add 22.12 Hot Patch 2 --- hotpatch/2212/HP2.patch | 13 +++++++++++++ includes/patch.sh | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 hotpatch/2212/HP2.patch diff --git a/hotpatch/2212/HP2.patch b/hotpatch/2212/HP2.patch new file mode 100644 index 00000000..744d26fc --- /dev/null +++ b/hotpatch/2212/HP2.patch @@ -0,0 +1,13 @@ +diff --git plugins/kubernetes_linux/backup.py plugins/kubernetes_linux/backup.py +index d8a48d45f89..365cd1718b4 100644 +--- plugins/kubernetes_linux/backup.py ++++ plugins/kubernetes_linux/backup.py +@@ -61,7 +61,8 @@ def backup_chart_releases(self, job, backup_name): + ['metadata.namespace', '=', chart_release['namespace']] + ] + ) +- for secret in sorted(secrets, key=lambda d: d['metadata']['name']): ++ # We ignore this keeping in line with helm behaviour where the secret malformed is ignored by helm ++ for secret in sorted(secrets, key=lambda d: d['metadata']['name'] and d.get('data')): + with open(os.path.join(secrets_dir, secret['metadata']['name']), 'w') as f: + f.write(self.middleware.call_sync('k8s.secret.export_to_yaml_internal', secret)) diff --git a/includes/patch.sh b/includes/patch.sh index 6ed44fd5..82393dea 100644 --- a/includes/patch.sh +++ b/includes/patch.sh @@ -3,6 +3,8 @@ patchv22120(){ echo "Applying 22.12 HotPatch 1" ( wget -q -P /tmp https://github.com/truecharts/truetool/raw/main/hotpatch/2212/HP1.patch && echo "download completed" || echo "download failed" ) && ( patch -N -s -p0 -d /usr/lib/python3/dist-packages/middlewared/ < /tmp/HP1.patch && service middlewared restart && echo "waiting 20 seconds for middleware restart..." && sleep 20 && echo "patch completed" || echo "patch failed or skipped, not critical" ) && rm -rf /tmp/HP1.patch +echo "Applying 22.12 HotPatch 2" +( wget -q -P /tmp https://github.com/truecharts/truetool/raw/main/hotpatch/2212/HP2.patch && echo "download completed" || echo "download failed" ) && ( patch -N -s -p0 -d /usr/lib/python3/dist-packages/middlewared/ < /tmp/HP2.patch && service middlewared restart && echo "waiting 20 seconds for middleware restart..." && sleep 20 && echo "patch completed" || echo "patch failed or skipped, not critical" ) && rm -rf /tmp/HP2.patch } export -f patchv22120