Skip to content

Support multiple resources per template, aka. loops and conditions#174

Merged
Michael Vittrup Larsen (michaelvl) merged 9 commits intomainfrom
feature/155-loops-and-multiple-resources-in-templates
May 25, 2023
Merged

Support multiple resources per template, aka. loops and conditions#174
Michael Vittrup Larsen (michaelvl) merged 9 commits intomainfrom
feature/155-loops-and-multiple-resources-in-templates

Conversation

@michaelvl
Copy link
Contributor

@michaelvl Michael Vittrup Larsen (michaelvl) commented May 19, 2023

Description

Enable support for templates with conditionals and loops. Currently a template must render to exactly one resource. This PR changes this, such that templates may render to zero, one or more resources which is an enabled for using e.g. if and range in templates.

The tests in controllers/gateway_controller_test.go illustrates well this new feature.

Fixes #155

Checklist

  • Unit tests updated
  • End user documentation updated
  • [NA] If changes apply to Helm chart, a note have been made in the 'UNRELEASED' section of the charts CHANGELOG.md

@michaelvl Michael Vittrup Larsen (michaelvl) force-pushed the feature/155-loops-and-multiple-resources-in-templates branch 2 times, most recently from f7ff180 to 7567b12 Compare May 23, 2023 06:41
@michaelvl Michael Vittrup Larsen (michaelvl) marked this pull request as ready for review May 23, 2023 10:37
@michaelvl Michael Vittrup Larsen (michaelvl) force-pushed the feature/155-loops-and-multiple-resources-in-templates branch from 6c8bf2a to 4354a2f Compare May 24, 2023 04:31
@michaelvl Michael Vittrup Larsen (michaelvl) force-pushed the feature/155-loops-and-multiple-resources-in-templates branch from 4354a2f to e0c492f Compare May 24, 2023 04:51
@michaelvl Michael Vittrup Larsen (michaelvl) changed the title Separate resource state from template state Support multiple resources per template, aka. loops and conditions May 25, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Martin Villumsen <mvil@tv2.dk>
@michaelvl Michael Vittrup Larsen (michaelvl) deleted the feature/155-loops-and-multiple-resources-in-templates branch May 25, 2023 06:56
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.

Support loops and if constructs in templates

2 participants