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

feat(funcs.go): added mapValueByIndexOrEmpty function to safely retrieve values from a map #147

Merged
merged 9 commits into from
Mar 11, 2025

Conversation

lince098
Copy link
Contributor

This PR solves the issue #146 allowing the use of templates like:

'{{ $component := indexOrEmpty "k8s.config/component" .metadata.labels | default "unlabeled" }}
 {{ printf "%s-%s-%s.yaml" $component (lower .kind) .metadata.name }}'

@patrickdappollonio
Copy link
Owner

Thank you very much for your contribution!

@patrickdappollonio patrickdappollonio merged commit b7efcb6 into patrickdappollonio:main Mar 11, 2025
1 check passed
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.

2 participants