Skip to content

Commit

Permalink
revert: ci to use helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Apr 11, 2024
1 parent 8a29fce commit b197d58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ jobs:
cni: calico
start-args: '--install-addons=false'

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3

- name: Build images locally
run: make lvm-driver-image || exit 1;

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ jobs:
kubernetes-version: ${{ matrix.kubernetes }}
cni: calico
start-args: '--install-addons=false'

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3

- name: Build images locally
run: make lvm-driver-image || exit 1;
Expand Down
34 changes: 17 additions & 17 deletions ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

set -e

LVM_CHART=deploy/helm/charts
LVM_OPERATOR="$(realpath deploy/lvm-operator.yaml)"
SNAP_CLASS="$(realpath deploy/sample/lvmsnapclass.yaml)"
export OPENEBS_NAMESPACE="openebs"
export LVM_NAMESPACE="openebs"

export LVM_NAMESPACE="openebs"
export TEST_DIR="tests"
export NAMESPACE="kube-system"

# allow override
if [ -z "${KUBECONFIG}" ]
Expand Down Expand Up @@ -70,7 +70,7 @@ cleanup() {

kubectl delete pvc -n openebs lvmpv-pvc
kubectl delete -f "${SNAP_CLASS}"
helm uninstall openebs-lvmlocalpv -n "$OPENEBS_NAMESPACE"
kubectl delete -f "${LVM_OPERATOR}"

# always return true
return 0
Expand Down Expand Up @@ -99,29 +99,29 @@ sudo modprobe dm_thin_pool

# Prepare env for running BDD tests
# Minikube is already running
helm install openebs-lvmlocalpv "$LVM_CHART" -n "$OPENEBS_NAMESPACE" --create-namespace --dependency-update --set analytics.enabled=false
kubectl apply -f "${LVM_OPERATOR}"
kubectl apply -f "${SNAP_CLASS}"

dumpAgentLogs() {
NR=$1
AgentPOD=$(kubectl get pods -l app=openebs-lvm-node -o jsonpath='{.items[0].metadata.name}' -n "$OPENEBS_NAMESPACE")
kubectl describe po "$AgentPOD" -n "$OPENEBS_NAMESPACE"
AgentPOD=$(kubectl get pods -l app=openebs-lvm-node -o jsonpath='{.items[0].metadata.name}' -n "$NAMESPACE")
kubectl describe po "$AgentPOD" -n "$NAMESPACE"
printf "\n\n"
kubectl logs --tail="${NR}" "$AgentPOD" -n "$OPENEBS_NAMESPACE" -c openebs-lvm-plugin
kubectl logs --tail="${NR}" "$AgentPOD" -n "$NAMESPACE" -c openebs-lvm-plugin
printf "\n\n"
}

dumpControllerLogs() {
NR=$1
ControllerPOD=$(kubectl get pods -l app=openebs-lvm-controller -o jsonpath='{.items[0].metadata.name}' -n "$OPENEBS_NAMESPACE")
kubectl describe po "$ControllerPOD" -n "$OPENEBS_NAMESPACE"
ControllerPOD=$(kubectl get pods -l app=openebs-lvm-controller -o jsonpath='{.items[0].metadata.name}' -n "$NAMESPACE")
kubectl describe po "$ControllerPOD" -n "$NAMESPACE"
printf "\n\n"
kubectl logs --tail="${NR}" "$ControllerPOD" -n "$OPENEBS_NAMESPACE" -c openebs-lvm-plugin
kubectl logs --tail="${NR}" "$ControllerPOD" -n "$NAMESPACE" -c openebs-lvm-plugin
printf "\n\n"
}

isPodReady(){
[ "$(kubectl get po "$1" -o 'jsonpath={.status.conditions[?(@.type=="Ready")].status}' -n "$OPENEBS_NAMESPACE")" = 'True' ]
[ "$(kubectl get po "$1" -o 'jsonpath={.status.conditions[?(@.type=="Ready")].status}' -n "$NAMESPACE")" = 'True' ]
}

isDriverReady(){
Expand All @@ -136,7 +136,7 @@ waitForLVMDriver() {

i=0
while [ "$i" -le "$period" ]; do
lvmDriver="$(kubectl get pods -l role=openebs-lvm -o 'jsonpath={.items[*].metadata.name}' -n "$OPENEBS_NAMESPACE")"
lvmDriver="$(kubectl get pods -l role=openebs-lvm -o 'jsonpath={.items[*].metadata.name}' -n "$NAMESPACE")"
if isDriverReady "$lvmDriver"; then
return 0
fi
Expand All @@ -155,7 +155,7 @@ waitForLVMDriver

cd $TEST_DIR

kubectl get po -n "$OPENEBS_NAMESPACE"
kubectl get po -n "$NAMESPACE"

set +e

Expand Down Expand Up @@ -186,15 +186,15 @@ echo "get sc details"
kubectl get sc --all-namespaces -oyaml

echo "get lvm volume details"
kubectl get lvmvolumes.local.openebs.io -n "$OPENEBS_NAMESPACE" -oyaml
kubectl get lvmvolumes.local.openebs.io -n openebs -oyaml

echo "get lvm snapshot details"
kubectl get lvmsnapshots.local.openebs.io -n "$OPENEBS_NAMESPACE" -oyaml
kubectl get lvmsnapshots.local.openebs.io -n openebs -oyaml

exit 1
fi

printf "\n\n######### All test cases passed #########\n\n"

# last statement formatted to always return true
[ -z "${CLEANUP}" ] || cleanup 2>/dev/null
[ -z "${CLEANUP}" ] || cleanup 2>/dev/null

0 comments on commit b197d58

Please sign in to comment.