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

pkg/pillar: make ioBundleError deepcopy-able #4295

Merged

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

@christoph-zededa christoph-zededa added bug Something isn't working stable Should be backported to stable release(s) labels Sep 25, 2024
@christoph-zededa christoph-zededa force-pushed the fix_unmarshable_iobundle_errors branch 2 times, most recently from 59a3cae to 257c12c Compare September 25, 2024 16:11
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.93%. Comparing base (d1e13b8) to head (257c12c).
Report is 50 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4295      +/-   ##
==========================================
- Coverage   21.05%   20.93%   -0.13%     
==========================================
  Files          13       13              
  Lines        2878     2895      +17     
==========================================
  Hits          606      606              
- Misses       2146     2163      +17     
  Partials      126      126              
Flag Coverage Δ
20.93% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Approve to trigger the Eden tests

@christoph-zededa
Copy link
Contributor Author

Eden output:

time="2024-09-25T18:27:14Z" level=fatal msg="Load registry failed failed to load image nginx: unable to copy from nginx to 192.168.100.28:5050/library/nginx:latest: GET https://index.docker.io/v2/library/nginx/manifests/sha256:9f661996f4d1cea788f329b8145660a1124a5a94eec8cea1dba0d564423ad171: TOOMANYREQUESTS: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"

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.

Understandable.

pkg/pillar/types/assignableadapters.go Outdated Show resolved Hide resolved
@christoph-zededa christoph-zededa force-pushed the fix_unmarshable_iobundle_errors branch from 257c12c to 2c497b7 Compare September 26, 2024 12:55
@christoph-zededa christoph-zededa force-pushed the fix_unmarshable_iobundle_errors branch from 2c497b7 to c9d550d Compare September 26, 2024 12:55
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>
@christoph-zededa christoph-zededa force-pushed the fix_unmarshable_iobundle_errors branch from c9d550d to d676103 Compare September 26, 2024 12:57
@OhmSpectator OhmSpectator self-requested a review September 26, 2024 13:36
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.

Run eden again

@eriknordmark eriknordmark merged commit 9cc6ca8 into lf-edge:master Sep 27, 2024
59 of 65 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 stable Should be backported to stable release(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants