@@ -142,7 +142,7 @@ func (m *Manager) fetchImageByDigest(digestRef name.Digest, architecture Arch, i
142142func (m * Manager ) fetchImager (tag string ) error {
143143 destinationPath := filepath .Join (m .storagePath , tag )
144144
145- if err := m .fetchImageByTag (ImagerImage , tag , ArchAmd64 , imageExportHandler (func (logger * zap.Logger , r io.Reader ) error {
145+ if err := m .fetchImageByTag (m . options . ImagerImage , tag , ArchAmd64 , imageExportHandler (func (logger * zap.Logger , r io.Reader ) error {
146146 return untarWithPrefix (logger , r , usrInstallPrefix , destinationPath + tmpSuffix )
147147 })); err != nil {
148148 return err
@@ -188,15 +188,18 @@ func (m *Manager) fetchOverlayImage(arch Arch, ref OverlayRef, destPath string)
188188 return os .Rename (destPath + tmpSuffix , destPath )
189189}
190190
191- // fetchInstallerImage fetches a Talos installer image and exports it to the storage.
192- func (m * Manager ) fetchInstallerImage (arch Arch , versionTag string , destPath string ) error {
193- installerImage := InstallerImage
194-
191+ // InstallerImageName returns an installer image name based on Talos version.
192+ func (m * Manager ) InstallerImageName (versionTag string ) string {
195193 if quirks .New (versionTag ).SupportsUnifiedInstaller () {
196- installerImage = InstallerBaseImage
194+ return m . options . InstallerBaseImage
197195 }
198196
199- if err := m .fetchImageByTag (installerImage , versionTag , arch , imageOCIHandler (destPath + tmpSuffix )); err != nil {
197+ return m .options .InstallerImage
198+ }
199+
200+ // fetchInstallerImage fetches a Talos installer image and exports it to the storage.
201+ func (m * Manager ) fetchInstallerImage (arch Arch , versionTag string , destPath string ) error {
202+ if err := m .fetchImageByTag (m .InstallerImageName (versionTag ), versionTag , arch , imageOCIHandler (destPath + tmpSuffix )); err != nil {
200203 return err
201204 }
202205
@@ -205,9 +208,7 @@ func (m *Manager) fetchInstallerImage(arch Arch, versionTag string, destPath str
205208
206209// fetchTalosctlImage fetches a Talosctl image and exports it to the storage.
207210func (m * Manager ) fetchTalosctlImage (versionTag string , destPath string ) error {
208- talosctlImage := TalosctlImage
209-
210- if err := m .fetchImageByTag (talosctlImage , versionTag , ArchAmd64 , imageExportHandler (func (logger * zap.Logger , r io.Reader ) error {
211+ if err := m .fetchImageByTag (m .options .TalosctlImage , versionTag , ArchAmd64 , imageExportHandler (func (logger * zap.Logger , r io.Reader ) error {
211212 return untarWithPrefix (logger , r , "" , destPath + tmpSuffix )
212213 })); err != nil {
213214 return err
0 commit comments