fix: get pipelines working with rancher desktop (#2286)

* fix: get pipelines working with rancher desktop
pull/3545/head
Vistaar Juneja 2024-07-25 12:49:52 +00:00 committed by Harness
parent d40b020f80
commit d36bf54f99
1 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,8 @@
package runner
import (
goruntime "runtime"
"github.com/harness/gitness/app/pipeline/resolver"
"github.com/harness/gitness/types"
@ -52,9 +54,13 @@ func NewExecutionRunner(
client runnerclient.Client,
resolver *resolver.Manager,
) (*runtime2.Runner, error) {
// For linux, containers need to have extra hosts set in order to interact with
// the gitness container.
extraHosts := []string{"host.docker.internal:host-gateway"}
// For linux/windows, containers need to have extra hosts set in order to interact with
// gitness. For docker desktop for mac, this is built in and not needed.
extraHosts := []string{}
if goruntime.GOOS != "darwin" {
extraHosts = []string{"host.docker.internal:host-gateway"}
}
compiler := &compiler.Compiler{
Environ: provider.Static(map[string]string{}),
Registry: registry.Static([]*drone.Registry{}),