-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix re-applying v1beta1 TaskRun failing 🚢 #2285
Fix re-applying v1beta1 TaskRun failing 🚢 #2285
Conversation
Re-apply a v1beta1 resource would failed because of `inputs` (or `outputs`) not a valid field. This is mainly because we are using `v1alpha1` as stored version and thus getting the struct as v1alpha1 internally. This fixes this issue by marking `TaskRun.Spec.Inputs` and `TaskRun.Spec.Outputs` as pointers. It doesn't change the API, but fixes the problem as a `nil` pointer will not be unmarshall where the struct was. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
The following is the coverage report on pkg/.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Were you able to prove that this fixes the issue?
/lgtm
@@ -4,7 +4,6 @@ go 1.13 | |||
|
|||
require ( | |||
cloud.google.com/go v0.47.0 // indirect | |||
cloud.google.com/go/storage v1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither.. go mod
wonders… it comes, it goes those two things.. I have no idea why…
@@ -43,7 +42,6 @@ require ( | |||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect | |||
golang.org/x/tools v0.0.0-20200214144324-88be01311a71 // indirect | |||
gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect | |||
google.golang.org/api v0.15.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
Yeah, re-applying twice the same |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
Changes
Re-apply a v1beta1 resource would failed because of
inputs
(oroutputs
) not a valid field. This is mainly because we are usingv1alpha1
as stored version and thus getting the struct as v1alpha1internally.
This fixes this issue by marking
TaskRun.Spec.Inputs
andTaskRun.Spec.Outputs
as pointers. It doesn't change the API, butfixes the problem as a
nil
pointer will not be unmarshall where thestruct was.
Signed-off-by: Vincent Demeester vdemeest@redhat.com
Fixes #2276
/cc @sbwsg @bobcatfish @afrittoli
/priority critical-urgent
/kind bug
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:
cmd
dir, please updatethe release Task to build and release this image.
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