canonical / canonical/cloud-init

#cloud-config-jsonp is almost completely useless

Open
#5,549 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

`#cloud-config-jsonp` is a way to specify [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) operations to
apply to cloud-init's existing configuration. The problem is, in its current form, it is almost completely useless.

I think that the idea is to have a convenient way (even though we already have merge configuration?) to merge user data with previous config. The problem is due to the ordering of how we process cloud-config, it will often attempt to be applied before it ever has a chance to patch anything.

[Our docs](https://cloudinit.readthedocs.io/en/23.4/explanation/vendordata.html) call out using it as a way for user data to override vendor data, but this does not work, because the jsonp part gets processed before vendor data.

The only way this can work as expected is if you have a MIME multipart user data in which the jsonp attachment is ordered after an earlier attachment that you want to patch. This seems like an extreme corner case because:
1. Merge strategy is available
2. If you control your user data parts, why would structure them such that overlap in a way that needs to be merged this way?
3. If you don't control your user data parts, how can you ensure that they get ordered correctly?

Given that feature also pulls in the `jsonpatch` dependency, I think we should remove this feature soon in a upcoming release.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.