Commit Graph

18 Commits

Author SHA1 Message Date
Kir Kolyshkin a4d8f720a2 Format sources with gofumpt
gofumpt is a superset of gofmt, enabling some more code formatting
rules.

This commit is brought to you by

	gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-05-26 16:17:31 -07:00
Daniel J Walsh a3204cf7e8
Move to golang 1.18 and later
Github.com is reporting security issues on older versions of
golang.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-03 15:26:54 -04:00
Miloslav Trmač a1ccc9d862 Use os.WriteFile instead of ioutil.WriteFile
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-09-12 16:31:34 +02:00
Miloslav Trmač 4b28197720 Use os.ReadFile instead of ioutil.ReadFile
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-09-12 16:30:43 +02:00
Alice Frosi a010eb437c fix return error in device mapper
The function readLVMConfig always returns an error.

Signed-off-by: Alice Frosi <afrosi@redhat.com>
2022-07-25 09:51:57 +02:00
Sascha Grunert 42b530b1c3
Fix missing error check in device mapper
We missed that error check during the conversion, which is now fixed.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-21 12:32:42 +02:00
Daniel J Walsh 8e967aa356
Merge pull request #1286 from saschagrunert/error-wrap
Fix wrong error return value
2022-07-13 15:10:55 -04:00
Sascha Grunert 5f2d250aba
Fix wrong error return value
We now pre-check the error before returning it in wrapped state.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-13 13:03:35 +02:00
Daniel J Walsh 3f8c0dc0de
Wrap errors properly with fmt.Errorf
Also returned errors should not begine with a capatalized errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-12 13:26:10 -04:00
Sascha Grunert 3455d12729
Switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of the
deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-07 13:22:46 +02:00
Nalin Dahyabhai 5ef1e9d68b Use json-iterator instead of encoding/json
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-05-06 12:24:24 -04:00
Daniel J Walsh f76d8a7277
Store the pvcreate --metadatasize option in storage.conf
As the number of devices increase the size of the metadata
needs to be modified.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-01 05:27:31 -04:00
Michael McCracken de6e0b0236 devmapper: allow devmapper devices as directlvm device
LVM allows creating a PV on top of an LV, but resolving symlinks
before checking the output of lvmdiskscan erroneously reports that an
LV is not an available device. It will resolve an LV's name into
/dev/dm-NN, which won't show up in lvmdiskscan.

Instead this patch looks for both names in lvmdiskscan.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2020-06-18 09:26:06 -07:00
Nalin Dahyabhai ba598e19f2 Disable cgo-requiring bits when cgo is not enabled
Adjust build tags in drivers and pkg so that builds with CGO_ENABLED=0
won't fail outright.  This ends up disabling btrfs (which uses kernel
headers), ostree (which uses libostree), overlayfs (which uses C headers
to define fs_disk_quota_t), and devicemapper (which uses libdevmapper
and loopback) by default.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-08-05 13:42:50 -04:00
Daniel J Walsh ab043e226b
Evaluate device path for lvm
We have a bug report where a user specified a symbolic link to storage
driver.  The issue is the physical device is not predictable but the link
is, so evaluating sym links makes the symlink path supportable.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-04-15 05:57:51 -04:00
Nalin Dahyabhai a592151822 devicemapper: mention dm.directlvm_device in its error message
Mention the dm.directlvm_device option in the error message that we
return when it isn't set.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-12-06 13:50:38 -05:00
Daniel J Walsh da1e7e5d28 Force the user to specify a device when setting up devicemapper
We do not want to fall back on to loop back devices when setting up
devicemapper. We have decided that this causes too many issues, and
we have an excellent default in Overlay to handle first setup.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-05-18 11:17:05 -04:00
Daniel J Walsh 98c480e157 Backport moby devmapper driver changes to containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-09-26 20:45:15 +00:00