|
8 | 8 | "bytes"
|
9 | 9 | "context"
|
10 | 10 | "fmt"
|
| 11 | + log "github.com/sirupsen/logrus" |
11 | 12 | "io"
|
12 | 13 | "net"
|
13 | 14 | "net/url"
|
@@ -60,6 +61,8 @@ func (r *Reconciler) generatePostgresUserSecret(
|
60 | 61 | intent.SetGroupVersionKind(corev1.SchemeGroupVersion.WithKind("Secret"))
|
61 | 62 | initialize.Map(&intent.Data)
|
62 | 63 |
|
| 64 | + log.Info("User existing secret:", "secret", existing) |
| 65 | + |
63 | 66 | // Populate the Secret with libpq keywords for connecting through
|
64 | 67 | // the primary Service.
|
65 | 68 | // - https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
|
@@ -583,17 +586,15 @@ func (r *Reconciler) reconcilePostgresUserSecrets(
|
583 | 586 |
|
584 | 587 | if err == nil {
|
585 | 588 | userSecrets[userName], err = r.generatePostgresUserSecret(cluster, user, secret)
|
586 |
| - } |
587 |
| - if err == nil { |
588 | 589 | err = errors.WithStack(r.apply(ctx, userSecrets[userName]))
|
589 | 590 | }
|
590 | 591 | }
|
591 | 592 |
|
592 | 593 | return specUsers, userSecrets, err
|
593 | 594 | }
|
594 | 595 |
|
595 |
| -// updateCustomSecretLabels checks if a custom secret exists and updates it |
596 |
| -// with required labels if they are missing that enabled the |
| 596 | +// updateCustomSecretLabels checks if a custom secret exists - can be created manually through kubectl apply |
| 597 | +// and updates it with required labels if they are missing that enabled the |
597 | 598 | // naming.AsSelector(naming.ClusterPostgresUsers(cluster.Name)) to identify them.
|
598 | 599 | func (r *Reconciler) updateCustomSecretLabels(
|
599 | 600 | ctx context.Context, cluster *v1beta1.PostgresCluster, user v1beta1.PostgresUserSpec,
|
|
0 commit comments