Add resize check for XFS formatted FS

Lock out parellel requests against same volumeID
Remove pod after resize and validation in E2E

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2019-12-13 15:59:33 +05:30
committed by mergify[bot]
parent 8e437244de
commit 7c8e66e427
5 changed files with 68 additions and 39 deletions

View File

@ -815,14 +815,13 @@ func cleanupRBDImageMetadataStash(path string) error {
}
// resizeRBDImage resizes the given volume to new size
func resizeRBDImage(ctx context.Context, rbdVol *rbdVolume, cr *util.Credentials) error {
func resizeRBDImage(rbdVol *rbdVolume, newSize int64, cr *util.Credentials) error {
var output []byte
mon := rbdVol.Monitors
image := rbdVol.RbdImageName
volSzMiB := fmt.Sprintf("%dM", rbdVol.VolSize)
volSzMiB := fmt.Sprintf("%dM", newSize)
klog.V(4).Infof(util.Log(ctx, "rbd: resize %s size %s using mon %s, pool %s "), image, volSzMiB, mon, rbdVol.Pool)
args := []string{"resize", image, "--size", volSzMiB, "--pool", rbdVol.Pool, "--id", cr.ID, "-m", mon, "--keyfile=" + cr.KeyFile}
output, err := execCommand("rbd", args)