dagger list: skip environment if it can't be decryted

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-05-21 16:19:07 -07:00
parent 0acd3a256a
commit 155c90e3e0

View File

@ -9,6 +9,7 @@ import (
"path/filepath" "path/filepath"
"dagger.io/go/dagger/keychain" "dagger.io/go/dagger/keychain"
"github.com/rs/zerolog/log"
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )
@ -109,7 +110,12 @@ func (w *Workspace) List(ctx context.Context) ([]*State, error) {
} }
st, err := w.Get(ctx, f.Name()) st, err := w.Get(ctx, f.Name())
if err != nil { if err != nil {
return nil, err log.
Ctx(ctx).
Err(err).
Str("name", f.Name()).
Msg("failed to load environment")
continue
} }
environments = append(environments, st) environments = append(environments, st)
} }