Ali Dowair
c4d722d2c5
feat(cli): Make format upgrade command idempotent ( #2824 )
...
This commit changes the behavior of the command
`kopia repo upgrade begin...` to not fail (exit code 1) when the repository is already using the latest format version. Instead, a helpful message is output and the program exits with zero code. In effect the command becomes idempotent-successive upgrades would return the same exit code. Such an idempotent api is desirable, especially in cases where we build automation around format upgrades.
Before this change, an error code 1 is returned when upgrading a repository that is already up to date:
```
$ kopia repo status | grep "Format Version"
Format version: 3
$ kopia repo upgrade begin --upgrade-owner-id admin
[1] ERROR error setting the upgrade lock intent: repository is using version 3, and version 3 is the maximum
```
and after this change, a 0 code is returned:
```
$ kopia repo upgrade begin --upgrade-owner-id admin
[0] Repository format is already upto date.
```
2023-03-27 12:37:16 +03:00
..
2023-03-11 06:28:05 -08:00
2022-08-09 06:07:54 +00:00
2023-03-11 06:28:05 -08:00
2022-08-09 06:07:54 +00:00
2021-05-03 10:28:00 -07:00
2021-05-03 10:28:00 -07:00
2021-05-06 20:26:35 -07:00
2021-05-03 10:28:00 -07:00
2022-10-29 01:56:51 +00:00
2022-10-29 01:56:51 +00:00
2022-10-29 01:56:51 +00:00
2022-10-29 01:56:51 +00:00
2022-10-29 01:56:51 +00:00
2022-10-29 01:56:51 +00:00
2022-03-26 14:28:08 +00:00
2022-10-29 01:56:51 +00:00
2021-05-11 22:26:28 -07:00
2021-05-11 22:26:28 -07:00
2022-12-17 16:19:12 +00:00
2021-11-16 06:02:04 -08:00
2022-08-09 06:07:54 +00:00
2021-09-19 18:50:38 -07:00
2021-09-08 18:44:03 -07:00
2022-12-17 16:19:12 +00:00
2022-10-28 11:02:47 -07:00
2021-09-19 18:50:38 -07:00
2022-08-09 06:07:54 +00:00
2022-10-24 19:00:36 -07:00
2022-03-12 23:16:39 -08:00
2022-07-10 13:26:41 -07:00
2022-10-24 19:00:36 -07:00
2021-09-08 18:44:03 -07:00
2022-08-09 06:07:54 +00:00
2022-03-06 14:30:58 -08:00
2022-05-25 14:15:56 +00:00
2021-05-22 05:35:27 -07:00
2023-03-11 06:28:05 -08:00
2022-08-09 06:07:54 +00:00
2022-05-25 14:15:56 +00:00
2022-10-28 11:02:47 -07:00
2021-10-06 08:39:10 -07:00
2022-11-19 18:39:04 +00:00
2021-05-03 10:28:00 -07:00
2022-07-09 18:22:50 -07:00
2022-10-24 19:00:36 -07:00
2021-07-06 21:38:08 -07:00
2021-09-08 18:44:03 -07:00
2022-12-17 16:19:12 +00:00
2021-07-06 21:38:08 -07:00
2022-12-17 16:19:12 +00:00
2022-12-17 16:19:12 +00:00
2021-07-06 21:38:08 -07:00
2021-06-05 08:48:43 -07:00
2022-10-24 19:00:36 -07:00
2023-03-11 06:28:05 -08:00
2022-12-17 16:19:12 +00:00
2022-10-24 19:00:36 -07:00
2021-06-05 08:48:43 -07:00
2022-08-09 06:07:54 +00:00
2021-09-10 17:51:55 -07:00
2022-10-24 19:00:36 -07:00
2022-08-09 06:07:54 +00:00
2022-10-24 19:00:36 -07:00
2021-05-03 10:28:00 -07:00
2021-05-11 22:26:28 -07:00
2021-05-06 20:26:35 -07:00
2021-05-11 22:26:28 -07:00
2021-05-03 10:28:00 -07:00
2022-08-09 06:07:54 +00:00
2022-08-09 06:07:54 +00:00
2021-05-06 20:26:35 -07:00
2022-03-16 00:46:57 -07:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2022-02-22 22:21:48 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2021-11-06 10:06:05 -07:00
2022-10-24 19:00:36 -07:00
2023-03-11 06:28:05 -08:00
2022-10-28 11:02:47 -07:00
2022-10-24 19:00:36 -07:00
2023-03-11 06:28:05 -08:00
2022-03-17 22:22:24 -07:00
2022-05-18 01:27:06 -07:00
2022-07-30 14:13:52 -07:00
2022-09-02 18:55:01 -07:00
2023-03-11 06:28:05 -08:00
2021-05-11 21:53:36 -07:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2021-05-11 21:53:36 -07:00
2023-03-11 06:28:05 -08:00
2022-08-09 06:07:54 +00:00
2023-03-27 12:37:16 +03:00
2022-12-13 09:42:09 -08:00
2023-01-23 12:23:05 +03:00
2023-03-11 06:28:05 -08:00
2022-05-18 01:27:06 -07:00
2022-05-18 01:27:06 -07:00
2022-05-18 01:27:06 -07:00
2023-03-27 12:37:16 +03:00
2023-03-27 12:37:16 +03:00
2022-01-29 09:12:07 -08:00
2022-07-27 16:23:45 -07:00
2022-09-06 04:42:07 +00:00
2022-11-19 18:39:04 +00:00
2022-01-03 18:48:38 -08:00
2022-05-18 01:27:06 -07:00
2022-08-09 06:07:54 +00:00
2022-01-03 18:48:38 -08:00
2022-08-09 06:07:54 +00:00
2022-01-03 18:48:38 -08:00
2022-08-09 06:07:54 +00:00
2022-01-03 18:48:38 -08:00
2023-03-11 06:28:05 -08:00
2023-02-01 22:19:32 -08:00
2022-07-09 18:22:50 -07:00
2022-07-09 18:22:50 -07:00
2022-07-09 18:22:50 -07:00
2022-05-18 01:27:06 -07:00
2023-01-21 07:37:15 -08:00
2023-03-11 06:28:05 -08:00
2021-05-06 20:26:35 -07:00
2021-05-03 10:28:00 -07:00
2021-09-28 15:19:02 -07:00
2023-03-11 06:28:05 -08:00
2023-01-21 16:02:57 +00:00
2022-09-02 10:35:59 -07:00
2021-11-06 10:06:05 -07:00
2022-10-24 19:00:36 -07:00
2022-09-02 10:35:59 -07:00
2022-05-25 01:17:55 +00:00
2022-05-25 14:15:56 +00:00
2022-08-09 06:07:54 +00:00
2023-03-11 06:28:05 -08:00
2022-05-26 05:51:36 +00:00
2022-09-06 04:42:07 +00:00
2022-10-24 19:00:36 -07:00
2023-01-21 07:37:15 -08:00
2022-05-31 13:43:42 -07:00
2022-09-02 10:35:59 -07:00
2021-05-03 10:28:00 -07:00
2022-05-31 13:43:42 -07:00
2022-09-02 10:35:59 -07:00
2022-05-25 01:17:55 +00:00
2023-03-11 06:28:05 -08:00
2021-05-03 10:28:00 -07:00
2021-05-06 20:26:35 -07:00
2021-05-06 20:26:35 -07:00
2021-05-03 10:28:00 -07:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2022-11-10 05:30:06 +00:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2021-11-16 06:02:04 -08:00
2023-03-11 06:28:05 -08:00
2022-10-24 19:00:36 -07:00
2021-09-14 19:11:39 -07:00
2021-03-18 23:03:27 -07:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2021-11-16 06:02:04 -08:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2022-07-30 14:13:52 -07:00
2023-03-11 06:28:05 -08:00
2023-03-11 06:28:05 -08:00
2022-08-09 06:07:54 +00:00