Skip to content

Commit 47aace7

Browse files
committed
Feedback
Signed-off-by: David Gageot <[email protected]>
1 parent 3604f0c commit 47aace7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/skaffold/build/buildpacks/lifecycle.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,10 @@ func (b *Builder) build(ctx context.Context, out io.Writer, a *latest.Artifact,
5151
workspace := a.Workspace
5252

5353
// Read `project.toml` if it exists.
54-
var projectDescriptor Descriptor
5554
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)
6358
}
6459

6560
// 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,
8782
}
8883

8984
// 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.
9186
buildpacks := artifact.Buildpacks
9287
if len(buildpacks) == 0 {
9388
for _, buildpack := range projectDescriptor.Build.Buildpacks {

0 commit comments

Comments
 (0)