LogStatus logs the current status of the instances
(ctx context.Context)
| 243 | |
| 244 | // LogStatus logs the current status of the instances |
| 245 | func (list *PostgresqlStatusList) LogStatus(ctx context.Context) { |
| 246 | contextLogger := log.FromContext(ctx) |
| 247 | |
| 248 | total := len(list.Items) |
| 249 | for idx, item := range list.Items { |
| 250 | message := fmt.Sprintf("pod status (%d of %d)", idx+1, total) |
| 251 | contextLogger.Info(message, |
| 252 | "name", item.Pod.Name, |
| 253 | "currentLsn", item.CurrentLsn, |
| 254 | "receivedLsn", item.ReceivedLsn, |
| 255 | "replayLsn", item.ReplayLsn, |
| 256 | "isPrimary", item.IsPrimary, |
| 257 | "isPodReady", item.IsPodReady, |
| 258 | "pendingRestart", item.PendingRestart, |
| 259 | "pendingRestartForDecrease", item.PendingRestartForDecrease, |
| 260 | "statusCollectionError", item.Error) |
| 261 | } |
| 262 | |
| 263 | contextLogger.Debug( |
| 264 | `detailed pod status`, |
| 265 | "data", list, |
| 266 | ) |
| 267 | } |
| 268 | |
| 269 | // Len implements sort.Interface extracting the length of the list |
| 270 | func (list *PostgresqlStatusList) Len() int { |
no test coverage detected