mirror of
https://github.com/mudler/luet.git
synced 2025-08-31 14:52:02 +00:00
Detect if images are available if we don't have to generate a Package
While building, if we aren't doing a clean build, we scan now to see if images are available and we skip, in case we don't find a metadata already.
This commit is contained in:
@@ -507,10 +507,14 @@ func (cs *LuetCompiler) compileWithImage(image, buildertaggedImage, packageImage
|
||||
|
||||
if !cs.Clean {
|
||||
exists := cs.Backend.ImageExists(buildertaggedImage) && cs.Backend.ImageExists(packageImage)
|
||||
if art, err := LoadArtifactFromYaml(p); err == nil && (cs.Options.SkipIfMetadataExists || exists) {
|
||||
Debug("Artifact reloaded. Skipping build")
|
||||
if art, err := LoadArtifactFromYaml(p); err == nil && exists { // If YAML is correctly loaded, and both images exists, no reason to rebuild.
|
||||
Debug("Artifact reloaded from YAML. Skipping build")
|
||||
return art, err
|
||||
}
|
||||
available := cs.Backend.ImageAvailable(buildertaggedImage) && cs.Backend.ImageAvailable(packageImage)
|
||||
if (exists || available) && !generateArtifact {
|
||||
return &PackageArtifact{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
builderOpts, runnerOpts, err := cs.buildPackageImage(image, buildertaggedImage, packageImage, concurrency, keepPermissions, p)
|
||||
|
Reference in New Issue
Block a user