mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 04:31:42 +02:00
making pgTeamMap a pointer
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user