Schema for "users" key is too strict

Bug #1999476 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Committed
Medium
Unassigned

Bug Description

Against cc_users_groups, I have some configurations that use:

#cloud-config
disable_root: false
users: []

This used to work. I think it's a reasonable configuration: "please make root work, and don't create a non-root user". I'm doing this in order to have management of users/groups done later, not by cloud-init, on these instances.

On booting Ubuntu 22.04 (cloud-init 22.3.4-0ubuntu1~22.04.1), I got:

[ 30.621713] cloud-init[505]: 2022-12-13 03:35:09,073 - schema.py[WARNING]: Invalid cloud-config provided: Please run 'sudo cloud-init schema --system' to see the schema errors.

# cloud-init schema --system
Cloud config schema deprecations:
Error:
Cloud config schema errors: users: [] is too short

This seems to be caused by cloudinit/config/schemas/schema-cloud-config-v1.json specifying "minItems": 1 against the "users" key.

Expected behaviour: the above configuration works as before, with root login permitted but no other users created.

Actual behaviour: unexpected schema warning. However I did get root access as desired, and the ubuntu user does not exist. So perhaps the validation isn't enforced yet?

Tags: bitesize
Revision history for this message
James Falcon (falcojr) wrote (last edit ):

Yes, the use case makes sense. You are correct in that it is only a warning, but it's a warning we should fix.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Robie Basak (racb) wrote :

Thanks! I appreciate your confirmation that it's just a warning that I can ignore for now :)

I said:

> However I did get root access as desired, and the ubuntu user does exist.

I meant to say that the ubuntu *does not* exist. I'll fix the description.

description: updated
James Falcon (falcojr)
tags: added: bitesize
Revision history for this message
Chad Smith (chad.smith) wrote :
Changed in cloud-init:
status: Triaged → Fix Committed
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.