mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 05:35:07 +02:00
Avoid syncing when possible (#1274)
Avoid extra syncing in case there are no changes in pooler requirements. Add pooler specific labels to pooler secrets. Add test case to check for pooler secret creation and deletion. Co-authored-by: Rafia Sabih <rafia.sabih@zalando.de>
This commit is contained in:
co-authored by
Rafia Sabih
parent
ff46bb069b
commit
e398cf8c7e
@@ -1561,11 +1561,17 @@ func (c *Cluster) generateSingleUserSecret(namespace string, pgUser spec.PgUser)
|
||||
}
|
||||
|
||||
username := pgUser.Name
|
||||
lbls := c.labelsSet(true)
|
||||
|
||||
if username == constants.ConnectionPoolerUserName {
|
||||
lbls = c.connectionPoolerLabels("", false).MatchLabels
|
||||
}
|
||||
|
||||
secret := v1.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: c.credentialSecretName(username),
|
||||
Namespace: namespace,
|
||||
Labels: c.labelsSet(true),
|
||||
Labels: lbls,
|
||||
Annotations: c.annotationsSet(nil),
|
||||
},
|
||||
Type: v1.SecretTypeOpaque,
|
||||
@@ -1574,6 +1580,7 @@ func (c *Cluster) generateSingleUserSecret(namespace string, pgUser spec.PgUser)
|
||||
"password": []byte(pgUser.Password),
|
||||
},
|
||||
}
|
||||
|
||||
return &secret
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user