-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
SDK/DSL: Fix bug when using PipelineParam in pvc
of PipelineVolume
#2018
SDK/DSL: Fix bug when using PipelineParam in pvc
of PipelineVolume
#2018
Conversation
If no `name` is provided to PipelineVolume constructor, a custom name is generated. It relies on `json.dumps()` of the struct after getting converted to dict. When `pvc` is provided and `name` is not, the following error is raised: TypeError: Object of type PipelineParam is not JSON serializable This commit fixes it and extends tests to catch it.
# Testing json.dumps() when pvc is a PipelineParam to avoid | ||
# `TypeError: Object of type PipelineParam is not JSON serializable` | ||
param = PipelineParam(name="foo") | ||
vol3 = PipelineVolume(pvc=param) |
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.
Does this line just verify that the code does not crash?
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.
Yes, I thought it is not necessary to test the result as well (since naming is already tested in the previous lines).
Is it sufficient? Do you think we should test it in a different way?
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ark-kun 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 |
* Update pull request template Signed-off-by: Dan Sun <dsun20@bloomberg.net> * Publish v0.8.0 release Signed-off-by: Dan Sun <dsun20@bloomberg.net> * Add step to describe pods after e2e test failure Signed-off-by: Dan Sun <dsun20@bloomberg.net> * Set default install mode to Serverless Signed-off-by: Dan Sun <dsun20@bloomberg.net>
#1402 introduced the following bug:
If no
name
is provided toPipelineVolume
constructor, a custom name is generated. It relies onjson.dumps()
of the struct after getting converted to dict.When
pvc
is provided andname
is not, the following error is raised:This PR fixes it and extends tests to catch it.
This change is