@@ -31,11 +31,14 @@ const (
3131	label  =  "dktest" 
3232)
3333
34- func  pullImage (ctx  context.Context , lgr  Logger , dc  client.ImageAPIClient , imgName , platform  string ) error  {
34+ func  pullImage (ctx  context.Context , lgr  Logger , dc  client.ImageAPIClient , registryAuth ,  imgName , platform  string ) error  {
3535	lgr .Log ("Pulling image:" , imgName )
3636	// lgr.Log(dc.ImageList(ctx, types.ImageListOptions{All: true})) 
3737
38- 	resp , err  :=  dc .ImagePull (ctx , imgName , image.PullOptions {Platform : platform })
38+ 	resp , err  :=  dc .ImagePull (ctx , imgName , image.PullOptions {
39+ 		Platform :     platform ,
40+ 		RegistryAuth : registryAuth ,
41+ 	})
3942	if  err  !=  nil  {
4043		return  err 
4144	}
@@ -202,7 +205,7 @@ func RunContext(ctx context.Context, logger Logger, imgName string, opts Options
202205	pullCtx , pullTimeoutCancelFunc  :=  context .WithTimeout (ctx , opts .PullTimeout )
203206	defer  pullTimeoutCancelFunc ()
204207
205- 	if  err  :=  pullImage (pullCtx , logger , dc , imgName , opts .Platform ); err  !=  nil  {
208+ 	if  err  :=  pullImage (pullCtx , logger , dc , opts . PullRegistryAuth ,  imgName , opts .Platform ); err  !=  nil  {
206209		return  fmt .Errorf ("error pulling image: %v error: %w" , imgName , err )
207210	}
208211
0 commit comments