carvel-dev / carvel-dev/ytt

[data/values] Add support for omitting "data.values" when referencing values

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

Description

ytt uses `data.values.myKey` to reference a value and `data.values.` is always the prefix for the keys. So we can let ytt treats `data.values.` as the default prefix, and instead uses `.myKey` to reference the value.

BTW the first line `#@ load("@ytt:data", "data")` (AFAIK is always the same in every template files) can also be omitted and make it default by ytt.

```
#@ load("@ytt:data", "data")

#@ some_list = [data.values.myKey, "item1"]
```

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named in the issue. Start by locating ytt's handling of data.values references and template loads, then determine how the proposed shorthand should interact with existing syntax. Done means both the data.values prefix and the repeated data load can be omitted without changing the resulting values.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, yaml
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.