You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launchpad user Robert Van Voorhees(rcvanvo) wrote on 2020-07-24T09:49:15.112105+00:00
In #290 we landed a change to user-data processing which expanded the set of MIME types we would consider signifying "unknown content" to include many (if not all) of the MIME types we would normally expect to be used in user-data multipart archives[0].
This means that every part is now assigned its MIME type based on the first line of its content; the declared MIME types are ignored.
In the specific reported case, a "text/cloud-boothook" part started with #!, which is appropriate and correct, but was therefore detected as "text/x-shellscript" due to this bug.
In the upstream Kubernetes project Cluster API, specifically the Cluster API AWS Provider, it will download a file securely from AWS Secrets Manager in the cloud-init script, save that file to a well known location, and then restart the cloud-init service through systemd. After the cloud-init script is restarted, it will resolve the secrets file (that had previously not been there) and execute its commands.
This worked fine on versions of cloud-init up until 19.4-33-gbb4131a2-0ubuntu118.04.1. Once upgrading to 20.2-45-g5f7825e2-0ubuntu118.04.1 the secrets file is never resolved again.
Some other information:
cloud-init is definitely successfully running twice based on systemd and cloud-init-output.
The /var/lib/cloud/instance/user-data.txt does show the reference to the well-known file at /etc/secret-userdata.txt
The "resolved" version of user-data at /var/lib/cloud/instance/user-data.txt.i does not include the resolved file. Deleting this file and then restarted cloud-init does not solve the problem, as the file resolves again without it.
Is there another command that is now required if you plan on restarting cloud-init for another execution where files are now present that were previously not?
This bug was originally filed in Launchpad as LP: #1888822
Launchpad details
Launchpad user Robert Van Voorhees(rcvanvo) wrote on 2020-07-24T09:49:15.112105+00:00
In #290 we landed a change to user-data processing which expanded the set of MIME types we would consider signifying "unknown content" to include many (if not all) of the MIME types we would normally expect to be used in user-data multipart archives[0].
This means that every part is now assigned its MIME type based on the first line of its content; the declared MIME types are ignored.
In the specific reported case, a "text/cloud-boothook" part started with #!, which is appropriate and correct, but was therefore detected as "text/x-shellscript" due to this bug.
[0] Specifically, it was expanded to include all the values in the dict at https://github.com/canonical/cloud-init/blob/master/cloudinit/handlers/__init__.py#L43-L54
[Original Report]
In the upstream Kubernetes project Cluster API, specifically the Cluster API AWS Provider, it will download a file securely from AWS Secrets Manager in the cloud-init script, save that file to a well known location, and then restart the cloud-init service through systemd. After the cloud-init script is restarted, it will resolve the secrets file (that had previously not been there) and execute its commands.
This worked fine on versions of cloud-init up until 19.4-33-gbb4131a2-0ubuntu1
18.04.1. Once upgrading to 20.2-45-g5f7825e2-0ubuntu118.04.1 the secrets file is never resolved again.Some other information:
Is there another command that is now required if you plan on restarting cloud-init for another execution where files are now present that were previously not?