Turn ServiceAccount into struct value to avoid race conditon during account creation

This commit is contained in:
Sergey Dudoladov
2018-04-20 13:05:05 +02:00
parent a5a65e93f4
commit bd51d2922b
3 changed files with 15 additions and 13 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ func (c *Controller) initPodServiceAccount() {
case groupVersionKind.Kind != "ServiceAccount":
panic(fmt.Errorf("pod service account definiton in the operator config map defines another type of resource: %v", groupVersionKind.Kind))
default:
c.opConfig.PodServiceAccount = obj.(*v1.ServiceAccount)
c.opConfig.PodServiceAccount = *obj.(*v1.ServiceAccount)
// ensure consistent naming of the account
c.opConfig.PodServiceAccount.Name = c.opConfig.PodServiceAccountName
}