Commit 9e0ac5b
authored
refactor(lvm): continue refactoring of lvm command calling convention (#261)
* refactor(ci): rename env variables and update vgcreate command
Env vars LVM_SYSTEMID and LVM_CONFIG are used to describe a potentially
foreign lvm system on the kubernetes host. The lvm system is only meant
to be foreign to the lvm-localpv containers.
Due to the way the ci tests are written, the kubernetes host and the
lvm-localpv conatiners must have identical lvm configurations or ci
tests might fail.
The variables LVM_SYSTEMID and LVM_CONFIG have been renamed to
FOREIGN_LVM_SYSTEMID and FOREIGN_LVM_CONFIG, respectively. This is
helpful when determining their roles at a glance.
A secondary change was made to the foreign pv creation: the lvm option
`--config` has been used in place of `--systemid` to hopefully minimize
unintended side effects of using the same lvm config (with the exception
of the system id) during volume group creation.
Signed-off-by: kro <[email protected]>
* refactor(lvm): update all lvm commands to use split output
The LVM system may sometimes produce non-critical warnings which are
written to STDERR without formatting. Combining STDERR with STDIN may
cause failures when the output is being formatted or otherwise
interpreted.
Following pull #250, it's been requested that all lvm commands be
refactored to use a split output in order to resolve this issue under
non-tested scenarios. See issue #247.
The definition for RunCommandSplit has been moved above all uses of the
function, and any Command using CombinedOutput and an lvm command (s.a.:
lvs, vgs, lvcreate, &c.) has been refactored to instead use
RunCommandSplit to obtain the command's output.
If anything is written to STDERR by the lvm commands, RunCommandSplit
prints the message to the log as a warning.
Signed-off-by: kro <[email protected]>
---------
Signed-off-by: kro <[email protected]>1 parent 9a7388f commit 9e0ac5b
2 files changed
+42
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
264 | 285 | | |
265 | 286 | | |
266 | 287 | | |
| |||
275 | 296 | | |
276 | 297 | | |
277 | 298 | | |
278 | | - | |
279 | | - | |
| 299 | + | |
280 | 300 | | |
281 | 301 | | |
282 | 302 | | |
| |||
314 | 334 | | |
315 | 335 | | |
316 | 336 | | |
317 | | - | |
318 | | - | |
| 337 | + | |
319 | 338 | | |
320 | 339 | | |
321 | 340 | | |
| |||
406 | 425 | | |
407 | 426 | | |
408 | 427 | | |
409 | | - | |
410 | | - | |
| 428 | + | |
411 | 429 | | |
412 | 430 | | |
413 | 431 | | |
| |||
430 | 448 | | |
431 | 449 | | |
432 | 450 | | |
433 | | - | |
434 | | - | |
| 451 | + | |
435 | 452 | | |
436 | 453 | | |
437 | 454 | | |
| |||
495 | 512 | | |
496 | 513 | | |
497 | 514 | | |
498 | | - | |
499 | | - | |
| 515 | + | |
500 | 516 | | |
501 | 517 | | |
502 | 518 | | |
| |||
524 | 540 | | |
525 | 541 | | |
526 | 542 | | |
527 | | - | |
528 | | - | |
| 543 | + | |
529 | 544 | | |
530 | 545 | | |
531 | 546 | | |
| |||
639 | 654 | | |
640 | 655 | | |
641 | 656 | | |
642 | | - | |
643 | | - | |
| 657 | + | |
644 | 658 | | |
645 | 659 | | |
646 | 660 | | |
647 | 661 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | 662 | | |
669 | | - | |
| 663 | + | |
670 | 664 | | |
671 | 665 | | |
672 | 666 | | |
| |||
880 | 874 | | |
881 | 875 | | |
882 | 876 | | |
883 | | - | |
884 | | - | |
| 877 | + | |
885 | 878 | | |
886 | 879 | | |
887 | 880 | | |
888 | 881 | | |
| 882 | + | |
889 | 883 | | |
890 | 884 | | |
891 | 885 | | |
| |||
902 | 896 | | |
903 | 897 | | |
904 | 898 | | |
905 | | - | |
906 | | - | |
| 899 | + | |
907 | 900 | | |
908 | 901 | | |
909 | 902 | | |
910 | 903 | | |
| 904 | + | |
911 | 905 | | |
912 | 906 | | |
913 | 907 | | |
| |||
1029 | 1023 | | |
1030 | 1024 | | |
1031 | 1025 | | |
1032 | | - | |
1033 | | - | |
| 1026 | + | |
1034 | 1027 | | |
1035 | 1028 | | |
1036 | 1029 | | |
1037 | 1030 | | |
| 1031 | + | |
1038 | 1032 | | |
1039 | 1033 | | |
1040 | 1034 | | |
1041 | 1035 | | |
1042 | 1036 | | |
1043 | 1037 | | |
1044 | | - | |
1045 | | - | |
| 1038 | + | |
1046 | 1039 | | |
1047 | 1040 | | |
1048 | 1041 | | |
| |||
1051 | 1044 | | |
1052 | 1045 | | |
1053 | 1046 | | |
1054 | | - | |
1055 | | - | |
| 1047 | + | |
1056 | 1048 | | |
1057 | 1049 | | |
1058 | 1050 | | |
| |||
0 commit comments