summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2023-04-17 16:25:02 -0600
committerGitHub <noreply@github.com>2023-04-17 16:25:02 -0600
commit3ee384680e0a615834c1cb386be88c94f004b9b5 (patch)
tree257eb7c951fcd6da483fa9e57f2aafbe3aa9d58f /cloudinit
parentb71794094ac93942020b5f68f8f62900e1d09c97 (diff)
downloadcloud-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.py6
-rw-r--r--cloudinit/config/schemas/schema-cloud-config-v1.json3
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
+ }
}
}
},