@@ -22,14 +22,16 @@ import (
2222
2323// BaseIso generates the base ISO file for the image.
2424type BaseIso struct {
25- ocRelease ReleasePayload
25+ ocRelease ReleasePayload
26+ osImageStream types.OSImageStream
2627}
2728
2829// NewBaseISOFetcher returns a struct that can be used to fetch a base ISO using
29- // the default method.
30- func NewBaseISOFetcher (ocRelease ReleasePayload ) * BaseIso {
30+ // the default method with the specified OS image stream .
31+ func NewBaseISOFetcher (ocRelease ReleasePayload , osImageStream types. OSImageStream ) * BaseIso {
3132 return & BaseIso {
32- ocRelease : ocRelease ,
33+ ocRelease : ocRelease ,
34+ osImageStream : osImageStream ,
3335 }
3436}
3537
@@ -52,12 +54,12 @@ func (i *BaseIso) GetBaseISOFilename(ctx context.Context, arch string) (baseIsoF
5254}
5355
5456// GetMetalArtifact returns the CoreOS metal artifacts for a given arch
55- // using the embedded stream metadata.
56- func GetMetalArtifact (ctx context.Context , archName string ) (stream.PlatformArtifacts , error ) {
57+ // using the embedded stream metadata with the specified stream .
58+ func GetMetalArtifact (ctx context.Context , archName string , osImageStream types. OSImageStream ) (stream.PlatformArtifacts , error ) {
5759 ctx , cancel := context .WithTimeout (ctx , 30 * time .Second )
5860 defer cancel ()
5961
60- st , err := rhcos .FetchCoreOSBuild (ctx , rhcos . DefaultOSImageStream )
62+ st , err := rhcos .FetchCoreOSBuild (ctx , osImageStream )
6163 if err != nil {
6264 return stream.PlatformArtifacts {}, err
6365 }
@@ -77,7 +79,7 @@ func GetMetalArtifact(ctx context.Context, archName string) (stream.PlatformArti
7779
7880// Download the ISO using the URL in rhcos.json.
7981func (i * BaseIso ) downloadIso (ctx context.Context , archName string ) (string , error ) {
80- metal , err := GetMetalArtifact (ctx , archName )
82+ metal , err := GetMetalArtifact (ctx , archName , i . osImageStream )
8183 if err != nil {
8284 return "" , err
8385 }
@@ -101,14 +103,14 @@ func (i *BaseIso) checkReleasePayloadBaseISOVersion(ctx context.Context, r Relea
101103 logrus .Debugf ("Checking release payload base ISO version" )
102104
103105 // Get current release payload CoreOS version
104- payloadRelease , err := r .GetBaseIsoVersion (archName )
106+ payloadRelease , err := r .GetBaseIsoVersion (archName , i . osImageStream )
105107 if err != nil {
106108 logrus .Warnf ("unable to determine base ISO version: %s" , err .Error ())
107109 return
108110 }
109111
110112 // Get pinned version from installer
111- metal , err := GetMetalArtifact (ctx , archName )
113+ metal , err := GetMetalArtifact (ctx , archName , i . osImageStream )
112114 if err != nil {
113115 logrus .Warnf ("unable to determine base ISO version: %s" , err .Error ())
114116 return
@@ -133,7 +135,7 @@ func (i *BaseIso) retrieveBaseIso(ctx context.Context, archName string) (string,
133135 if err := workflowreport .GetReport (ctx ).SubStage (workflow .StageFetchBaseISOExtract ); err != nil {
134136 return "" , err
135137 }
136- baseIsoFileName , err := i .ocRelease .GetBaseIso (archName )
138+ baseIsoFileName , err := i .ocRelease .GetBaseIso (archName , i . osImageStream )
137139 if err == nil {
138140 if err := workflowreport .GetReport (ctx ).SubStage (workflow .StageFetchBaseISOVerify ); err != nil {
139141 return "" , err
0 commit comments