@@ -51,15 +51,10 @@ func (b *Builder) build(ctx context.Context, out io.Writer, a *latest.Artifact,
51
51
workspace := a .Workspace
52
52
53
53
// Read `project.toml` if it exists.
54
- var projectDescriptor Descriptor
55
54
path := filepath .Join (a .Workspace , projectTOML )
56
- if _ , err := os .Stat (path ); err == nil {
57
- desc , err := ReadProjectDescriptor (path )
58
- if err != nil {
59
- return "" , fmt .Errorf ("failed to read project descriptor %q: %w" , path , err )
60
- }
61
-
62
- projectDescriptor = desc
55
+ projectDescriptor , err := ReadProjectDescriptor (path )
56
+ if err != nil && ! os .IsNotExist (err ) {
57
+ return "" , fmt .Errorf ("failed to read project descriptor %q: %w" , path , err )
63
58
}
64
59
65
60
// To improve caching, we always build the image with [:latest] tag
@@ -87,7 +82,7 @@ func (b *Builder) build(ctx context.Context, out io.Writer, a *latest.Artifact,
87
82
}
88
83
89
84
// List buildpacks to be used for the build.
90
- // Those specified in the skaffold.yaml override those in the project.toml.
85
+ // Those specified in the skaffold.yaml replace those in the project.toml.
91
86
buildpacks := artifact .Buildpacks
92
87
if len (buildpacks ) == 0 {
93
88
for _ , buildpack := range projectDescriptor .Build .Buildpacks {
0 commit comments