Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TaskRunStatus.ResourcesResult to be more generic. #1406

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Oct 9, 2019

Changes

This commit extends ResourcesResult to work for more than just ImageOutputs,
but moving to a key/value map instead of a fixed key of "digest".

This also updates the image_digest_exporter to write data in both formats
for backwards compatibility, and updates our e2e test to use this mechanism.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

- The Name and Digest fields on TaskRunStatus.ResourcesResult are deprecated and are replaced by the new Key and ResourceRef fields.
- Both sets of fields are present in this release, but a future release will remove the legacy fields.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 9, 2019
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 9, 2019
@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 9, 2019

Ref: #1392

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 9, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

Amaaaazing! My only request is for some updates but otherwise this is 💯

We'll also need to update the docs - this section will need to go and/or be updated https://github.com/tektoncd/pipeline/blob/master/docs/resources.md#surfacing-the-image-digest-built-in-a-task and we should probably add:

  • something in resources.md about how this works
  • something about how these values are surfaced (maybe also in resources.md? or maybe in the developer docs) (audience = someone writing a new resource) <-- tho since this PR is just changing image digest, maybe this is something for later
  • something in the TaskRun status docs https://github.com/tektoncd/pipeline/blob/master/docs/taskruns.md#status

image

test/kaniko_task_test.go Show resolved Hide resolved
test/kaniko_task_test.go Show resolved Hide resolved
@@ -70,7 +70,7 @@ func TestPipelineRun(t *testing.T) {

for _, res := range getFanInFanOutGitResources(namespace) {
if _, err := c.PipelineResourceClient.Create(res); err != nil {
t.Fatalf("Failed to create Pipeline Resource `%s`: %s", kanikoResourceName, err)
t.Fatalf("Failed to create Pipeline Resource `%s`: %s", kanikoGitResourceName, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems like an odd change - i wonder if the wrong string was being used here previously?

pkg/apis/pipeline/v1alpha1/resource_types.go Outdated Show resolved Hide resolved
@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 10, 2019

OK, docs are updated and ready to go.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 11, 2019
This commit extends ResourcesResult to work for more than just ImageOutputs,
but moving to a key/value map instead of a fixed key of "digest".

This also updates the image_digest_exporter to write data in both formats
for backwards compatibility, and updates our e2e test to use this mechanism.
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.8% 87.5% -0.3

@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 11, 2019

Rebased!

@imjasonh
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2019
@tekton-robot tekton-robot merged commit e01fe60 into tektoncd:master Oct 11, 2019
@dlorenc dlorenc deleted the result branch October 11, 2019 15:34
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 14, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 14, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 14, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 14, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 14, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 16, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 16, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Oct 17, 2019
This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
tekton-robot pushed a commit that referenced this pull request Oct 17, 2019
This change builds upon #1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants