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

provisioner: add dict template function #711

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

AlexanderYastrebov
Copy link
Member

Add dict template function inspired by
https://stackoverflow.com/questions/18276173/calling-a-template-with-several-pipeline-parameters/18276968#18276968

Compared to stackoverflow version it additionally checks for duplicate keys.

Also decided not to use dict from github.com/Masterminds/sprig/v3 as it allows non-string keys, uneven number of arguments and does not check for duplicate keys.

AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov
Copy link
Member Author

Here is the prospective usecase zalando-incubator/kubernetes-on-aws#6592

@AlexanderYastrebov AlexanderYastrebov force-pushed the provisioner/dict-template-func branch 2 times, most recently from 71a01d9 to ab3d9f0 Compare November 29, 2023 11:59
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov
Copy link
Member Author

Needs #712 to fix the build

AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit to zalando-incubator/kubernetes-on-aws that referenced this pull request Nov 29, 2023
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
Add dict template function inspired by
https://stackoverflow.com/questions/18276173/calling-a-template-with-several-pipeline-parameters/18276968#18276968

Compared to stackoverflow version it additionally checks for duplicate keys.

Also decided not to use `dict` from github.com/Masterminds/sprig/v3
as it allows non-string keys, uneven number of arguments and
does not check for duplicate keys.

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@mikkeloscar
Copy link
Contributor

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit ff9f3cb into master Nov 30, 2023
9 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the provisioner/dict-template-func branch November 30, 2023 09:22
AlexanderYastrebov added a commit that referenced this pull request Jun 3, 2024
This is useful for defining a fixed list instead of
splitting a comma-separated string.

See also previous #711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit that referenced this pull request Jun 3, 2024
This is useful for defining a fixed list instead of
splitting a comma-separated string.

See also previous #711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
AlexanderYastrebov added a commit that referenced this pull request Jun 3, 2024
This is useful for defining a fixed list instead of
splitting a comma-separated string.

See also previous #711

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
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.

None yet

2 participants