Skip to content

Commit

Permalink
fix: pick correctly base installer image layers
Browse files Browse the repository at this point in the history
Only Talos 1.5+ provides proper optimized image,
Talos 1.4 provided a single-layer image (which worked in this case),
while Talos 1.2-1.3 have multi-layered images which can't be replaced
easily.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Dec 22, 2023
1 parent 0a30ef7 commit 8db3c5b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/imager/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,14 @@ func (i *Imager) outInstaller(ctx context.Context, path string, report *reporter
return fmt.Errorf("failed to set created at: %w", err)
}

newInstallerImg, err = mutate.AppendLayers(newInstallerImg, baseLayers[0])
// Talos v1.5+ optimizes the install layers to be easily replaceable with new artifacts
// other Talos versions will have an overhead of artifacts being stored twice
if len(baseLayers) == 2 {
// optimized for installer image for artifacts replacements
baseLayers = baseLayers[:1]
}

newInstallerImg, err = mutate.AppendLayers(newInstallerImg, baseLayers...)
if err != nil {
return fmt.Errorf("failed to append layers: %w", err)
}
Expand Down

0 comments on commit 8db3c5b

Please sign in to comment.