From 3b6f88f501387e7e230f30c82290f13bbf91fe83 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 18 Jun 2026 14:52:56 -0500 Subject: [PATCH] OCPBUGS-90502: Run nmstatectl format in nmstate-configuration Previously it was very difficult to adopt a day 1 config using nmpolicy constructs into the day 2 operator to allow changes after deployment. This is because nmpolicies rely on having a specific start state for the system, and once the config has been applied that state no longer exists. The operator handles this by saving the start state internally, but since the operator isn't present on day one we need a different approach there. Running the nmstatectl format command allows us to save off a fully formatted version of the nmpolicy config that can be applied on day 2 with no more changes than any other day 1 NMState config. This makes modifications on day 2 substantially easier. --- templates/common/_base/files/nmstate-configuration.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/common/_base/files/nmstate-configuration.yaml b/templates/common/_base/files/nmstate-configuration.yaml index c1dcfc4e9b..1e14685bb2 100644 --- a/templates/common/_base/files/nmstate-configuration.yaml +++ b/templates/common/_base/files/nmstate-configuration.yaml @@ -43,3 +43,6 @@ contents: cp "$src_path/$config_file" /etc/nmstate cp "$src_path/$config_file" "$src_path/applied" + + # Write a formatted copy of nmpolicy configurations for easier adoption on day 2 + nmstatectl format "$src_path/$config_file" > "$src_path/formatted"