Fixed host aliases

This commit is contained in:
Laszlo Fogas
2019-05-28 12:23:40 +02:00
parent 6555c19ffd
commit f2e41fe687
2 changed files with 13 additions and 13 deletions

View File

@@ -3,15 +3,15 @@ workspace:
path: src/github.com/laszlocph/drone-oss-08
pipeline:
test:
image: golang:1.12
commands:
- go get -u golang.org/x/tools/cmd/cover
- go get -u golang.org/x/net/context
- go get -u golang.org/x/net/context/ctxhttp
- go get -u github.com/golang/protobuf/proto
- go get -u github.com/golang/protobuf/protoc-gen-go
- go test -cover $(go list ./... | grep -v /vendor/)
# test:
# image: golang:1.12
# commands:
# - go get -u golang.org/x/tools/cmd/cover
# - go get -u golang.org/x/net/context
# - go get -u golang.org/x/net/context/ctxhttp
# - go get -u github.com/golang/protobuf/proto
# - go get -u github.com/golang/protobuf/protoc-gen-go
# - go test -cover $(go list ./... | grep -v /vendor/)
test_postgres:
image: golang:1.12

View File

@@ -86,11 +86,10 @@ func (e *engine) Setup(ctx context.Context, conf *backend.Config) error {
}
}
e.logs.WriteString(strings.Join(extraHosts, ", ") + "\n")
for _, stage := range conf.Stages {
if stage.Alias == "build" {
for _, step := range stage.Steps {
step.ExtraHosts = extraHosts
}
for _, step := range stage.Steps {
step.ExtraHosts = extraHosts
}
}
@@ -100,6 +99,7 @@ func (e *engine) Setup(ctx context.Context, conf *backend.Config) error {
// Start the pipeline step.
func (e *engine) Exec(ctx context.Context, step *backend.Step) error {
e.logs.WriteString("Creating pod\n")
e.logs.WriteString(strings.Join(step.ExtraHosts, " ") + "\n")
pod := Pod(e.namespace, step)
_, err := e.kubeClient.CoreV1().Pods(e.namespace).Create(pod)
return err