Skip to content
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

[12.0-stable] pkg/pillar: make ioBundleError deepcopy-able #4302

Conversation

christoph-zededa
Copy link
Contributor

error types very often have private members that cannot be marshalled with json.Marshal

we fix this by only storing the error type and the error string (err.Error()) as values in uppercase members of our own ioBundleError type

log output:

json Unmarshal in deepCopy: json: cannot unmarshal object into Go struct field IoBundleError.IoBundleList.Error.Errors of type error

introduced by d1e13b8

Signed-off-by: Christoph Ostarek christoph@zededa.com
(cherry picked from commit 9cc6ca8)

error types very often have private members that cannot be marshalled
with `json.Marshal`

we fix this by only storing the error type and the error string
(err.Error()) as values in uppercase members of our own ioBundleError type

log output:
```
json Unmarshal in deepCopy: json: cannot unmarshal object into Go struct field IoBundleError.IoBundleList.Error.Errors of type error
```

introduced by d1e13b8

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
(cherry picked from commit 9cc6ca8)
@christoph-zededa christoph-zededa added the bug Something isn't working label Sep 27, 2024
Copy link
Member

@OhmSpectator OhmSpectator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, as there are no changes comparing to the original PR.

@OhmSpectator
Copy link
Member

I'm curious: why does Yetus show more errors when we backport PRs into 12.0?.. Have we changed anything in the Yetus config since then?

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OhmSpectator OhmSpectator merged commit e93fdb5 into lf-edge:12.0-stable Sep 27, 2024
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants