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

Set ConfigSource in clusterresolver #5687

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

chuangw6
Copy link
Member

@chuangw6 chuangw6 commented Oct 25, 2022

Changes

/kind feature

Related to #5522

Prior, a field named Source was introduced to ResolutionRequest status to record the source where the remote resource came from. And the individual resolvers need to implement the Source function to set the correct source value. But the method in clusterresolver returns a nil value.

Now, we return correct source value with the 3 subfields: url, digest and entrypoint

  • url: Kubernetes CRD namespace-scoped resource URI appended with UID.
    Example: /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME@UID.
  • digest: hex-encoded sha256 checksum of the in-cluster resource
  • entrypoint: empty because the path is already available in url field.

Signed-off-by: Chuang Wang [email protected]

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Set source value for cluster resource to link back its origin i.e. url and checksum.

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Oct 25, 2022
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 25, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.2% 87.4% 1.1

@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch from 2dc2d1d to 426e02a Compare October 25, 2022 21:49
@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 25, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.2% 87.4% 1.1

pipeline.Kind = "Pipeline"
pipeline.APIVersion = "tekton.dev/v1beta1"
pipeline.APIVersion = groupVersion
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, are we also going to support v1 in the remote resolution after V1 release?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we will. Basically, this should always be whatever version is used in the PipelineRun reconciler by default, but we should probably add a param for apiVersion to allow overriding that...

Copy link
Member Author

Choose a reason for hiding this comment

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

Out of curiosity, are we also going to support v1 in the remote resolution after V1 release?

Yeah agreed. We will need to support v1 in remote resolution. Thanks for asking @XinruZhang .

Copy link
Member

Choose a reason for hiding this comment

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

+1 for a new param for apiVersion, it looks like a future refactor work XD

@chuangw6
Copy link
Member Author

chuangw6 commented Nov 1, 2022

/hold

Since resources in cluster are not in version control which is desired for slsa provenance, the source value might be meaningless. We need more discussions around this.

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 1, 2022
@chuangw6 chuangw6 marked this pull request as draft November 1, 2022 14:34
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 1, 2022
@lbernick lbernick removed their request for review November 1, 2022 14:46
@chuangw6 chuangw6 marked this pull request as ready for review November 1, 2022 19:52
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 1, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.2% 87.4% 1.1

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2022
@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch 2 times, most recently from a4c57fd to d96e214 Compare November 4, 2022 18:17
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.4% 84.4% -2.0

@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch from d96e214 to 86fef92 Compare November 4, 2022 18:37
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch from 3c9a646 to 00dd28a Compare November 8, 2022 20:30
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch from 00dd28a to 6e74588 Compare November 8, 2022 20:32
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.4% 84.4% -2.0

@chuangw6
Copy link
Member Author

chuangw6 commented Nov 8, 2022

/retest

@chuangw6 chuangw6 requested review from wlynch and removed request for afrittoli, jerop and pritidesai November 8, 2022 20:44
@abayer
Copy link
Contributor

abayer commented Nov 9, 2022

/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2022
Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abayer, wlynch

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

Related to tektoncd#5522

Prior, a field named Source was introduced to ResolutionRequest status
to record the source where the remote resource came from. And the
individual resolvers need to implement the Source function to set the
correct source value. But the method in clusterresolver returns a nil value.

Now, we return correct source value with the 3 subfields: url, digest and entrypoint
- url: [Kubernetes CRD namespace-scoped resource URI](https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-uris) appended with UID.
Example: /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME@UID.
- digest: hex-encoded sha256 checksum of the in-cluster resource
- entrypoint: ***empty*** because the path is already available in url field.

Signed-off-by: Chuang Wang <[email protected]>
@chuangw6 chuangw6 force-pushed the source-in-clusterresolver branch from 6e74588 to 765bf8a Compare November 9, 2022 20:02
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2022
@chuangw6
Copy link
Member Author

chuangw6 commented Nov 9, 2022

Thanks for the lgtm @wlynch.
Sorry. Just resolved conflict with main, which caused lgtm to be removed. 🤣

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 86.4% 84.4% -2.0

@chuangw6
Copy link
Member Author

chuangw6 commented Nov 9, 2022

/retest

@chuangw6 chuangw6 requested a review from wlynch November 9, 2022 20:57
Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

/lgtm

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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

6 participants