Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making pgTeamMap a pointer #1349

Merged
merged 18 commits into from
Feb 16, 2021
Merged

making pgTeamMap a pointer #1349

merged 18 commits into from
Feb 16, 2021

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Feb 5, 2021

when a PostgresTeam map is updated with more teams/users, it's immediately reflected in the controller's pgTeamMap (can be seen from logs). However, initUsers function do not seem to pick them up. Only after the operator is restarted, it seems to work.

Essential change 1: Make cluster's PgTeamMap a pointer:

--- PgTeamMap                    pgteams.PostgresTeamMap
+++ PgTeamMap                    *pgteams.PostgresTeamMap

Essential change 2: Additional teams and members are only fetched if the feature is enabled and the PgTeamMap is not nil

@@ -49,7 +49,7 @@ var (
type Config struct {
OpConfig config.Config
RestConfig *rest.Config
PgTeamMap pgteams.PostgresTeamMap
PgTeamMap *pgteams.PostgresTeamMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we not say that we could just not use this var at all and always just use

cluster: c.opconfig.pgteams?

@FxKu FxKu added the bug label Feb 11, 2021
@FxKu FxKu added this to the 1.7 milestone Feb 11, 2021
@FxKu FxKu self-assigned this Feb 12, 2021
@FxKu
Copy link
Member Author

FxKu commented Feb 12, 2021

👍

@FxKu FxKu added the zalando label Feb 12, 2021
@Jan-M
Copy link
Member

Jan-M commented Feb 16, 2021

👍

@FxKu FxKu merged commit 41858a7 into master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants