Skip to content

Commit 5fc19c9

Browse files
add comments and formatting to create_builder
1 parent 5202a9b commit 5fc19c9

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

create_builder.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,22 @@ func (c *Client) fetchLifecycle(ctx context.Context, config pubbldr.LifecycleCon
203203
return lifecycle, nil
204204
}
205205

206-
// TODO: Any way to reduce the number of options here?
207206
type DownloadBuildpackOptions struct {
208-
RegistryName string
207+
RegistryName string
208+
209+
// The base directory to use to resolve relative assets
209210
RelativeBaseDir string
210-
ImageOS string
211-
Downloader Downloader
212-
Logger logging.Logger
213-
ImageFetcher ImageFetcher
214-
FetchOptions image.FetchOptions
215-
ImageName string
211+
212+
// The OS of the builder image
213+
ImageOS string
214+
215+
Downloader Downloader
216+
Logger logging.Logger
217+
ImageFetcher ImageFetcher
218+
FetchOptions image.FetchOptions
219+
220+
// Deprecated, the older alternative to buildpack URI
221+
ImageName string
216222
}
217223

218224
func DownloadBuildpack(ctx context.Context, buildpackURI string, opts DownloadBuildpackOptions) (dist.Buildpack, []dist.Buildpack, error) {
@@ -274,7 +280,6 @@ func DownloadBuildpack(ctx context.Context, buildpackURI string, opts DownloadBu
274280
}
275281
default:
276282
return nil, nil, fmt.Errorf("error reading %s: invalid locator: %s", buildpackURI, locatorType)
277-
278283
}
279284
return mainBP, depBPs, nil
280285
}
@@ -297,6 +302,9 @@ func (c *Client) addBuildpacksToBuilder(ctx context.Context, opts CreateBuilderO
297302
FetchOptions: image.FetchOptions{Daemon: !opts.Publish, PullPolicy: opts.PullPolicy},
298303
ImageName: b.ImageName,
299304
})
305+
if err != nil {
306+
return errors.Wrap(err, "downloading buildpack")
307+
}
300308

301309
err = validateBuildpack(mainBP, b.URI, b.ID, b.Version)
302310
if err != nil {

0 commit comments

Comments
 (0)