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

fix: always use container interface #1516

Merged
merged 3 commits into from
Apr 12, 2023
Merged

fix: always use container interface #1516

merged 3 commits into from
Apr 12, 2023

Conversation

piksel
Copy link
Member

@piksel piksel commented Dec 31, 2022

This PR replaces all "public" usage of container.Container (the impl struct) with types.Container (the interface). It also renames the Container.hostConfig() and Container.runtimeConfig() to GetCreateHostConfig() and GetCreateConfig respectively, to more clearly express what they are used for.

While working on fixing the tests/API changes for #1468, I noticed how hard it was to work with the container.Container, since it was sometimes passed as an interface, and sometimes the raw struct.
This made creating sensible new APIs really hard and is the one of the main reasons for a lot of the problems with testing using Containers.

Since this was a fairly large change, I moved these changes to a new branch.

@piksel piksel requested a review from simskij as a code owner December 31, 2022 12:43
@codecov
Copy link

codecov bot commented Dec 31, 2022

Codecov Report

Patch coverage: 45.45% and project coverage change: -0.24 ⚠️

Comparison is base (25fdb40) 66.98% compared to head (801b8f1) 66.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1516      +/-   ##
==========================================
- Coverage   66.98%   66.75%   -0.24%     
==========================================
  Files          25       25              
  Lines        2311     2319       +8     
==========================================
  Hits         1548     1548              
- Misses        667      675       +8     
  Partials       96       96              
Impacted Files Coverage Δ
pkg/container/container.go 53.12% <0.00%> (-2.31%) ⬇️
pkg/container/client.go 41.29% <40.00%> (ø)
internal/actions/update.go 70.37% <84.61%> (ø)
internal/actions/check.go 37.50% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@piksel piksel merged commit dd1ec09 into main Apr 12, 2023
@piksel piksel deleted the fix/container-interface branch April 12, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant