Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information