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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark PipelienResourceBinding as inlined 馃彂 #2359

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

vdemeester
Copy link
Member

Changes

Without this, using Unstructured to unmarshall the structs will
result in empty/nil resources.

This is a problem for tektoncd/cli v1beta1 support 馃槗. Should we consider it for a 0.11.2 ?

/cc @sbwsg @bobcatfish

Signed-off-by: Vincent Demeester vdemeest@redhat.com

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

Fix embedded PipelineResourceBinding json unmarshalling

@tekton-robot tekton-robot requested review from bobcatfish and a user April 9, 2020 09:32
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Apr 9, 2020
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 9, 2020
@vdemeester
Copy link
Member Author

/cc @piyush-garg

@ghost ghost added the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Apr 9, 2020
@ghost
Copy link

ghost commented Apr 9, 2020

I don't fully understand what's going on here. Unstructured is this type from k8s right? And inline I found documented in the bson package but not json, it means that json fields don't need to be nested in order for their values to end up in the embedded struct, is that right?

So at the moment when cli unmarshals TaskResourceBinding into an Unstructured variable, we lose PipelineResourceBinding - it gets set to nil. Is that right?

/approve

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

I don't fully understand what's going on here. Unstructured is this type from k8s right? And inline I found documented in the bson package but not json, it means that json fields don't need to be nested in order for their values to end up in the embedded struct, is that right?

inline for some of the go marshalling json library, means this is a embedded type, the fields from it are at the same level as the field. Which is the case here (and for other field in the API).

So at the moment when cli unmarshals TaskResourceBinding into an Unstructured variable, we lose PipelineResourceBinding - it gets set to nil. Is that right?

/approve

yes

Copy link
Contributor

@piyush-garg piyush-garg 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 Apr 9, 2020
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: piyush-garg, sbwsg

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

@vdemeester
Copy link
Member Author

/retest

2 similar comments
@vdemeester
Copy link
Member Author

/retest

@vdemeester
Copy link
Member Author

/retest

@ghost
Copy link

ghost commented Apr 9, 2020

/test pull-tekton-pipeline-integration-tests

@piyush-garg
Copy link
Contributor

piyush-garg commented Apr 9, 2020

This will need for tektoncd/cli#884 to work properly

@piyush-garg
Copy link
Contributor

/test pull-tekton-pipeline-integration-tests

1 similar comment
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@ghost
Copy link

ghost commented Apr 10, 2020

I'm pretty sure these failures are #2337

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@ghost
Copy link

ghost commented Apr 14, 2020

looks like this should pass after a rebase! the integration failed on the pipelinerun cancel e2e test we merged earlier today.

Without this, using `Unstructured` to unmarshall the structs will
result in empty/nil resources.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2020
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2020
@tekton-robot tekton-robot merged commit 451e4d3 into tektoncd:master Apr 14, 2020
@vdemeester vdemeester deleted the fix-resource-inline branch April 14, 2020 15:53
@ghost ghost removed the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Apr 16, 2020
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants