fix envvar handling

This commit is contained in:
vyzo
2022-05-17 21:14:49 +03:00
parent daf452a180
commit d949b6c8ef
4 changed files with 9 additions and 15 deletions
+3 -6
View File
@@ -68,14 +68,11 @@ func LoadBuiltinActors(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRe
}
// we haven't recorded it in the datastore, so we need to load it
envvar := fmt.Sprintf("LOGUS_BUILTIN_ACTORS_V%d_BUNDLE", av)
var mfCid cid.Cid
switch {
case bd.EnvVar != "":
// this is a local bundle, specified by an env var to load from the filesystem
path := os.Getenv(bd.EnvVar)
if path == "" {
return result, xerrors.Errorf("bundle envvar is empty: %s", bd.EnvVar)
}
case os.Getenv(envvar) != "":
path := os.Getenv(envvar)
mfCid, err = bundle.LoadBundle(ctx, bs, path, av)
if err != nil {