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

added ability to set custom template delims #18

Merged

Conversation

AndrewChubatiuk
Copy link

Description of your changes

Added ability to set custom template delims to avoid using escaping, while using Helm

Comment on lines 22 to 25
// Template start characters
LeftDelims string `json:"leftDelims,omitempty"`
// Template end characters
RightDelims string `json:"rightDelims,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Template start characters
LeftDelims string `json:"leftDelims,omitempty"`
// Template end characters
RightDelims string `json:"rightDelims,omitempty"`
// Template start characters
// +optional
LeftDelims *string `json:"leftDelims,omitempty"`
// Template end characters
// +optional
RightDelims *string `json:"rightDelims,omitempty"`

These are optional, right? Even though this isn't a real CRD we try to follow CRD conventions. So for optional fields we want them to be pointers, and have the +optional comment marker.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as well

@negz
Copy link
Member

negz commented Nov 3, 2023

Could you please add a new directory under example showing how to use these? The example should have everything it needs to be run with crossplane beta render. Thank you!

@AndrewChubatiuk
Copy link
Author

Could you please add a new directory under example showing how to use these? The example should have everything it needs to be run with crossplane beta render. Thank you!

Done

@AndrewChubatiuk
Copy link
Author

Hey @negz
Sorry for bothering you
Do you expect any additional changes here?

@ezgidemirel
Copy link
Collaborator

Hi @AndrewChubatiuk, thanks for your PR! It looks like some of the unit tests are failing. Could you please fix them and sign your commits?

@AndrewChubatiuk AndrewChubatiuk force-pushed the custom-template-delims branch 2 times, most recently from 24351a1 to d7703bf Compare November 15, 2023 13:53
@AndrewChubatiuk
Copy link
Author

Hi @AndrewChubatiuk, thanks for your PR! It looks like some of the unit tests are failing. Could you please fix them and sign your commits?

HI @ezgidemirel
fixed all checks


// Go Template Config
// +optional
Config *Config `json:"config,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe config is a bit generic? all the other fields below (source/inline/filesystem) could easily be below config. WDYT about templateConfig? CC @turkenh

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed config level and left just delims config

Andrew Chubatiuk added 5 commits November 16, 2023 15:42
Signed-off-by: Andrew Chubatiuk <[email protected]>
Signed-off-by: Andrew Chubatiuk <[email protected]>
Signed-off-by: Andrew Chubatiuk <[email protected]>
Signed-off-by: Andrew Chubatiuk <[email protected]>
@AndrewChubatiuk
Copy link
Author

@ezgidemirel @turkenh @phisco
Are you okay with these changes now?

Copy link
Collaborator

@phisco phisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks @AndrewChubatiuk!

@phisco phisco requested a review from ezgidemirel November 28, 2023 09:01
Copy link
Collaborator

@ezgidemirel ezgidemirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezgidemirel ezgidemirel merged commit 9033354 into crossplane-contrib:main Nov 28, 2023
6 checks passed
@AndrewChubatiuk AndrewChubatiuk deleted the custom-template-delims branch November 28, 2023 12:23
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.

5 participants