This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2209897 - Cloud-init userdata is not parsed correctly if "userData" string is removed
Summary: Cloud-init userdata is not parsed correctly if "userData" string is removed
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.13.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.14.0
Assignee: Ugo Palatucci
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-25 07:47 UTC by nijin ashok
Modified: 2023-08-22 11:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-22 11:14:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   CNV-29095 0 None None None 2023-08-22 11:14:06 UTC

Description nijin ashok 2023-05-25 07:47:29 UTC
Description of problem:

From the console, while creating VM using the template, customize virtual machine => scripts => Edit cloudinit => Click checkbox script => remove everything and add only a customer value like "example: test" and save and apply.

Now when we edit the cloud int again to see the configuration, the data will be below:

~~~
userData: |
  #cloud-config
  '0': u
  '1': 'n'
  '2': d
  '3': e
  '4': f
  '5': i
  '6': 'n'
  '7': e
  '8': d
~~~



Version-Release number of selected component (if applicable):

OpenShift Virtualization   4.13.0

How reproducible:

100%

Steps to Reproduce:

Please refer above.

Actual results:

Cloud-init user data is not parsed correctly if "userData" is removed.

Expected results:

Either validate the user input while saving the data or parse the data correctly.

Additional info:

Comment 2 Guohua Ouyang 2023-08-03 11:20:07 UTC
While looking at the script examples here: https://cloudinit.readthedocs.io/en/latest/reference/examples.html
There are no "userData: |" provided in these examples, hence suggest removing it from script UI.

Currently it looks like:
userData: |
  #cloud-config
  user: centos
  password: m62e-b6fg-ve6w
  chpasswd:
    expire: false

Suggestion:
#cloud-config
user: centos
password: m62e-b6fg-ve6w
chpasswd:
  expire: false


Note You need to log in before you can comment on or make changes to this bug.