parent
bd6f232b20
commit
143676fcfb
4 changed files with 35 additions and 19 deletions
|
@ -24,16 +24,17 @@ import (
|
||||||
|
|
||||||
// NewContainerInput the input for the New function
|
// NewContainerInput the input for the New function
|
||||||
type NewContainerInput struct {
|
type NewContainerInput struct {
|
||||||
Image string
|
Image string
|
||||||
Entrypoint []string
|
Entrypoint []string
|
||||||
Cmd []string
|
Cmd []string
|
||||||
WorkingDir string
|
WorkingDir string
|
||||||
Env []string
|
Env []string
|
||||||
Binds []string
|
Binds []string
|
||||||
Mounts map[string]string
|
Mounts map[string]string
|
||||||
Name string
|
Name string
|
||||||
Stdout io.Writer
|
Stdout io.Writer
|
||||||
Stderr io.Writer
|
Stderr io.Writer
|
||||||
|
NetworkMode string
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileEntry is a file to copy to a container
|
// FileEntry is a file to copy to a container
|
||||||
|
@ -221,8 +222,9 @@ func (cr *containerReference) create() common.Executor {
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := cr.cli.ContainerCreate(ctx, config, &container.HostConfig{
|
resp, err := cr.cli.ContainerCreate(ctx, config, &container.HostConfig{
|
||||||
Binds: input.Binds,
|
Binds: input.Binds,
|
||||||
Mounts: mounts,
|
Mounts: mounts,
|
||||||
|
NetworkMode: container.NetworkMode(input.NetworkMode),
|
||||||
}, nil, input.Name)
|
}, nil, input.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
|
|
|
@ -107,10 +107,10 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
||||||
"act-toolcache": "/toolcache",
|
"act-toolcache": "/toolcache",
|
||||||
"act-actions": "/actions",
|
"act-actions": "/actions",
|
||||||
},
|
},
|
||||||
|
NetworkMode: "host",
|
||||||
Binds: binds,
|
Binds: binds,
|
||||||
Stdout: logWriter,
|
Stdout: logWriter,
|
||||||
Stderr: logWriter,
|
Stderr: logWriter,
|
||||||
})
|
})
|
||||||
|
|
||||||
return common.NewPipelineExecutor(
|
return common.NewPipelineExecutor(
|
||||||
|
|
|
@ -177,9 +177,10 @@ func (sc *StepContext) newStepContainer(ctx context.Context, image string, cmd [
|
||||||
"act-toolcache": "/toolcache",
|
"act-toolcache": "/toolcache",
|
||||||
"act-actions": "/actions",
|
"act-actions": "/actions",
|
||||||
},
|
},
|
||||||
Binds: binds,
|
NetworkMode: fmt.Sprintf("container:%s", rc.jobContainerName()),
|
||||||
Stdout: logWriter,
|
Binds: binds,
|
||||||
Stderr: logWriter,
|
Stdout: logWriter,
|
||||||
|
Stderr: logWriter,
|
||||||
})
|
})
|
||||||
return stepContainer
|
return stepContainer
|
||||||
}
|
}
|
||||||
|
|
13
pkg/runner/testdata/issue-141/main.yaml
vendored
Normal file
13
pkg/runner/testdata/issue-141/main.yaml
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
name: "Create cluster using KinD"
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
kind:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: engineerd/setup-kind@v0.3.0
|
||||||
|
- name: Testing
|
||||||
|
run: |
|
||||||
|
kubectl cluster-info
|
||||||
|
kubectl get pods -n kube-system
|
Loading…
Reference in a new issue