-
Notifications
You must be signed in to change notification settings - Fork 31
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
LVM module #184
Merged
+2,996
−0
Merged
LVM module #184
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
d211570
[WIP] LVM proof-of-concept
avnik 5d4adc7
lvm: stub for new TastStatus interface
avnik 6763f1f
lvm: rename abbreviated LV/PV/VG to full names
avnik 024c3b2
lvm: refactor
avnik 825165e
lvm: add few tests with real data
avnik 7b293e4
lvm: filesystem formatter/mounter
avnik fc1274e
lvm: LV creation
avnik 3dc8b7a
lvm: adapt to new modules registering scheme
avnik 190a5ea
more tests
avnik e4d4cac
lvm: new Check/Apply interface
avnik 96020c5
lvm: Add DI for test {Read,Write}File
avnik 989ca68
lvm: push systemd details into LVM object
avnik 0e55d96
lvm: Add VG highlevel test
avnik 20a5c26
lvm: add basic test for LV and FS
avnik ad1c166
lvm: Add MakeAll to executor
avnik 24cd9fe
lvm: adopt latest interface changes
avnik ef37bb3
lvm: refactor LV module after real-hw testing
avnik f39084b
lvm: workaround for `blkid on device, not created yet`
avnik d2e7ebc
lvm: more workarounds for VG, not created yet
avnik 4931cb9
lvm: avoid removing of unrelated volumes from VG
avnik 8b41ffb
lvm: typo
avnik f9da083
lvm: Vagrantfile and hcl for initial testing
avnik 802b1c9
lvm: assorted fixes
avnik 354bdfb
lvm: fix last failing test
avnik 9d6cae5
lvm: add mockable calls for Getuid and Lookup
avnik 5ff730e
lvm: add test for root and required tools to all modules
avnik 9993990
lvm: unpublish OsExec structure
avnik 3547267
lvm: remove abstraction leaks (-2 fixmes)
avnik 08531f5
lvm/fs: make resourceFS a private structure
avnik 1c2a724
lvm/vg: use EvalSymlinks from standard library
avnik 70d3a2a
lvm: make realLVM private structure, as well as .backend field in it
avnik c6302ec
lvm: attempt to reformat code to make CC happy
avnik ea4701b
lvm: refactor size parsing and LV preparer
avnik 9cd1156
lvm/lowlevel: Reformat tests using t.Run
avnik e5069c6
lvm: more tests for lowlevel.*
avnik e94ada0
lvm/fs: small refactor to reduce lint errors
avnik 93e9825
lvm: silly cc dislike *me receiver which is really abbreviation
avnik eafd054
lvm: re-format more tests, using t.Run()
avnik 1c11423
lvm/testhelpers: comment all function in mock.go
avnik 1cdd2a1
lvm/vg: refactoring, fix CC complains
avnik de52e69
lvm: assorted codeclimate fixups
avnik 9b5b10a
Makefile: add 'make fmt' target
avnik a897927
lvm: parametrize this simple example
avnik f94298d
lvm/vg: Add more tests for VG
avnik ebf44fd
lvm: Add license header
avnik edd1fcc
lvm: more assorted fixes from code review
avnik 0ff6b37
lvm: replace all remaining FIXMEs with NB, and reference to issue
avnik 41108a8
lvm: remove some unused code
avnik d7e7c18
lvm: demote device existence check to low-level
avnik e754c1d
lvm: whitespace in comments
avnik baa0b04
lvm: missing comments for vg_test
avnik 11add34
lvm: fix failing test, and reenable it
avnik 0b57634
lvm/vg: Documet preparer, add `remove` option
avnik dfa61fc
lvm/lv: LV preparer documentation
avnik a8d27b2
lvm/fs: Document preparer
avnik 1377e85
lvm: rename resources to full names
avnik 1c813cf
lvm/vg: More tests
avnik caca3ec
lvm: avoid using braces for variable scoping
avnik acc71b2
lvm: more tests
avnik 0e4665a
lvm: enable documentation
avnik d1e2d57
lvm: update to use new api with context.Context
avnik 7f592d0
lvm: more error wrapping
avnik 23feae8
lvm: fix CC warnings
avnik f2ef449
fix preparers
8a35f18
add preparer tests
19c98dc
mock symlink evaluation
d97a1df
comment test funcs for codeclimate
6c61d44
use nil instead of empty string or 0 for retry
11be508
name context in preparers
59f7bef
prune dead code
564500c
linter fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
mock symlink evaluation
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,10 @@ | |
package testhelpers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing license header |
||
|
||
import ( | ||
"os" | ||
|
||
"github.com/asteris-llc/converge/resource/lvm/lowlevel" | ||
"github.com/stretchr/testify/mock" | ||
"os" | ||
) | ||
|
||
// MockExecutor is a lowlevel.Exec impleentation for faking system interoperation | ||
|
@@ -96,3 +97,8 @@ func (mex *MockExecutor) Exists(path string) (bool, error) { | |
func (mex *MockExecutor) Getuid() int { | ||
return mex.Called().Int(0) | ||
} | ||
|
||
// EvalSymlinks mocks symlink evaluation | ||
func (mex *MockExecutor) EvalSymlinks(s string) (string, error) { | ||
return s, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,6 @@ | |
package vg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing license header |
||
|
||
import ( | ||
"path/filepath" | ||
|
||
"golang.org/x/net/context" | ||
|
||
"github.com/asteris-llc/converge/load/registry" | ||
|
@@ -46,18 +44,7 @@ type Preparer struct { | |
|
||
// Prepare a new task | ||
func (p *Preparer) Prepare(_ context.Context, render resource.Renderer) (resource.Task, error) { | ||
// Device paths need to be real devices, not symlinks | ||
// (otherwise it breaks on GCE) | ||
devices := make([]string, len(p.Devices)) | ||
for i, dev := range p.Devices { | ||
var err error | ||
devices[i], err = filepath.EvalSymlinks(dev) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
rvg := NewResourceVG(lowlevel.MakeLvmBackend(), p.Name, devices, p.Remove, p.ForceRemove) | ||
rvg := NewResourceVG(lowlevel.MakeLvmBackend(), p.Name, p.Devices, p.Remove, p.ForceRemove) | ||
return rvg, nil | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are trying to avoid using log. This will not be displayed to the user, so you should use status or an error. If you do need to log, use debug level. Please fix throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address using log everywhere: if the user needs to see the information, it should be changed to an error or status message. We are trying to avoid using log, but if it should stay as a log, please change it to debug level (instead of info). Please fix in the other locations as well.