mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
repair packs: Add stub feature flag implementation
This commit is contained in:
parent
a28940ea29
commit
d1d4510974
@ -349,7 +349,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
|
|||||||
for _, id := range salvagePacks {
|
for _, id := range salvagePacks {
|
||||||
strIds = append(strIds, id.String())
|
strIds = append(strIds, id.String())
|
||||||
}
|
}
|
||||||
Warnf("restic repair packs %v\nrestic repair snapshots --forget\n\n", strings.Join(strIds, " "))
|
Warnf("RESTIC_FEATURES=repair-packs-v1 restic repair packs %v\nrestic repair snapshots --forget\n\n", strings.Join(strIds, " "))
|
||||||
Warnf("Corrupted blobs are either caused by hardware problems or bugs in restic. Please open an issue at https://github.com/restic/restic/issues/new/choose for further troubleshooting!\n")
|
Warnf("Corrupted blobs are either caused by hardware problems or bugs in restic. Please open an issue at https://github.com/restic/restic/issues/new/choose for further troubleshooting!\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,9 +36,14 @@ func init() {
|
|||||||
cmdRepair.AddCommand(cmdRepairPacks)
|
cmdRepair.AddCommand(cmdRepairPacks)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME feature flag
|
|
||||||
|
|
||||||
func runRepairPacks(ctx context.Context, gopts GlobalOptions, args []string) error {
|
func runRepairPacks(ctx context.Context, gopts GlobalOptions, args []string) error {
|
||||||
|
// FIXME discuss and add proper feature flag mechanism
|
||||||
|
flag, _ := os.LookupEnv("RESTIC_FEATURES")
|
||||||
|
if flag != "repair-packs-v1" {
|
||||||
|
return errors.Fatal("This command is experimental and may change/be removed without notice between restic versions. " +
|
||||||
|
"Set the environment variable 'RESTIC_FEATURES=repair-packs-v1' to enable it.")
|
||||||
|
}
|
||||||
|
|
||||||
ids := restic.NewIDSet()
|
ids := restic.NewIDSet()
|
||||||
for _, arg := range args {
|
for _, arg := range args {
|
||||||
id, err := restic.ParseID(arg)
|
id, err := restic.ParseID(arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user