From bcc73dbe1a3391d6969287295bc811c8ac70b1f6 Mon Sep 17 00:00:00 2001 From: Anirudh Date: Tue, 14 Mar 2017 02:39:28 -0700 Subject: [PATCH] Fix StatefulSet apps flakes --- test/e2e/framework/statefulset_utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/statefulset_utils.go b/test/e2e/framework/statefulset_utils.go index 6b4129692f4..120c16111d9 100644 --- a/test/e2e/framework/statefulset_utils.go +++ b/test/e2e/framework/statefulset_utils.go @@ -101,12 +101,14 @@ func (s *StatefulSetTester) CreateStatefulSet(manifestPath, ns string) *apps.Sta return filepath.Join(manifestPath, file) } ss := StatefulSetFromManifest(mkpath("statefulset.yaml"), ns) + svcYaml := generated.ReadOrDie(mkpath("service.yaml")) + ssYaml := generated.ReadOrDie(mkpath("statefulset.yaml")) Logf(fmt.Sprintf("creating " + ss.Name + " service")) - RunKubectlOrDie("create", "-f", mkpath("service.yaml"), fmt.Sprintf("--namespace=%v", ns)) + RunKubectlOrDieInput(string(svcYaml[:]), "create", "-f", "-", fmt.Sprintf("--namespace=%v", ns)) Logf(fmt.Sprintf("creating statefulset %v/%v with %d replicas and selector %+v", ss.Namespace, ss.Name, *(ss.Spec.Replicas), ss.Spec.Selector)) - RunKubectlOrDie("create", "-f", mkpath("statefulset.yaml"), fmt.Sprintf("--namespace=%v", ns)) + RunKubectlOrDieInput(string(ssYaml[:]), "create", "-f", "-", fmt.Sprintf("--namespace=%v", ns)) s.WaitForRunningAndReady(*ss.Spec.Replicas, ss) return ss }