From 87c950a0ea9c34c7721168b9d90bce9ba96fe51b Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Tue, 7 May 2024 22:03:53 +0200 Subject: [PATCH] Fix egress-interfaces MachineConfig --- component/egress-interfaces.jsonnet | 49 ++++++++++--------- .../30_egress_interfaces.yaml | 5 +- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/component/egress-interfaces.jsonnet b/component/egress-interfaces.jsonnet index b02d1e9..3670b3a 100644 --- a/component/egress-interfaces.jsonnet +++ b/component/egress-interfaces.jsonnet @@ -27,35 +27,40 @@ local configs = [ }, spec+: { config: { + ignition: { + version: '3.4.0', + }, storage: { files: [ { path: '/usr/local/bin/appuio-create-egress-interfaces.sh', mode: std.parseOctal('0755'), - contents: - 'data:text/plain;charset=utf-8;base64,%s' % - std.base64(script), + contents: { + source: + 'data:text/plain;charset=utf-8;base64,%s' % + std.base64(script), + }, + }, + ], + }, + systemd: { + units: [ + { + name: 'appuio-create-egress-interfaces.service', + enabled: true, + contents: ||| + [Unit] + Description=Assign egress IPs to node interface + After=NetworkManager-wait-online.service + Before=kubelet-dependencies.target + [Service] + ExecStart=/usr/local/bin/appuio-create-egress-interfaces.sh + Type=oneshot + [Install] + WantedBy=kubelet-dependencies.target + |||, }, ], - systemd: { - units: [ - { - name: 'appuio-create-egress-interfaces.service', - enabled: true, - contents: ||| - [Unit] - Description=Assign egress IPs to node interface - After=NetworkManager-wait-online.service - Before=kubelet-dependencies.target - [Service] - ExecStart=/usr/local/bin/appuio-create-egress-interfaces.sh - Type=oneshot - [Install] - WantedBy=kubelet-dependencies.target - |||, - }, - ], - }, }, }, }, diff --git a/tests/golden/machineconfig/openshift4-nodes/openshift4-nodes/30_egress_interfaces.yaml b/tests/golden/machineconfig/openshift4-nodes/openshift4-nodes/30_egress_interfaces.yaml index 3986812..fb3feb3 100644 --- a/tests/golden/machineconfig/openshift4-nodes/openshift4-nodes/30_egress_interfaces.yaml +++ b/tests/golden/machineconfig/openshift4-nodes/openshift4-nodes/30_egress_interfaces.yaml @@ -35,9 +35,12 @@ metadata: name: 99x-infra-egress-interfaces spec: config: + ignition: + version: 3.4.0 storage: files: - - contents: data:text/plain;charset=utf-8;base64,IyEvYmluL2Jhc2gKCnNldCAtZW8gcGlwZWZhaWwKCmV4cG9ydCBLVUJFQ09ORklHPSIvdmFyL2xpYi9rdWJlbGV0L2t1YmVjb25maWciCgpyZWFkb25seSBzaGFkb3dfZGF0YT0kKGt1YmVjdGwgLW4gImNpbGl1bSIgZ2V0IGNvbmZpZ21hcCAiZWlwLXNoYWRvdy1yYW5nZXMiIC1vanNvbnBhdGg9InsuZGF0YS4ke0hPU1ROQU1FfX0iKQoKZm9yIHByZWZpeCBpbiAkKGVjaG8gIiRzaGFkb3dfZGF0YSIgfCBqcSAtciAnLnxrZXlzW10nKTsgZG8KICBiYXNlPSQoZWNobyAiJHNoYWRvd19kYXRhIiB8IGpxIC1yICIuJHtwcmVmaXh9LmJhc2UiKQogIGZyb209JChlY2hvICIkc2hhZG93X2RhdGEiIHwganEgLXIgIi4ke3ByZWZpeH0uZnJvbSIpCiAgdG89JChlY2hvICIkc2hhZG93X2RhdGEiIHwganEgLXIgIi4ke3ByZWZpeH0udG8iKQogIGVjaG8gIkNvbmZpZ3VyaW5nIGR1bW15IGludGVyZmFjZXMgZm9yIGVncmVzcyByYW5nZSAke3ByZWZpeH06IGJhc2U9JHtiYXNlfSwgZnJvbT0ke2Zyb219LCB0bz0ke3RvfSIKICBmb3Igc3VmZml4IGluICQoc2VxICIkZnJvbSIgIiR0byIpOyBkbwogICAgaWR4PSQoKCIkc3VmZml4IiAtICIkZnJvbSIpKQogICAgaWZhY2U9IiR7cHJlZml4fV8ke2lkeH0iCiAgICBpcCBsIGRlbCAiJGlmYWNlIiAyPi9kZXYvbnVsbCB8fCB0cnVlCiAgICBpcCBsIGFkZCAiJGlmYWNlIiB0eXBlIGR1bW15CiAgICBpcCBhIGFkZCAiJHtiYXNlfS4ke3N1ZmZpeH0iIGRldi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wCg== mode: 493 path: /usr/local/bin/appuio-create-egress-interfaces.sh systemd: