Skip to content

How to Patch yaml from str into Deployment CR ? #1480

Answered by mateiidavid
ppsite asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ppsite. Repeating a few things to see if I understand it correctly.

  • You have a deployment reconciler
  • You have a CRD (AnnoTemplate) that you want to read. This is conditional on some annotation being present on the deployment.
  • You want to apply the template in the CRD to the deployment.

You will need to generate a patch, as you've noted in the title. The examples directory contains a few different examples that apply patches differently. There's also an example in the docs on how to create a patch via serde_json.

You'll need to find a way to construct a spec that you want to patch (for example by pushing to the deployment's existing containers list every time you read and deserializ…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ppsite
Comment options

Answer selected by ppsite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants