Add repository information to artifacts when using `tkn bundle`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 461
- Forks
- 277
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 95
Description
Feature request
When pushing a Tekton bundle using the tkn bundle command, users should have an option to add labels to the artifact pointing to the git source for the bundle including the immutable reference and context directory within the source.
These labels could either be added using a single command which would get the relevant information from the context or using multiple commands requiring users to explicitly specify the references for the label content.
Use case
The source and history of Tekton tasks can be beneficial when debugging Pipelines. Users should be able to view the bundles in OCI registries to easily track the sources.
Tekton bundles can be easily copied from one image registry to another. As this happens, the original provenance can easily be lost. Since the image labels would be copied with the artifacts, provenance should be easily tracked assuming a well-intending entity made the copy (i.e. registry copies with intentional modification to the labels would be out of scope from a threat model).
UI Example
If the bundle is generated from within the context of a git repository, then it could be possible to collect the repo and commit references and the context can additionally be added based on the file used as the bundle's source
tkn bundle push quay.io/myork/mybundle:1.0 -f path/to/my/file.json --label-source
tkn bundle push quay.io/myorg/mybundle:latest "apiVersion: tekton.dev/v1beta1 kind: Pipeline..." --label-repository "..." --label-commit "abc..."
cat path/to/my/unified_yaml_file.yaml | tkn bundle push myprivateregistry.com/myorg/mybundle -f --label-repository "..." --label-commit "abc..." --label-context "path/to/my/" -
The following examples would not be supported as tkn wouldn't be able to validate that the sources are related to the git invocation information from $CWD.
tkn bundle push quay.io/myorg/mybundle:latest "apiVersion: tekton.dev/v1beta1 kind: Pipeline..." --label-source
cat path/to/my/unified_yaml_file.yaml | tkn bundle push myprivateregistry.com/myorg/mybundle -f --label-source -
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start at the tkn bundle push command entry point and trace how bundle source input and labels are handled. Define the supported repository, immutable commit, and context metadata options, including validation rules for local Git context, then add tests showing the labels are present on pushed artifacts and unsupported source cases are rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100