replace json.Unmarshal with NewFromJSON in Create#41701
Conversation
There was a problem hiding this comment.
So one difference is that NewFromJSON also propagates the rawJSON field;
Line 239 in ca520bd
At a glance, I don't think it makes a difference for how it's used here (but thought I'd at least leave a comment)
|
Are there anything I can help for this issue? |
|
Is it possible to write a unit test for the edge case this is fixing? 😇 |
|
Thanks for your advice! ping @tianon |
thaJeztah
left a comment
There was a problem hiding this comment.
looks like the linter was failing; could you also squash the commits? I think it's ok to have the test and code changes in a single commit for this PR
Signed-off-by: Jim Lin <[email protected]>
fixes #41683
- What I did
Reuse
NewFromJSONto handle norootfskey situation inimage/store.goto solve the issue in #41683- How I did it
Simply replace the
json.Unmarshalfunction withNewFromJSONinimage/image.go- How to verify it
Running this (mainly modified from #41683) will show
invalid image JSON, no RootFS:- Description for the changelog
Handle an image json that
rootfskey is not present.- A picture of a cute animal (not mandatory but encouraged)
🐕