making pgTeamMap a pointer

This commit is contained in:
Felix Kunde
2021-02-04 16:50:21 +01:00
parent 2c3cd3ae02
commit 9e2cea54ab
5 changed files with 14 additions and 5 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ import (
type Controller struct {
config spec.ControllerConfig
opConfig *config.Config
pgTeamMap teams.PostgresTeamMap
pgTeamMap *teams.PostgresTeamMap
logger *logrus.Entry
KubeClient k8sutil.KubernetesClient
@@ -332,7 +332,7 @@ func (c *Controller) initController() {
if c.opConfig.EnablePostgresTeamCRD {
c.loadPostgresTeams()
} else {
c.pgTeamMap = teams.PostgresTeamMap{}
c.pgTeamMap = new(teams.PostgresTeamMap)
}
if c.opConfig.DebugLogging {
+1 -1
View File
@@ -396,7 +396,7 @@ func (c *Controller) getInfrastructureRole(
func (c *Controller) loadPostgresTeams() {
// reset team map
c.pgTeamMap = teams.PostgresTeamMap{}
c.pgTeamMap = new(teams.PostgresTeamMap)
pgTeams, err := c.KubeClient.PostgresTeamsGetter.PostgresTeams(c.opConfig.WatchedNamespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {