-
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
set the param type based on the default value #4608
set the param type based on the default value #4608
Conversation
The following is the coverage report on the affected files.
|
Check if the type is specified or not, if not, infer it from the default value. This commit fixes a bug where the param type is set to the default type without checking if default type is specified or not.
b1e9db9
to
94107d8
Compare
The following is the coverage report on the affected files.
|
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.
thanks @pritidesai 😁
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, vdemeester 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 |
workspace-in-sidecar is a known flake: #4169 /test pull-tekton-pipeline-alpha-integration-tests |
Changes
(pp *ParamSpec) SetDefaults
sets the param type based on the default type. But, it is possible that thedefault
value is specified without specifying the type. Also, theelse
block sets thetype
tostring
whendefault
isnil
not when the type can not be inferred from the default value (like its explained in the comment):pipeline/pkg/apis/pipeline/v1beta1/param_types.go
Lines 58 to 64 in 99b8b19
The unit tests does not catch this since the test uses
v1beta1.NewArrayOrString
which sets the type explicitly:pipeline/pkg/apis/pipeline/v1beta1/param_types.go
Lines 139 to 150 in 99b8b19
This commit checks if the
type
is not specified, infer it from the default value and sets the param type based on the default value./kind bug
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes
For pull requests with a release note: