-
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
Params + Results with nil Properties treated differently than Params + Results with empty Properties #6605
Comments
Suggesting this can be closed. Thanks @lbernick |
@JeromeJu I think this bug can still be reproduced, even if conversion logic has been addressed |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. 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. |
Expected Behavior
Our API doesn't differentiate between a map being nil and a map being empty.
The following two Task result definitions should be equivalent:
Note: this is unrelated to the result values outputted by the TaskRun.
From the Go style guide: "Do not create APIs that force their clients to make distinctions between nil and the empty slice." (There's no equivalent guidance for maps but it seems like it should be the same?)
If we do want to differentiate this behavior we should at least make sure to document it clearly. I'm not sure why someone would want to declare an object param/result with no properties; it doesn't seem very meaningful.
Fixed in #6570 and #6578.
Actual Behavior
nil Properties -> defaults to string param/result:
empty Properties -> defaults to object param/result
The text was updated successfully, but these errors were encountered: