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 replaceAll support for go templates #5468

Merged
merged 5 commits into from
May 1, 2024
Merged

Added replaceAll support for go templates #5468

merged 5 commits into from
May 1, 2024

Conversation

fabriziofiorucci
Copy link
Contributor

Proposed changes

Enabled support for replaceAll in go templates

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@fabriziofiorucci fabriziofiorucci requested a review from a team as a code owner April 29, 2024 15:14
Copy link

netlify bot commented Apr 29, 2024

👷 Deploy request for nginx-kubernetes-ingress pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 53fbe4c

@vepatel vepatel requested a review from haywoodsh April 29, 2024 15:28
@vepatel vepatel enabled auto-merge (squash) April 29, 2024 15:46
@vepatel vepatel disabled auto-merge April 29, 2024 15:47
@fabriziofiorucci fabriziofiorucci requested a review from a team as a code owner April 29, 2024 16:00
@github-actions github-actions bot added the documentation Pull requests/issues for documentation label Apr 29, 2024
Copy link
Contributor

@haywoodsh haywoodsh left a comment

Choose a reason for hiding this comment

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

It could be potentially confusing for the users since this PR makes changes to helper functions in internal/configs/version2 but the docs are for ingress template only.

Helper functions can be used in the Ingress template to parse the values of custom annotations.
https://github.com/nginxinc/kubernetes-ingress/pull/5468/files#diff-41a03d28be17f49b16b7644d03d1dafb5073b6aee2ffafe099446b1649dba1cfR103

Until we change the page's wording or move it to a better location, I would suggest following this PR #4560 and add the replaceAll function to both version1 and version2

I also think we should add a test case for the function to template_helper_test.go in both version1 and version2 like the PR mentioned above

@vepatel vepatel merged commit 7f19bed into nginxinc:main May 1, 2024
112 of 129 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants