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

Adding new snapshotter interface #1890

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

davidcassany
Copy link
Contributor

This PR defines the snapshotter interface and snapshotter configuration structures. I does not provide any implementation of the interface it just provides all the required pieces to read the snapshotter configuration:

snapshotter:
  type: loopdevice
  max-snaps: 4
  config:
    fs: ext2
    size: 0

Config is defined internally as a interface{} and the format and schema of config depends on the type value. This PR essentially provides the structures definition and the logic to unmarshall config depending on types value.

In a follow up PR I expect to include the loopdevice implementation and its unit tests (but keeping the interface unused still). Finally in third of forth PR I expect to include the full refactor to actually start using the interface in install, reset and upgrade, commands. All this is an effort to make PRs easier to follow and review.

Part of #1874

@davidcassany davidcassany requested a review from a team as a code owner December 18, 2023 18:07
@davidcassany davidcassany force-pushed the snapshotter_interface branch 3 times, most recently from c0de2e4 to 225b21e Compare December 18, 2023 18:46
Signed-off-by: David Cassany <dcassany@suse.com>
@codecov-commenter
Copy link

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (af937bb) 73.61% compared to head (ddbc92c) 73.53%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/types/v1/snapshotter.go 60.37% 14 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1890      +/-   ##
==========================================
- Coverage   73.61%   73.53%   -0.08%     
==========================================
  Files          69       70       +1     
  Lines        7333     7391      +58     
==========================================
+ Hits         5398     5435      +37     
- Misses       1544     1558      +14     
- Partials      391      398       +7     

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

Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/snapshotter/loopdevice.go Show resolved Hide resolved
@davidcassany davidcassany merged commit 0bc93e0 into rancher:main Dec 19, 2023
14 checks passed
@davidcassany davidcassany deleted the snapshotter_interface branch December 19, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants