From 1b718fd4c20e9ae1bb0aaaf585b3860fc3b614f5 Mon Sep 17 00:00:00 2001 From: Sergey Dudoladov Date: Thu, 26 Apr 2018 13:47:25 +0200 Subject: [PATCH] Minor improvemets in reporting service account creation --- pkg/cluster/cluster.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 478940963..b6251eafc 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -203,12 +203,13 @@ func (c *Cluster) initUsers() error { func (c *Cluster) createPodServiceAccounts() error { podServiceAccountName := c.Config.OpConfig.PodServiceAccountName - c.setProcessName(fmt.Sprintf("creating pod service account in the namespace %v", c.Namespace)) - _, err := c.KubeClient.ServiceAccounts(c.Namespace).Get(podServiceAccountName, metav1.GetOptions{}) if err != nil { - c.logger.Infof("the pod service account %q cannot be retrieved in the namespace %q; stateful sets in the namespace may be unable to create pods. Trying to deploy the account.", podServiceAccountName, c.Namespace) + + c.setProcessName(fmt.Sprintf("creating pod service account in the namespace %v", c.Namespace)) + + c.logger.Infof("the pod service account %q cannot be retrieved in the namespace %q. Trying to deploy the account.", podServiceAccountName, c.Namespace) // get a separate copy of service account // to prevent a race condition when setting a namespace for many clusters