(List (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS nounset]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS pipefail]} ) (FunctionDef docker_monitoring [] (While (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "]"]} ) (If (Pipeline! (Com {[LIT_CHARS timeout]} {[LIT_CHARS 10]} {[LIT_CHARS docker]} {[LIT_CHARS ps]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Docker daemon failed!"]]} ) (Com {[LIT_CHARS pkill]} {[LIT_CHARS docker]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 30]} ) ) (ElseTrue) (Com {[LIT_CHARS sleep]} {[DQ [VarSub SLEEP_SECONDS]]} ) ) ) ) (FunctionDef kubelet_monitoring [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Wait for 2 minutes for kubelet to be fuctional"]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 120]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('max_seconds', {[LIT_CHARS 10]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "]"]} ) (If (Pipeline! (Com {[LIT_CHARS curl]} {[LIT_CHARS --insecure]} {[LIT_CHARS -m]} {[DQ [VarSub max_seconds]]} {[LIT_CHARS -f]} {[LIT_CHARS -s]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //127.0.0.1] [LIT_OTHER ":"] [VarSub KUBELET_PORT test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS 10250]}] [LIT_CHARS /healthz]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kubelet is unhealthy!"]]} ) (Com {[LIT_CHARS curl]} {[LIT_CHARS --insecure]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //127.0.0.1] [LIT_OTHER ":"] [VarSub KUBELET_PORT test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS 10250]}] [LIT_CHARS /healthz]} ) (Com {[LIT_CHARS pkill]} {[LIT_CHARS kubelet]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 60]} ) ) (ElseTrue) (Com {[LIT_CHARS sleep]} {[DQ [VarSub SLEEP_SECONDS]]} ) ) ) ) ) (If (DBracket {B2 BINARY_INT_NE {[DQ [VarSub #]]} {[LIT_CHARS 1]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Usage: health-monitor.sh "]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (= scope= flags=0 words=[] bindings=[('KUBE_ENV', {[DQ [LIT_CHARS /home/kubernetes/kube-env]]})]) (If (DBracket {B! {B1 UNARY_FILE_e {[DQ [VarSub KUBE_ENV]]}}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "The "][VarSub KUBE_ENV][LIT_CHARS " file does not exist!! Terminate health monitoring"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (= scope= flags=0 words=[] bindings=[('SLEEP_SECONDS', {[LIT_CHARS 10]})]) (= scope= flags=0 words=[] bindings=[('component', {[VarSub 1]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Start kubernetes health monitoring for "][VarSub component]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ENV]]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub component]]} {[DQ [LIT_CHARS docker]]}}) (Com {[LIT_CHARS docker_monitoring]} ) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub component]]} {[DQ [LIT_CHARS kubelet]]}}) (Com {[LIT_CHARS kubelet_monitoring]} ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Health monitoring for component "]] [VarSub component] [DQ [LIT_CHARS " is not supported!"]]} ) ) )