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

LaunchTemplate UserData Patching/Transforming Not Working #2094

Closed
hhami-newday opened this issue Sep 30, 2024 · 2 comments
Closed

LaunchTemplate UserData Patching/Transforming Not Working #2094

hhami-newday opened this issue Sep 30, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@hhami-newday
Copy link

What problem are you facing?

I am having issues with LaunchTemplates and patching/transforming the user-data within Compositions.

More specifically, I would like to include some details generated by other resources that are created in the Composition (for example, EKS Cluster server endpoint etc).

So this would involve:

  • Combining and formatting the various elements from status.*
  • Base64 encoding the above and giving it to the user data field

I cannot seem to get that to work. The status shows no errors, just the userdata remaining blank. If I choose a more simple operation, I can place a string into userdata (which it will then obviously complain it isn't base64 encoded).

How could Crossplane help solve your problem?

I am finding it hard to get any examples similar to mine above that involve both manipulating outputs from other resources AND encoding it before populating the field which requires the encoding.

I can't imagine this is a unique scenario to perform so having that documented would be useful. Any pointers to where this info would be, if I missed it, please feel free to correct me.

@hhami-newday hhami-newday added the enhancement New feature or request label Sep 30, 2024
@hhami-newday
Copy link
Author

I eventually solved this but took much longer than it should have. I think maybe extended examples of sharing values across resources in Compositions would be valuable.

@MisterMX
Copy link
Collaborator

MisterMX commented Oct 4, 2024

Patch and transforms are a feature of core Crossplane itself which lives in its own repo: https://github.com/crossplane/crossplane. The providers itself do not contain such logic and only expose resource information in the status field.

You might also want to check out the Crossplane docs that provide more insights on how to write patch and tranforms: https://docs.crossplane.io.

@MisterMX MisterMX closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants