rancher / elemental

Elemental is a software stack enabling centralized, full cloud-native OS management with Kubernetes.
https://elemental.docs.rancher.com/
Apache License 2.0
303 stars 39 forks source link

Strange logging of authorized_keys #847

Open kkaempf opened 1 year ago

kkaempf commented 1 year ago

What steps did you take and what happened: [A clear and concise description of what the bug is.]

In my MachineRegistration, I add ssh_authorized_keys for the root user. This is working well.

      users:
        - name: root
          passwd: root
          ssh_authorized_keys: >-
            ssh-rsa
            AAAAB3NzaC1yc2EAAAADAQABAAACAQDmiPNY/Ab/MzD7h/A/pY/nHrsgSzFxadnR/GAeO8M/owNWk9CM1jS2yFErsfm4yradj6cfH3vZ5rZ4nqAxuMTO6PAOjRg+POOlFEZpqTIxBtfPPBB8Nb3F1Pv

(truncated)

When I run

journalctl -f -u elemental-register

on the node, logging is strange and looks like this

May 24 10:55:32 rancher-23760 elemental-register[1457]: cloud-config:
May 24 10:55:32 rancher-23760 elemental-register[1457]:   ssh_authorized_keys:
May 24 10:55:32 rancher-23760 elemental-register[1457]:     raw:
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 91
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 34
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 103
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 105
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 116
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 104
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 117
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 98
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 58
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 107
May 24 10:55:32 rancher-23760 elemental-register[1457]:     - 107

(truncated)

and ends with

May 24 10:55:33 rancher-23760 elemental-register[1457]:     object: null

What did you expect to happen:

Data is logged in one line (or not at all)

kkaempf commented 1 year ago

Ah, this is the

May 24 10:55:32 rancher-23760 elemental-register[1457]: I0524 10:55:32.982806    1457 log.go:50] Fetched configuration from manager cluster:

logging.

The

May 24 10:55:33 rancher-23760 elemental-register[1457]: I0524 10:55:32.991972    1457 log.go:50] Decoded CloudConfig:

log shows ssh_authorized_keys: as expected (ASCII, on a single line)