From 0c497e4b654fdcb01f711d9ee5836527e049ae63 Mon Sep 17 00:00:00 2001 From: Ojas M Date: Thu, 7 Feb 2019 10:59:05 -0800 Subject: [PATCH] Move PullFromApis() to the parent command --- cmd/secret.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/secret.go b/cmd/secret.go index 72a2998..bcc1a02 100644 --- a/cmd/secret.go +++ b/cmd/secret.go @@ -17,6 +17,9 @@ var secretCmdCreate = &cobra.Command{ if err != nil { log.Fatalf("Unable to create secrets: %v", err) } + if err = state.PullFromAPIs(); err != nil { + log.Fatalf("unable to sync on-disk state: %v", err) + } log.Println("Secrets created successfully.") }, } @@ -59,10 +62,6 @@ func createSecretDefaults() error { if _, err := state.KubeClient.CoreV1().Secrets(common.DefaultNamespace).Create(newBootstrapTokenSecret); err != nil { return fmt.Errorf("unable to create bootstrap token secret: %v", err) } - if err := state.PullFromAPIs(); err != nil { - return fmt.Errorf("unable to sync on-disk state: %v", err) - } - return nil }