Demote demotes an existing PostgreSQL instance
(ctx context.Context, cluster *apiv1.Cluster)
| 1004 | |
| 1005 | // Demote demotes an existing PostgreSQL instance |
| 1006 | func (instance *Instance) Demote(ctx context.Context, cluster *apiv1.Cluster) error { |
| 1007 | contextLogger := log.FromContext(ctx) |
| 1008 | |
| 1009 | contextLogger.Info("Demoting instance", "pgpdata", instance.PgData) |
| 1010 | slotName := cluster.GetSlotNameFromInstanceName(instance.GetPodName()) |
| 1011 | _, err := UpdateReplicaConfiguration(instance.PgData, instance.GetPrimaryConnInfo(), slotName) |
| 1012 | return err |
| 1013 | } |
| 1014 | |
| 1015 | // WaitForPrimaryAvailable waits until we can connect to the primary |
| 1016 | func (instance *Instance) WaitForPrimaryAvailable(ctx context.Context) error { |
no test coverage detected