[enhancement]: cloud-init does not provide a schema-compliant way to retain current system_info
package_mirrors
behaviour
#5392
Labels
enhancement
New feature or request
Milestone
TL;DR: If a user specifies only a primary mirror via
apt:
, the current behaviour with (schema-violating)system_info:
in vendor-data cannot be replicated using (schema-compliant)apt:
in vendor-data. This means we cannot fix schema validation errors appearing in user systems (due to our non-compliant vendor-data) while maintaining our users' expected behaviour.Currently, we configure our cloud's apt repositories via cloud-init vendor-data using
system_info
:By default,
mirrors.digitalocean.com
is configured as the primary mirror, andsecurity.ubuntu.com
as the security mirror. However,system_info
in vendor-data now produces schema validation warnings in cloud-init logs, which means our users are asking us why it is "broken". In investigating this, I found that the following vendor-data produces the same default behaviour:and is schema-compliant.
Unfortunately, the behaviour of these two vendor-data configurations diverge if a user provides their own
apt:
configuration via user-data. If they specify this configuration:then with the
system_info:
vendor-data, both primary and security mirrors are set tous.archive.ubuntu.com
because https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cc_apt_configure.py#L1053-L1056 sees only primary configuration, and so uses it as the security mirror also. With theapt:
vendor-data, however, there is asecurity:
configuration in the merged configuration, and so the primary mirror is set tous.archive.ubuntu.com
but the security mirror is set tosecurity.ubuntu.com
.I do think this is generally preferable behaviour, as users have to explicitly opt-out of receiving security updates via the most timely mechanism in their user-data. However, it presents an issue for maintaining the behaviour of already-written user-data: users with such user-data may be relying on the fact that no Ubuntu mirrors are enabled with their current configuration (if, e.g., all software on their infra needs to go through a change management process, so they're using their own managed mirrors), and we don't want to change that "just" to address schema validation warnings.
The text was updated successfully, but these errors were encountered: