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

Change the path used by the image digest exporter to the standard out… #1467

Merged
merged 1 commit into from
Oct 29, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Oct 24, 2019

…put path structure.

Previously we were writing output digests to /builder/home/image-output-paths. This commit
unifies that system and expects tasks to output these files to /workspace/output/.

This does introduce a change in behavior, but support is retained for the old location. A warning
is logged if the binary finds an index.json in the old location.

Changes

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

Image index.json files are now expected to be written to /workspace/output/<image resource name> instead of /builder/home/image-outputs. The old location is still supported, but support for this will be removed in a future release.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 24, 2019
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 24, 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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 24, 2019

cc @imjasonh this will probably conflict with your #1440, but it should make things easier in the long run

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.

I think we need a docs update probs, and I'm a bit confused, are these docs wrong https://github.com/tektoncd/pipeline/blob/master/docs/resources.md#surfacing-the-image-digest-built-in-a-task which way we default to /workspace/output/{resource-name} or are we talking about 2 different paths?

Name: "create-dir-default-image-output-mz4c7",
Image: "override-with-bash-noop:latest",
Command: []string{"/ko-app/bash"},
Args: []string{"-args", "mkdir -p /builder/home/image-outputs/outputimage"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: do we not still want this test but with the new path? or do you we feel like this is already covered somewhere else/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function that this was testing got deleted, it now uses the normal output directory creation stuff, which is tested: https://github.com/tektoncd/pipeline/blob/master/pkg/reconciler/taskrun/resources/output_resource_test.go#L171

@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 24, 2019

I think we need a docs update probs, and I'm a bit confused, are these docs wrong https://github.com/tektoncd/pipeline/blob/master/docs/resources.md#surfacing-the-image-digest-built-in-a-task which way we default to /workspace/output/{resource-name} or are we talking about 2 different paths?

Wow, those docs are currently wrong then, and I guess my change makes them right?

@dlorenc dlorenc force-pushed the fiximgdgst branch 2 times, most recently from 7b7a0af to e801460 Compare October 24, 2019 20:13
@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@ghost
Copy link

ghost commented Oct 28, 2019

/test pull-tekton-pipeline-integration-tests

cmd/imagedigestexporter/main.go Outdated Show resolved Hide resolved
@@ -124,7 +119,6 @@ type Inputs struct {
type TaskResource struct {
ResourceDeclaration `json:",inline"`
// +optional
OutputImageDir string `json:"outputImageDir,omitempty"`
Copy link

Choose a reason for hiding this comment

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

This is an API change, right? Would it be worth supporting this field in a deprecated state for a version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it's technically on the API, but as you can see up in image_resource.go it is never actually set during the initialization of the resource. I don't think it's actually functional right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's technically part of the API, but I think it's unused. You can see that this value is never copied from the resource params into the resource in the constructor in image_resource.go.

Copy link
Member

Choose a reason for hiding this comment

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

This is causing a issue, because we do have resources with outputImageDir and they cannot be updated now :(

pkg/apis/pipeline/v1alpha1/task_types.go Outdated Show resolved Hide resolved
…put path structure.

Previously we were writing output digests to /builder/home/image-output-paths. This commit
unifies that system and expects tasks to output these files to /workspace/output/<resource name>.

This does introduce a change in behavior, but support is retained for the old location. A warning
is logged if the binary finds an index.json in the old location.
@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@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/apis/pipeline/v1alpha1/image_resource.go 56.2% 60.0% 3.8
pkg/apis/pipeline/v1alpha1/task_defaults.go 90.0% 80.0% -10.0
pkg/apis/pipeline/v1alpha1/task_validation.go 81.2% 81.5% 0.3
pkg/reconciler/taskrun/resources/image_exporter.go 86.2% 83.3% -2.9
pkg/reconciler/taskrun/resources/pod.go 91.3% 90.7% -0.6

@ghost
Copy link

ghost commented Oct 28, 2019

/lgtm

@tekton-robot tekton-robot assigned ghost Oct 28, 2019
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2019
@bobcatfish
Copy link
Collaborator

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish

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 29, 2019
@tekton-robot tekton-robot merged commit ee806d2 into tektoncd:master Oct 29, 2019
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Dec 3, 2019
This support was left in for one release after deprecation in tektoncd#1467, which was released in 0.9.0.
It can now be safely removed.
tekton-robot pushed a commit that referenced this pull request Dec 3, 2019
This support was left in for one release after deprecation in #1467, which was released in 0.9.0.
It can now be safely removed.
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.

5 participants