canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.99k stars 883 forks source link

Cloudinit modules should provide schema validation to better alert consumers to unsupported config #2902

Closed ubuntu-server-builder closed 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1692916

Launchpad details
affected_projects = ['cloud-init (Ubuntu)', 'cloud-init (Ubuntu Xenial)', 'cloud-init (Ubuntu Zesty)']
assignee = chad.smith
assignee_name = Chad Smith
date_closed = 2017-09-23T02:33:18.820228+00:00
date_created = 2017-05-23T14:53:24.892097+00:00
date_fix_committed = 2017-07-31T20:24:12.317152+00:00
date_fix_released = 2017-09-23T02:33:18.820228+00:00
id = 1692916
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1692916
milestone = None
owner = chad.smith
owner_name = Chad Smith
private = False
status = fix_released
submitter = chad.smith
submitter_name = Chad Smith
tags = ['verification-done-xenial', 'verification-done-zesty']
duplicates = []

Launchpad user Chad Smith(chad.smith) wrote on 2017-05-23T14:53:24.892097+00:00

=== Begin SRU Template === [Impact] New feature to validate and log invalid schema warnings from cc_ntp cloud-config module.

[Test Case] if [ ! -f lxc-proposed-snapshot ]; then   wget https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bin/lxc-proposed-snapshot   chmod 755 lxc-proposed-snapshot fi

cat < valid.conf

cloud-config

ntp: EOF cat < invalid.conf

cloud-config

ntp: -1 EOF for release in xenial zesty; do         ref=$release-proposed;         echo "$release START --------------";         ./lxc-proposed-snapshot --proposed --publish $release $ref;         lxc init $ref test-$release;         lxc start test-$release;         sleep 10;         lxc exec test-$release -- sudo apt update;         lxc file push valid.conf test-$release/valid.conf;         lxc file push invalid.conf test-$release/invalid.conf;         lxc exec test-$release -- python3 /usr/lib/python3/dist-packages/cloudinit/config/schema.py -c /valid.conf | grep Valid;         lxc exec test-$release -- apt-cache depends cloud-init | grep jsonschema # should be empty;         # invalid.conf will not generate errors when jsonschema is not present         lxc exec test-$release -- python3 /usr/lib/python3/dist-packages/cloudinit/config/schema.py -c /invalid.conf | grep invalid;         lxc exec test-$release -- sudo apt install python3-jsonschema         # invalid.conf will generate errors when jsonschema is not present          lxc exec test-$release -- python3 /usr/lib/python3/dist-packages/cloudinit/config/schema.py -c /invalid.conf | grep invalid; done;

[Regression Potential] We don't want to introduce a mandatory jsonschema dependency in older series. Validate that older releases can run without errors when jsonschema is not installed.

[Other Info] Upstream commit at   https://git.launchpad.net/cloud-init/commit/?id=0a448dd034

=== End SRU Template ===

cloudinit needs a mechanism to parse and validate a strict schema definition for modules that parse user created #cloud-config yaml files.

ubuntu-server-builder commented 1 year ago

Launchpad user Chad Smith(chad.smith) wrote on 2017-05-25T17:17:03.466005+00:00

potential valid and invalid ntp cloud-config files Launchpad attachments: schemas.tar

ubuntu-server-builder commented 1 year ago

Launchpad user Chris J Arges(arges) wrote on 2017-08-23T12:28:23.982770+00:00

Hello Chad, or anyone else affected,

Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Chris J Arges(arges) wrote on 2017-08-23T12:31:39.709944+00:00

Hello Chad, or anyone else affected,

Accepted cloud-init into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Chad Smith(chad.smith) wrote on 2017-08-28T17:56:15.325740+00:00

Validating xenial and zesty with the above script: xenial START -------------- Creating xenial-proposed-123719471 ... The following packages will be upgraded: cloud-init 1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded. Need to get 324 kB of archives. After this operation, 44.0 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 cloud-init all 0.7.9-233-ge586fe35-0ubuntu1~16.04.1 [324 kB] ... Valid cloud-config file /valid.conf Valid cloud-config file /invalid.conf ... The following NEW packages will be installed: python3-jsonschema

And we now can see schema errors when jsonschema is installed

Cloud config schema errors: ntp.pools: -1 is not of type 'array'

zesty START -------------- Creating zesty-proposed-34023523 ... The following packages will be upgraded: cloud-init ... Get:1 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 cloud-init all 0.7.9-233-ge586fe35-0ubuntu1~17.04.1 [321 kB] ... Creating test-zesty Valid cloud-config file /valid.conf Valid cloud-config file /invalid.conf ... The following NEW packages will be installed: python3-jsonschema

And we now can see schema errors when jsonschema is installed

Cloud config schema errors: ntp.pools: -1 is not of type 'array'

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-09-13T01:26:05.837714+00:00

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~16.04.1


cloud-init (0.7.9-233-ge586fe35-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Chris Halse Rogers(raof) wrote on 2017-09-13T01:26:47.094190+00:00

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-09-13T01:27:27.937540+00:00

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~17.04.1


cloud-init (0.7.9-233-ge586fe35-0ubuntu1~17.04.1) zesty; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:33:20.885019+00:00

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.