Skip to content

Commit

Permalink
base image is now derived from the 'resolved' field like other files
Browse files Browse the repository at this point in the history
  • Loading branch information
djcass44 committed Oct 29, 2023
1 parent 8335263 commit 9a8e4f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,17 @@ func build(cmd *cobra.Command, _ []string) error {
return err
}

baseImage := airutil.ExpandEnv(cfg.Spec.From)
baseImage := airutil.ExpandEnv(lockFile.Packages[""].Resolved)
switch baseImage {
case containerutil.MagicImageScratch:
case "":
log.Info("using scratch base as nothing was provided")
baseImage = containerutil.MagicImageScratch
default:
baseImage = baseImage + "@" + lockFile.Packages[""].Integrity
// if we have nothing, use the "FROM" value
if baseImage == "" {
baseImage = airutil.ExpandEnv(cfg.Spec.From)
}
}

// pull the base image
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/ulikunitz/xz v0.5.11
gitlab.alpinelinux.org/alpine/go v0.8.0
go.uber.org/zap v1.26.0
k8s.io/apimachinery v0.28.2
pault.ag/go/debian v0.15.0
Expand Down Expand Up @@ -99,7 +100,6 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
gitlab.alpinelinux.org/alpine/go v0.8.0 // indirect
gitlab.com/av1o/cap10 v0.4.0 // indirect
go.lsp.dev/uri v0.3.0 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down

0 comments on commit 9a8e4f1

Please sign in to comment.