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 19, 2024
1 parent cb496b4 commit 66fde85
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 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 = "/host/host/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 = "/host/host/mnt"
} else {
imgDir = "/tmp"
}
loopDevice := e2e_agent.LoopDevice{
Size: size,
ImgDir: imgDir,
}

zfsNodeConfig = ZfsNodesDevicePoolConfig{
PoolName: poolName,
Expand Down
2 changes: 1 addition & 1 deletion tools/e2e-agent/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# as long as we do not make breaking changes.
set -e
IMAGE="openebs/e2e-agent"
TAG="v3.0.2"
TAG="v3.0.3"
registry=""
tag_as_latest=""

Expand Down
5 changes: 4 additions & 1 deletion tools/e2e-agent/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ func (disk *LoopDevice) createDiskImage() error {
if err != nil {
return fmt.Errorf("error truncating disk image. Error : %v", err)
}

err = f.Close()
if err != nil {
return fmt.Errorf("error closing disk image file %s. Error : %v", disk.ImageName, err)
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion tools/e2e-agent/e2e-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: openebs/e2e-agent:v3.0.2
image: openebs/e2e-agent:v3.0.3
imagePullPolicy: Always
volumeMounts:
- name: host-root
Expand Down

0 comments on commit 66fde85

Please sign in to comment.