Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 7d064b4

Browse files
committed
Fix: load config before init NewConfigLookup
Signed-off-by: Xi <[email protected]>
1 parent 01ff892 commit 7d064b4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docker/project.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import (
1919

2020
// NewProject creates a Project with the specified context.
2121
func NewProject(context *ctx.Context, parseOptions *config.ParseOptions) (project.APIProject, error) {
22+
23+
if err := context.LookupConfig(); err != nil {
24+
logrus.Errorf("Failed to load docker config: %v", err)
25+
}
26+
2227
if context.AuthLookup == nil {
2328
context.AuthLookup = auth.NewConfigLookup(context.ConfigFile)
2429
}
@@ -60,11 +65,6 @@ func NewProject(context *ctx.Context, parseOptions *config.ParseOptions) (projec
6065
return nil, err
6166
}
6267

63-
if err = context.LookupConfig(); err != nil {
64-
logrus.Errorf("Failed to open project %s: %v", p.Name, err)
65-
return nil, err
66-
}
67-
6868
return p, err
6969
}
7070

0 commit comments

Comments
 (0)