Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current pruning logic uses the metadata.Name, under the assumption this is unique. We forced it to be unique by
setting the name equal to the path. This has caused a few headaches for newcomers.
This PR proposes to use a hash of the path and add it as a sha256 prune mark. Except for consistency, this also resolves
the issue that labels are limited to 63 characters while paths can be much longer. This can optionally be enabled by
setting
spec.pruneMark
and leaves the originalspec.injectLabels
untouched. What's the catch? This label can't beused anymore for pruning as the logic to support it would be arguably more complex.
Surplus, this PR also sets metadata.Path at runtime, the path relative to the root. This removes the aformentioned
assumption that name equals path and also shows up in
tk env list --json
, which can in turn be used by other toolsthat want to perform bulk actions on Tanka environments.