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 5f269f1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/debug-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,28 @@ jobs:
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
nix-shell shell.nix --run "echo"
# - name: BootStrap k8s cluster
# run: |
# nix-shell shell.nix --run "./scripts/k8s/deployer.sh start --workers 1 --lvm"
# - name: Setup tmate session
# with:
# detached: true
# timeout-minutes: 30
# uses: mxschmitt/action-tmate@v3
# - name: Lvm e2e test
# run: |
# nix-shell shell.nix --run "./scripts/e2e-test.sh --testplan debug-lvm"
- name: BootStrap k8s cluster
run: |
nix-shell shell.nix --run "./scripts/k8s/deployer.sh start --workers 1 --lvm"
nix-shell shell.nix --run "./scripts/k8s/deployer.sh start --workers 1 --zfs"
- name: Setup tmate session
with:
detached: true
timeout-minutes: 30
uses: mxschmitt/action-tmate@v3
- name: Lvm e2e test
- name: Zfs e2e install test
run: |
nix-shell shell.nix --run "./scripts/e2e-test.sh --testplan debug-lvm"
nix-shell shell.nix --run "./scripts/exec-tests.sh --tests install --local true --product openebs --replicated_engine false"
zfs:
needs: ['lint']
runs-on: ubuntu-latest
Expand Down
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

0 comments on commit 5f269f1

Please sign in to comment.