Skip to content

Commit

Permalink
revert: CI uses operator yaml (#525)
Browse files Browse the repository at this point in the history
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
  • Loading branch information
niladrih committed Apr 11, 2024
1 parent 1244934 commit ed933c9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 36 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ jobs:
cni: calico
start-args: '--install-addons=false'

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

- name: Setting environment variables
run: |
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ jobs:
cni: calico
start-args: '--install-addons=false'

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

- name: Setting environment variables
run: |
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
Expand Down Expand Up @@ -150,4 +145,4 @@ jobs:
platforms: linux/amd64, linux/arm64
tags: |
openebs/zfs-driver:ci
35 changes: 17 additions & 18 deletions ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,44 @@

set -e

ZFS_CHART=deploy/helm/charts
ZFS_OPERATOR=deploy/zfs-operator.yaml
SNAP_CLASS=deploy/sample/zfssnapclass.yaml
export OPENEBS_NAMESPACE="openebs"

TEST_DIR="tests"


# Prepare env for runnging BDD tests
# Minikube is already running
helm install openebs-zfslocalpv "$ZFS_CHART" -n "$OPENEBS_NAMESPACE" --create-namespace --dependency-update --set analytics.enabled=false
kubectl apply -f "$SNAP_CLASS"
kubectl apply -f $ZFS_OPERATOR
kubectl apply -f $SNAP_CLASS

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

dumpControllerLogs() {
NR=$1
ControllerPOD=$(kubectl get pods -l app=openebs-zfs-controller -o jsonpath='{.items[0].metadata.name}' -n "$OPENEBS_NAMESPACE")
kubectl describe po "$ControllerPOD" -n "$OPENEBS_NAMESPACE"
ControllerPOD=$(kubectl get pods -l app=openebs-zfs-controller -o jsonpath='{.items[0].metadata.name}' -n kube-system)
kubectl describe po $ControllerPOD -n kube-system
printf "\n\n"
kubectl logs --tail="${NR}" "$ControllerPOD" -n "$OPENEBS_NAMESPACE" -c openebs-zfs-plugin
kubectl logs --tail=${NR} $ControllerPOD -n kube-system -c openebs-zfs-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 kube-system)" = 'True' ]
}


isDriverReady(){
for pod in $zfsDriver;do
isPodReady "$pod" || return 1
isPodReady $pod || return 1
done
}

Expand All @@ -64,8 +63,8 @@ waitForZFSDriver() {

i=0
while [ "$i" -le "$period" ]; do
zfsDriver="$(kubectl get pods -l role=openebs-zfs -o 'jsonpath={.items[*].metadata.name}' -n $OPENEBS_NAMESPACE)"
if isDriverReady "$zfsDriver"; then
zfsDriver="$(kubectl get pods -l role=openebs-zfs -o 'jsonpath={.items[*].metadata.name}' -n kube-system)"
if isDriverReady $zfsDriver; then
return 0
fi

Expand All @@ -83,7 +82,7 @@ waitForZFSDriver

cd $TEST_DIR

kubectl get po -n "$OPENEBS_NAMESPACE"
kubectl get po -n kube-system

set +e

Expand Down Expand Up @@ -116,12 +115,12 @@ echo "get sc details"
kubectl get sc --all-namespaces -oyaml

echo "get zfs volume details"
kubectl get zfsvolumes.zfs.openebs.io -n "$OPENEBS_NAMESPACE" -oyaml
kubectl get zfsvolumes.zfs.openebs.io -n openebs -oyaml

echo "get zfs snapshot details"
kubectl get zfssnapshots.zfs.openebs.io -n "$OPENEBS_NAMESPACE" -oyaml
kubectl get zfssnapshots.zfs.openebs.io -n openebs -oyaml

exit 1
fi

printf "\n\n######### All test cases passed #########\n\n"
echo "\n\n######### All test cases passed #########\n\n"
14 changes: 7 additions & 7 deletions ci/sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ test_repo="kubernetes-csi"

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

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

Expand Down Expand Up @@ -66,7 +66,7 @@ EOT
make clean
make

UUID=$(kubectl get pod -n openebs -l "openebs.io/component-name=openebs-zfs-controller" -o 'jsonpath={.items[0].metadata.uid}')
UUID=$(kubectl get pod -n kube-system -l "openebs.io/component-name=openebs-zfs-controller" -o 'jsonpath={.items[0].metadata.uid}')
SOCK_PATH=/var/lib/kubelet/pods/"$UUID"/volumes/kubernetes.io~empty-dir/socket-dir/csi.sock

sudo chmod -R 777 /var/lib/kubelet
Expand Down

0 comments on commit ed933c9

Please sign in to comment.