Skip to content

Commit

Permalink
create file over mounted path for github action kind cluster
Browse files Browse the repository at this point in the history
Signed-off-by: rohan2794 <[email protected]>
  • Loading branch information
rohan2794 committed Sep 17, 2024
1 parent cb496b4 commit f503019
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
19 changes: 15 additions & 4 deletions common/lvm/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package lvm

import (
"fmt"
"strings"

"github.com/openebs/openebs-e2e/common"
"github.com/openebs/openebs-e2e/common/e2e_agent"
Expand Down Expand Up @@ -132,14 +133,24 @@ func (lvmNodesDevicePvVgConfig *LvmNodesDevicePvVgConfig) ConfigureLvmNodesWithD

func SetupLvmNodes(vgName string, size int64) (LvmNodesDevicePvVgConfig, error) {
var lvmNodeConfig LvmNodesDevicePvVgConfig
loopDevice := e2e_agent.LoopDevice{
Size: size,
ImgDir: "/tmp",
}
workerNodes, err := ListLvmNode(common.NSOpenEBS())
if err != nil {
return lvmNodeConfig, fmt.Errorf("failed to list lvm worker nodes, error: %v", err)
}
if len(workerNodes) == 0 {
return lvmNodeConfig, fmt.Errorf("lvm worker nodes not found")
}
var imgDir string
if strings.Contains(workerNodes[0], "kind-") {
imgDir = "/mnt"
} else {
imgDir = "/tmp"
}

loopDevice := e2e_agent.LoopDevice{
Size: size,
ImgDir: imgDir,
}

lvmNodeConfig = LvmNodesDevicePvVgConfig{
VgName: vgName,
Expand Down
18 changes: 14 additions & 4 deletions common/zfs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package zfs

import (
"fmt"
"strings"

"github.com/openebs/openebs-e2e/common"
"github.com/openebs/openebs-e2e/common/e2e_agent"
Expand Down Expand Up @@ -103,14 +104,23 @@ func (zfsDevicePoolConfig *ZfsNodesDevicePoolConfig) ConfigureZfsNodesWithDevice

func SetupZfsNodes(poolName string, size int64) (ZfsNodesDevicePoolConfig, error) {
var zfsNodeConfig ZfsNodesDevicePoolConfig
loopDevice := e2e_agent.LoopDevice{
Size: size,
ImgDir: "/tmp",
}
workerNodes, err := ListZfsNode(common.NSOpenEBS())
if err != nil {
return zfsNodeConfig, fmt.Errorf("failed to list zfs worker nodes, error: %v", err)
}
if len(workerNodes) == 0 {
return zfsNodeConfig, fmt.Errorf("zfs worker nodes not found")
}
var imgDir string
if strings.Contains(workerNodes[0], "kind-") {
imgDir = "/mnt"
} else {
imgDir = "/tmp"
}
loopDevice := e2e_agent.LoopDevice{
Size: size,
ImgDir: imgDir,
}

zfsNodeConfig = ZfsNodesDevicePoolConfig{
PoolName: poolName,
Expand Down

0 comments on commit f503019

Please sign in to comment.