Comment 0 for bug 1983306

Revision history for this message
Peter Surda (surda) wrote :

Related to #1983303. My user-data begins with #include, as it's not a "Cloud Config Data" but an "Include File" as described in the official documentation. However, this causes the validator `cloud-init schema --system` to complain that

```
Error:
Cloud config schema errors: format-l1.c1: File None needs to begin with "#cloud-config"
```

Ok I thought, I just manually add "#cloud-config" at the top and re-test:

```
Error:
Cloud-config is not a YAML dict.
```

Well, it's not a YAML dict because it's not a cloud config data but an include file, which isn't in the YAML format.

See the specification: https://cloudinit.readthedocs.io/en/latest/topics/format.html

Also look at the implementation in `user_data.py`, function `_do_include`. As you can see, this file isn't processed as YAML but parsed line by line. So the specification and implementation agree, but the schema validator doesn't and thinks it should process it as YAML.

This wouldn't be a practical problem for me, but due to #19833303 I get mangled logs and can't work around it.