-
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: do not set default kind when taskRef resolver is present #7763
fix: do not set default kind when taskRef resolver is present #7763
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test check-pr-has-kind-label |
@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/lgtm
/ok-to-test |
a069789
to
b66a781
Compare
b9406b2
to
e79988d
Compare
pipeline: 1h | ||
pipelineRef: | ||
kind: Pipeline |
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.
The pipelineRef
does not have a kind
field.
pipeline/pkg/apis/pipeline/v1beta1/pipelineref_types.go
Lines 19 to 37 in d714545
// PipelineRef can be used to refer to a specific instance of a Pipeline. | |
type PipelineRef struct { | |
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names | |
Name string `json:"name,omitempty"` | |
// API version of the referent | |
// +optional | |
APIVersion string `json:"apiVersion,omitempty"` | |
// Bundle url reference to a Tekton Bundle. | |
// | |
// Deprecated: Please use ResolverRef with the bundles resolver instead. | |
// +optional | |
Bundle string `json:"bundle,omitempty"` | |
// ResolverRef allows referencing a Pipeline in a remote location | |
// like a git repo. This field is only supported when the alpha | |
// feature gate is enabled. | |
// +optional | |
ResolverRef `json:",omitempty"` | |
} |
pipeline/pkg/apis/pipeline/v1/pipelineref_types.go
Lines 19 to 32 in d714545
// PipelineRef can be used to refer to a specific instance of a Pipeline. | |
type PipelineRef struct { | |
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names | |
Name string `json:"name,omitempty"` | |
// API version of the referent | |
// +optional | |
APIVersion string `json:"apiVersion,omitempty"` | |
// ResolverRef allows referencing a Pipeline in a remote location | |
// like a git repo. This field is only supported when the alpha | |
// feature gate is enabled. | |
// +optional | |
ResolverRef `json:",omitempty"` | |
} |
@@ -49,6 +49,7 @@ func (tr *TaskRef) ConvertFrom(ctx context.Context, source v1.TaskRef) { | |||
// default and it will be in beta before the stored version of CRD getting swapped to v1. | |||
func (tr TaskRef) convertBundleToResolver(sink *v1.TaskRef) { | |||
if tr.Bundle != "" { | |||
sink.Kind = "" |
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.
Remove the original "kind" attribute to stay consistent with the behavior elsewhere: once a resolver is used, "kind" is no longer necessary.
Hi, @vdemeester. |
e79988d
to
dc16345
Compare
4242960
to
797cbd1
Compare
797cbd1
to
da73725
Compare
da73725
to
a2b9247
Compare
fix tektoncd#7762 Do not set default kind when taskRef resolver is present, keep the original configuration of the user.
a2b9247
to
fc03715
Compare
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.
Looks good, thank you!
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli 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 |
if pt.TaskRef.Kind == "" && pt.TaskRef.Resolver == "" { | ||
pt.TaskRef.Kind = NamespacedTaskKind | ||
} | ||
} |
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.
This will continue to work even after TEP-0154 is done
/lgtm |
fix #7762
Do not set default kind when taskRef resolver is present, keep the original configuration of the user.
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind bug