diff options
author | Chad Smith <chad.smith@canonical.com> | 2023-04-17 16:25:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 16:25:02 -0600 |
commit | 3ee384680e0a615834c1cb386be88c94f004b9b5 (patch) | |
tree | 257eb7c951fcd6da483fa9e57f2aafbe3aa9d58f /cloudinit | |
parent | b71794094ac93942020b5f68f8f62900e1d09c97 (diff) | |
download | cloud-init-git-3ee384680e0a615834c1cb386be88c94f004b9b5.tar.gz |
users: schema permit empty list to indicate create no users
When defining json schema in a63f45f7, we were a bit too strict by
setting `minItems: 1` on the `users:` list.
This schema definition regressed the ability to prevent default_user
creation with user-data. Remove that schema constraint because the
code already supports this case.
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_users_groups.py | 6 | ||||
-rw-r--r-- | cloudinit/config/schemas/schema-cloud-config-v1.json | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cloudinit/config/cc_users_groups.py b/cloudinit/config/cc_users_groups.py index 52f0b844..d64cae9e 100644 --- a/cloudinit/config/cc_users_groups.py +++ b/cloudinit/config/cc_users_groups.py @@ -146,6 +146,12 @@ meta: MetaSchema = { sudo: null """ ), + dedent( + """\ + # Avoid creating any ``default_user``. + users: [] + """ + ), ], "frequency": PER_INSTANCE, "activate_by_schema_keys": [], diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json index 2a2d8631..3c2b90f9 100644 --- a/cloudinit/config/schemas/schema-cloud-config-v1.json +++ b/cloudinit/config/schemas/schema-cloud-config-v1.json @@ -3079,8 +3079,7 @@ "$ref": "#/$defs/users_groups.user" } ] - }, - "minItems": 1 + } } } }, |