File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -420,8 +420,9 @@ func (rc *RunContext) startContainer() common.Executor {
420
420
}
421
421
422
422
func (rc * RunContext ) IsHostEnv (ctx context.Context ) bool {
423
- image := rc .platformImage (ctx )
424
- return strings .EqualFold (image , "-self-hosted" )
423
+ platform := rc .runsOnImage (ctx )
424
+ image := rc .containerImage (ctx )
425
+ return image == "" && strings .EqualFold (platform , "-self-hosted" )
425
426
}
426
427
427
428
func (rc * RunContext ) stopContainer () common.Executor {
@@ -474,14 +475,20 @@ func (rc *RunContext) Executor() common.Executor {
474
475
}
475
476
}
476
477
477
- func (rc * RunContext ) platformImage (ctx context.Context ) string {
478
+ func (rc * RunContext ) containerImage (ctx context.Context ) string {
478
479
job := rc .Run .Job ()
479
480
480
481
c := job .Container ()
481
482
if c != nil {
482
483
return rc .ExprEval .Interpolate (ctx , c .Image )
483
484
}
484
485
486
+ return ""
487
+ }
488
+
489
+ func (rc * RunContext ) runsOnImage (ctx context.Context ) string {
490
+ job := rc .Run .Job ()
491
+
485
492
if job .RunsOn () == nil {
486
493
common .Logger (ctx ).Errorf ("'runs-on' key not defined in %s" , rc .String ())
487
494
}
@@ -497,6 +504,14 @@ func (rc *RunContext) platformImage(ctx context.Context) string {
497
504
return ""
498
505
}
499
506
507
+ func (rc * RunContext ) platformImage (ctx context.Context ) string {
508
+ if containerImage := rc .containerImage (ctx ); containerImage != "" {
509
+ return containerImage
510
+ }
511
+
512
+ return rc .runsOnImage (ctx )
513
+ }
514
+
500
515
func (rc * RunContext ) options (ctx context.Context ) string {
501
516
job := rc .Run .Job ()
502
517
c := job .Container ()
You can’t perform that action at this time.
0 commit comments