(ctx context.Context, dr repo.DirectRepository)
| 83 | } |
| 84 | |
| 85 | func (c *commandRepositoryStatus) dumpUpgradeStatus(ctx context.Context, dr repo.DirectRepository) error { |
| 86 | drw, isDr := dr.(repo.DirectRepositoryWriter) |
| 87 | if !isDr { |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | l, err := drw.FormatManager().GetUpgradeLockIntent(ctx) |
| 92 | if err != nil { |
| 93 | return errors.Wrap(err, "failed to get the upgrade lock intent") |
| 94 | } |
| 95 | |
| 96 | if l == nil { |
| 97 | return nil |
| 98 | } |
| 99 | |
| 100 | locked, drainedClients := l.IsLocked(drw.Time()) |
| 101 | upgradeTime := l.UpgradeTime() |
| 102 | |
| 103 | c.out.printStdout("\n") |
| 104 | c.out.printStdout("Ongoing upgrade: %s\n", l.Message) |
| 105 | c.out.printStdout("Upgrade Time: %s\n", upgradeTime.Local()) |
| 106 | c.out.printStdout("Upgrade Owner: %s\n", l.OwnerID) |
| 107 | |
| 108 | if locked { |
| 109 | c.out.printStdout("Upgrade lock: Locked\n") |
| 110 | } else { |
| 111 | c.out.printStdout("Upgrade lock: Unlocked\n") |
| 112 | } |
| 113 | |
| 114 | if drainedClients { |
| 115 | c.out.printStdout("Lock status: Fully Established\n") |
| 116 | } else { |
| 117 | c.out.printStdout("Lock status: Draining\n") |
| 118 | } |
| 119 | |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | func (c *commandRepositoryStatus) dumpRetentionStatus(ctx context.Context, dr repo.DirectRepository) { |
| 124 | if blobcfg, _ := dr.FormatManager().BlobCfgBlob(ctx); blobcfg.IsRetentionEnabled() { |
no test coverage detected