talos
talos copied to clipboard
YAML output of machine config incorrectly formatted for multidoc configurations
Bug Report
Multidoc YAML configurations after the first document are incorrectly indented 4 spaces
Description
if you edit the machine config and append a new document for the ingress firewall rules, it displays correctly with talosctl edit mc
, but the output of talosctl get mc
will show the documents after the first YAML doc incorrectly indented, which breaks processing with yq
.
The multi-docs are applied correctly by Talos - it is just in display they are mal-formatted.
Logs
e.g. append a YAML document End via editing the machine config thus:
# apiVersion: v1
# kind: Namespace
# metadata:
# name: ci
...
and it will show thus via get mc -o yaml
# apiVersion: v1
# kind: Namespace
# metadata:
# name: ci
...
Environment
- Talos version: 1.7
- Kubernetes version: [
kubectl version --short
] - Platform:
- This happens with
talosctl
and alsoomnictl get redactedclustermachineconfig
Yes, this is true. We don't have an easy answer for it, so we need to figure out what to do for it, as it won't an easy answer.
A workaround for now is to do talosctl read /system/state/config.yaml
which will return correct multi-doc YAML
Decision: Change mc.spec
to be a string.
Can we drop the go-yaml
fork if we do this?