Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions controllers/postgres_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,15 @@ func (r *PostgresReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
return ctrl.Result{}, err
}

// todo: Check the port. The default port of postgres is used.
// Check if socket port is ready
port :=instance.Status.Socket.Port
if port == 0 {
log.Info("socket port not ready")
return ctrl.Result{Requeue: true}, nil
}

// Update status will be handled by the StatusReconciler, based on the Zalando Status
if err := r.createOrUpdateCWNP(ctx, instance, 5432); err != nil {
if err := r.createOrUpdateCWNP(ctx, instance, int(port)); err != nil {
return ctrl.Result{}, fmt.Errorf("unable to create or update corresponding CRD ClusterwideNetworkPolicy: %W", err)
}

Expand Down