feat(oonirun): add support for OONIRun v2 links (#844)

This diff adds support for OONIRun v2 links.

Part of https://github.com/ooni/probe/issues/2184.
This commit is contained in:
Simone Basso
2022-07-08 16:53:59 +02:00
committed by GitHub
parent ebb78c2848
commit 9a0153a349
11 changed files with 644 additions and 22 deletions
+5
View File
@@ -421,6 +421,11 @@ func ooniRunMain(ctx context.Context,
for _, URL := range currentOptions.Inputs {
r := oonirun.NewLinkRunner(cfg, URL)
if err := r.Run(ctx); err != nil {
if errors.Is(err, oonirun.ErrNeedToAcceptChanges) {
logger.Warnf("oonirun: to accept these changes, rerun adding `-y` to the command line")
logger.Warnf("oonirun: we'll show this error every time the upstream link changes")
panic("oonirun: need to accept changes using `-y`")
}
logger.Warnf("oonirun: running link failed: %s", err.Error())
continue
}