Commit e927123
authored
fix(lvm): change calling operation to avoid garbage in json object (#250)
* fix(lvm): change calling operation to avoid garbage in json object
Drop the STDERR stream contents from `output` to avoid JSON mangling.
The `vgs` command may print non-critical warnings to STDERR. Warnings
may not necessarily result in a failure return code, which allows the
program to continue with marshalling the JSON-formatted output.
Combining this stream with STDIN will cause the next step at
`decodeVgsJSON()` to fail due to garbage mixed in the JSON.
Fixes #247
Signed-off-by: Kara <[email protected]>
* fix(lvm): add PR changelog - suppress STDERR when calling vgs
Add PR changelog
Signed-off-by: Kara <[email protected]>
* refactor(lvm): refactor exec to separate function, add log verbosity
Move exec code into separate function which returns STDOUT and STDERR
streams separately. This is to facilitate future occurences of that same
pattern within lvm_util.go . Additionally, add log messages to assist with
debugging lvm and json.
Signed-off-by: Kara <[email protected]>
* feat(ci): integrate test to simulate foreign lvm systemid
This test aims to determine whether lvm-driver is capable of operating
with a volume group whose systemid is foreign to the kubernetes host
system.
The test ensures the program in pkg/lvm/lvm_utils.go is capable of
operating in a foreign lvm environment. This is important when the
kubernetes host system has a different lvm configuration than the
lvm-driver container. Differences in configuration may cause unforseen
consequences when the host machine provisions a volume group which is to
be consumed by the lvm-driver container.
Additionally, this feature includes teardown code in the form of the
cleanup functions which aims to aid with cleaning up ci resources in a
local development environment. To make the cleanup actions compatible
with the original operation of the ci-test.sh script, the feature is
only enabled through the use of environment variables.
While this commit fixes issue #249, it's intent was as an integration
test for issue #247.
Fixes #249
Signed-off-by: Kara <[email protected]>
* feat(ci): clean up volume groups when applicable
To avoid volume group caching, explicitly remove volume groups (and
their pvs) before removing the disk and loopback device.
Signed-off-by: Kara <[email protected]>
* fix(ci): use -n instead of ! -z, change last statement to return true
Fix linter errors: use -n instead of ! -z in test statements. Last
statement in file is used as the return code of the file, so it must
return true; change `[ ! -z ... ] && ...` into `[ -z ... ] || ...` to
achieve this.
Signed-off-by: kro <[email protected]>
---------
Signed-off-by: Kara <[email protected]>
Signed-off-by: kro <[email protected]>1 parent a8e8909 commit e927123
File tree
3 files changed
+114
-20
lines changed- changelogs/unreleased
- ci
- pkg/lvm
3 files changed
+114
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
19 | 82 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
24 | 95 | | |
25 | 96 | | |
26 | 97 | | |
27 | 98 | | |
28 | 99 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 100 | | |
39 | 101 | | |
40 | | - | |
41 | | - | |
| 102 | + | |
| 103 | + | |
42 | 104 | | |
43 | 105 | | |
44 | 106 | | |
| |||
99 | 161 | | |
100 | 162 | | |
101 | 163 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 164 | + | |
105 | 165 | | |
106 | 166 | | |
107 | 167 | | |
| |||
135 | 195 | | |
136 | 196 | | |
137 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
| 554 | + | |
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
| |||
646 | 648 | | |
647 | 649 | | |
648 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
649 | 672 | | |
650 | 673 | | |
651 | 674 | | |
| |||
662 | 685 | | |
663 | 686 | | |
664 | 687 | | |
665 | | - | |
666 | | - | |
| 688 | + | |
667 | 689 | | |
668 | 690 | | |
669 | 691 | | |
670 | 692 | | |
| 693 | + | |
671 | 694 | | |
672 | 695 | | |
673 | 696 | | |
| |||
0 commit comments