-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: system prune JSON unmarshalling error in remote client #27269
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
base: main
Are you sure you want to change the base?
Conversation
21c5ded
to
6d77200
Compare
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
/packit retest-failed |
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
thanks @Honny1, looks great to me, nice and clean :)
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Honny1, ninja-quokka The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/bindings/errors_test.go
Outdated
return &APIResponse{Response: response} | ||
} | ||
|
||
Describe("when processing SystemPruneReport", func() { |
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 and the Context bit underneath are unnecessary, remove them.
pkg/bindings/errors_test.go
Outdated
@@ -0,0 +1,86 @@ | |||
package bindings |
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 needs to be in the pkg/bindings/test
subdir
Size uint64 `json:"Size"` | ||
} | ||
|
||
type pruneReportHelper struct { |
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.
Why is this necessary?
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.
Since the encoding/json
package doesn't know how to marshal and unmarshal error
types, it translates them into strings
. I'm not sure if a better implementation exists in Go
@@ -0,0 +1,87 @@ | |||
package reports |
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.
Are we actually running unit tests from this directory? I don't see any others in the directory.
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.
I'm not sure if we're running this. Can I remove it, and we just rely on the bindings test instead?
Add custom JSON methods to PruneReport to handle error field marshalling. Fixes: containers#27267 Signed-off-by: Jan Rodák <[email protected]>
6d77200
to
56fee79
Compare
New changes are detected. LGTM label has been removed. |
@mheon I have moved the test into the correct directory and removed the |
Add custom JSON methods to PruneReport to handle error field marshalling.
Fixes: #27267
Does this PR introduce a user-facing change?