Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Rashad Sirajudeen <[email protected]>
  • Loading branch information
rashadism committed Apr 22, 2024
1 parent 91d3eda commit 3fe2e35
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/client/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1290,12 +1290,11 @@ func readOnlyVolume(hostPath, targetPath string) string {

func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions) (*build.LifecycleOptions, error) {
var pathsConfig layoutPathConfig
type BuildVars struct {
imageVars := struct {
imageRef name.Reference
imgRegistry string
imageName string
}
buildVars := BuildVars{}
}{}

detectOnly := opts.DetectOnly

Expand All @@ -1304,9 +1303,9 @@ func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions)
if err != nil {
return nil, errors.Wrapf(err, "invalid image name '%s'", opts.Image)
}
buildVars.imgRegistry = imageRef.Context().RegistryStr()
buildVars.imageName = imageRef.Name()
buildVars.imageRef = imageRef
imageVars.imgRegistry = imageRef.Context().RegistryStr()
imageVars.imageName = imageRef.Name()
imageVars.imageRef = imageRef

if opts.Layout() {
pathsConfig, err = c.processLayoutPath(opts.LayoutConfig.InputImage, opts.LayoutConfig.PreviousInputImage)
Expand Down Expand Up @@ -1352,7 +1351,7 @@ func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions)
return nil, errors.Wrapf(err, "invalid builder %s", style.Symbol(opts.Builder))
}

runImageName := c.resolveRunImage(opts.RunImage, buildVars.imgRegistry, builderRef.Context().RegistryStr(), bldr.DefaultRunImage(), opts.AdditionalMirrors, opts.Publish, c.accessChecker)
runImageName := c.resolveRunImage(opts.RunImage, imageVars.imgRegistry, builderRef.Context().RegistryStr(), bldr.DefaultRunImage(), opts.AdditionalMirrors, opts.Publish, c.accessChecker)

fetchOptions := image.FetchOptions{
Daemon: !opts.Publish,
Expand Down Expand Up @@ -1529,7 +1528,7 @@ func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions)

lifecycleOpts := &build.LifecycleOptions{
AppPath: appPath,
Image: buildVars.imageRef,
Image: imageVars.imageRef,
Builder: ephemeralBuilder,
BuilderImage: builderRef.Name(),
LifecycleImage: ephemeralBuilder.Name(),
Expand All @@ -1556,7 +1555,7 @@ func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions)
UID: opts.UserID,
PreviousImage: opts.PreviousImage,
Interactive: opts.Interactive,
Termui: termui.NewTermui(buildVars.imageName, ephemeralBuilder, runImageName),
Termui: termui.NewTermui(imageVars.imageName, ephemeralBuilder, runImageName),
ReportDestinationDir: opts.ReportDestinationDir,
SBOMDestinationDir: opts.SBOMDestinationDir,
CreationTime: opts.CreationTime,
Expand All @@ -1576,5 +1575,4 @@ func (c *Client) ResolveLifecycleOptions(ctx context.Context, opts BuildOptions)
}

return lifecycleOpts, nil

}

0 comments on commit 3fe2e35

Please sign in to comment.