Bug 1999621

Summary: Empty ssh_authorized_keys entry is added to VM's cloudinit if created from a customize flow
Product: OpenShift Container Platform Reporter: Ruth Netser <rnetser>
Component: Console Kubevirt PluginAssignee: Matan Schatzman <mschatzm>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: high Docs Contact:
Priority: medium    
Version: 4.9CC: aos-bugs, gouyang, yzamir
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:06:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ruth Netser 2021-08-31 12:58:54 UTC
Description of problem:
VM creation in the customization flow - empty ssh_authorized_keys entry is added to VM's cloudinit; it is not added in the wizard flow.

Version-Release number of selected component (if applicable):
OCP 4.9.0-fc.0, CNV 4.9.0

How reproducible:
100%

Steps to Reproduce:
1. Create a VM from template
2. Select the customize flow

Actual results:
The following is added to cloudinit:
              ssh_authorized_keys:
                - ''


Expected results:
If no keys are added by the user, this section should not be added.

Additional info:
==== Wrong format - VM created with customization ====
        - cloudInitNoCloud:
            userData: |
              user: fedora
              password: fedora
              chpasswd:
                expire: false
              ssh_authorized_keys:
                - ''

==== Good format - VM created without customization ====

        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: fedora
              password: fyl3-q66d-p3ik
              chpasswd: { expire: False }
          name: cloudinitdisk

Comment 1 Guohua Ouyang 2021-09-01 07:00:04 UTC
It probably has the same cause with bug https://bugzilla.redhat.com/show_bug.cgi?id=1996630

Comment 5 errata-xmlrpc 2022-03-10 16:06:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056