Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require CloudInit .spec.contents to be valid YAML (backport #34) #35

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Feb 8, 2024

This is an automatic backport of pull request #34 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

The Elemental cloud-init executor will fail in disastrous ways instead
of just discarding the document if the document's contents are not YAML.
However, it does ignore instructions that it doesn't understand if the
document is valid YAML.

So, require that the CloudInit resource's .spec.contents are valid YAML.

Ideally we could use the yip package to parse and perform semantic
analysis on the document as a richer form of validation here, but that
package does not expose a way of reading those diagnostics. In client
code, it only logs what the errors are (in fact, the function signature
doesn't return an error.)

Some future work upstream in that package could be beneficial here to
create an API such that the yip package can return errors to its caller
instead of simply logging them.

Signed-off-by: Connor Kuehl <[email protected]>
(cherry picked from commit 786b1b2)
@connorkuehl connorkuehl merged commit 0e0dadd into v0.2.x Feb 12, 2024
5 checks passed
@mergify mergify bot deleted the mergify/bp/v0.2.x/pr-34 branch February 12, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants