File tree Expand file tree Collapse file tree 2 files changed +41
-11
lines changed
operator-self-healing-chaos Expand file tree Collapse file tree 2 files changed +41
-11
lines changed Original file line number Diff line number Diff line change @@ -1383,10 +1383,40 @@ deploy_chaos_mesh() {
13831383
13841384 destroy_chaos_mesh
13851385
1386+ local current_runtime=$( kubectl get nodes -o jsonpath=' {range .items[0]}{.status.nodeInfo.containerRuntimeVersion}{"\n"}{end}' | awk -F' :' ' {print $1}' )
1387+
1388+ if [[ $current_runtime == ' containerd' ]]; then
1389+ container_runtime=" containerd"
1390+ socket_path=" /run/containerd/containerd.sock"
1391+ elif [[ $current_runtime == ' docker' ]]; then
1392+ container_runtime=docker
1393+ socket_path=/var/run/docker.sock
1394+ elif [[ $current_runtime == ' cri-o' ]]; then
1395+ container_runtime=crio
1396+ socket_path=/var/run/crio/crio.sock
1397+ else
1398+ echo " Unknown runtime: $current_runtime "
1399+ exit 1
1400+ fi
1401+
13861402 desc ' install chaos-mesh'
13871403 helm repo add chaos-mesh https://charts.chaos-mesh.org
1388- helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${chaos_mesh_ns} --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --set dashboard.create=false --version $CHAOS_MESH_VER
1389- sleep 10
1404+ helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${chaos_mesh_ns} --set chaosDaemon.runtime=$container_runtime --set chaosDaemon.socketPath=$socket_path --set dashboard.create=false --version ${CHAOS_MESH_VER}
1405+ if [ -n " ${OPENSHIFT} " ]; then
1406+ oc adm policy add-scc-to-user privileged -z chaos-daemon --namespace=${chaos_mesh_ns}
1407+ fi
1408+
1409+ retry=0
1410+ until [ " $( kubectl get daemonset chaos-daemon -n ${chaos_mesh_ns} -o jsonpath=' {.status.numberReady}' ) " = " $( kubectl get daemonset chaos-daemon -n ${chaos_mesh_ns} -o jsonpath=' {.status.desiredNumberScheduled}' ) " ]; do
1411+ if [ $retry -ge 30 ]; then
1412+ echo " max retry count $retry reached. something went wrong with chaos-mesh install"
1413+ exit 1
1414+ fi
1415+ echo " Waiting for DaemonSet chaos-daemon..."
1416+ sleep 5
1417+ (( retry += 1 ))
1418+ done
1419+
13901420}
13911421
13921422destroy_chaos_mesh () {
Original file line number Diff line number Diff line change @@ -116,18 +116,18 @@ main() {
116116 desc ' create PXC cluster'
117117 spinup_pxc " $cluster " " $test_dir /conf/$cluster .yml"
118118
119- desc ' kill operator'
120- kill_pod
119+ # desc 'kill operator'
120+ # kill_pod
121121
122- desc ' fail operator pod for 60s'
123- fail_pod
122+ # desc 'fail operator pod for 60s'
123+ # fail_pod
124124
125- desc ' emulate bad network for 60s'
126- network_loss
125+ # desc 'emulate bad network for 60s'
126+ # network_loss
127127
128- destroy_chaos_mesh
129- destroy $namespace
130- desc " test passed"
128+ # destroy_chaos_mesh
129+ # destroy $namespace
130+ # desc "test passed"
131131}
132132
133133main
You can’t perform that action at this time.
0 commit comments