-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix Quantity serialization #417
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 Quantity serialization #417
Conversation
This is failing formatting check: You need to run:
|
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 looks good to me, but needs formatting.
to show how V1Containers are not deserialized correctly by `Yaml.dumpAll()`. `YamlTest.testLoadAllFile()` fails.
by adding a `CustomRepresenter` for `Quantity` to `Yaml`. The serialized Deployment YAML's resource requests won't necessarily be in the same format as the original. But this PR prevents the serialization from returning empty maps which is an improvement. In the future, another PR can be made which could guarantee the original YAML is returned when serializing Deployment back to YAML.
93f1427
to
12b147c
Compare
@brendanburns thanks. Fixed the formatting. |
cpu: 500m | ||
requests: | ||
memory: 4Gi | ||
cpu: '2' |
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.
Not sure why the quotes are here. I guess it's because QuantityFormatter.toBase10String()
returns a String?
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, davidxia 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 |
THanks for the PR! |
Fix failing
YamlTest.testLoadAllFile()
by adding a
CustomRepresenter
forQuantity
toYaml
.The serialized Deployment YAML's resource requests won't necessarily be in the
same format as the original. But this PR prevents the serialization from
returning empty maps which is an improvement.
In the future, another PR can be made which could guarantee the original YAML
is returned when serializing Deployment back to YAML.