Waiting for statefulset to be gone

Change-Id: I482a14ebf7de178fa8718b1a127f2ae1d065938e
diff --git a/Jenkinsfile-attworkflow-build b/Jenkinsfile-attworkflow-build
index 1401c63..8fe337e 100644
--- a/Jenkinsfile-attworkflow-build
+++ b/Jenkinsfile-attworkflow-build
@@ -50,6 +50,15 @@
                             return kubectl_deleted.toInteger() == 0
                         }
                     }
+                    timeout(5) {
+                        waitUntil {
+                            kubectl_deleted = sh returnStdout: true, script: """
+                            export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
+                            kubectl get statefulset --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet' | wc -l
+                            """
+                            return kubectl_deleted.toInteger() == 0
+                        }
+                    }
                 }
             }
             dir ("helm-charts") {