carvel-dev / carvel-dev/ytt

how to best short-circuit entire template evaluation

Open
#500 4 comments 0 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
Go
Stars
1.9k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

possible workaround, from conv w dimitry, using a `.lib.yaml`....
**Describe the problem/challenge you have**

Right now, we have to sometimes nest 1000s of lines of yaml in a
```
#@ if
...
#@end
```
block, which can be hard to reason about (i.e. what is this `#@end` referring to?)...

https://github.com/vmware-tanzu/tanzu-framework/blob/main/pkg/v1/providers/infrastructure-vsphere/v0.7.10/ytt/overlay.yaml

**Describe the solution you'd like**

Something like

```
#@ if not data.values.IS_WINDOWS_WORKLOAD_CLUSTER:
#@ break;
#@end
```

so that we can short circuit (or not) the processing of a file in some way.

Contributor guide

Open the contributing guide

Research direction

Start with the linked overlay.yaml and review the described .lib.yaml workaround alongside the proposed #@ break syntax. Define done as a supported way to short-circuit an entire template file without wrapping thousands of YAML lines; the issue does not identify implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.