Refactoring inspired by gometalinter. (#357)

Among other things, fix a few issues with deepcopy implementation.
This commit is contained in:
Oleksii Kliukin
2018-08-03 11:09:45 +02:00
committed by GitHub
parent d0f4148cd3
commit ac7b132314
15 changed files with 312 additions and 273 deletions
+2 -2
View File
@@ -151,9 +151,9 @@ func (c *Controller) initPodServiceAccount() {
switch {
case err != nil:
panic(fmt.Errorf("Unable to parse pod service account definiton from the operator config map: %v", err))
panic(fmt.Errorf("Unable to parse pod service account definition from the operator config map: %v", err))
case groupVersionKind.Kind != "ServiceAccount":
panic(fmt.Errorf("pod service account definiton in the operator config map defines another type of resource: %v", groupVersionKind.Kind))
panic(fmt.Errorf("pod service account definition in the operator config map defines another type of resource: %v", groupVersionKind.Kind))
default:
c.PodServiceAccount = obj.(*v1.ServiceAccount)
if c.PodServiceAccount.Name != c.opConfig.PodServiceAccountName {