talos icon indicating copy to clipboard operation
talos copied to clipboard

patch an offline machine config

Open sbskas opened this issue 2 years ago • 1 comments

Feature Request

Description

A new feature much needed has been added to the 1.2 version : the ability to patch a machine config file just before applying to a talos machine. However, in the case of vmware clone configured with OVA, or just for checking the correctness of generated machine config, it may be convenient to have the machine config output to a file or standard output.

Workflow should be as this: talosctl gen config --patch <some general patches that defines the cluster, generic machine configuration, and so on...> Then for each machine do a : talosctl patch-config --patch <the specific patchs for that machine such as hostname, interface name or bond, IP address> -o mc-< <hostname>.yml

Patch-config is an example. The main request is that the command should be able to take as input a generated file like worker.yml or controlplane.yml and output a patched file with the patch given on the cmdline.

It could be some offline switches to talosctl patch: talosctl patch --in file.yml -patch <bunch of patch files> --out <final generated files> Or it could be a brand new subcommand that calls the configpatcher.

This command may be used in automated test scenarios to check if the patch are behaving correctly in a regression test suite.

sbskas avatar Aug 31 '22 20:08 sbskas

see also https://github.com/siderolabs/talos/pull/6189

smira avatar Aug 31 '22 20:08 smira

talosctl machineconfig patch

smira avatar Dec 01 '23 14:12 smira