diff --git a/pipeline/frontend/yaml/compiler/convert.go b/pipeline/frontend/yaml/compiler/convert.go index 2d843242c..accda0f44 100644 --- a/pipeline/frontend/yaml/compiler/convert.go +++ b/pipeline/frontend/yaml/compiler/convert.go @@ -40,7 +40,6 @@ func (c *Compiler) createProcess(container *yaml_types.Container, stepType backe workspace = fmt.Sprintf("%s_default:%s", c.prefix, c.base) privileged = container.Privileged networkMode = container.NetworkMode - // network = container.Network ) networks := []backend_types.Conn{ diff --git a/pipeline/frontend/yaml/linter/linter.go b/pipeline/frontend/yaml/linter/linter.go index 73cefc799..4abc03ba4 100644 --- a/pipeline/frontend/yaml/linter/linter.go +++ b/pipeline/frontend/yaml/linter/linter.go @@ -172,9 +172,6 @@ func (l *Linter) lintTrusted(config *WorkflowConfig, c *types.Container, area st if len(c.NetworkMode) != 0 { errors = append(errors, "Insufficient privileges to use network_mode") } - if c.Networks.Networks != nil && len(c.Networks.Networks) != 0 { - errors = append(errors, "Insufficient privileges to use networks") - } if c.Volumes.Volumes != nil && len(c.Volumes.Volumes) != 0 { errors = append(errors, "Insufficient privileges to use volumes") } diff --git a/pipeline/frontend/yaml/linter/linter_test.go b/pipeline/frontend/yaml/linter/linter_test.go index 1179f67bc..5f73d89ac 100644 --- a/pipeline/frontend/yaml/linter/linter_test.go +++ b/pipeline/frontend/yaml/linter/linter_test.go @@ -145,10 +145,6 @@ func TestLintErrors(t *testing.T) { from: "steps: { build: { image: golang, network_mode: host } }", want: "Insufficient privileges to use network_mode", }, - { - from: "steps: { build: { image: golang, networks: [ outside, default ] } }", - want: "Insufficient privileges to use networks", - }, { from: "steps: { build: { image: golang, volumes: [ '/opt/data:/var/lib/mysql' ] } }", want: "Insufficient privileges to use volumes", diff --git a/pipeline/frontend/yaml/types/container.go b/pipeline/frontend/yaml/types/container.go index 78da8141f..40d7385f8 100644 --- a/pipeline/frontend/yaml/types/container.go +++ b/pipeline/frontend/yaml/types/container.go @@ -68,7 +68,6 @@ type ( MemLimit base.MemStringOrInt `yaml:"mem_limit,omitempty"` MemSwapLimit base.MemStringOrInt `yaml:"memswap_limit,omitempty"` NetworkMode string `yaml:"network_mode,omitempty"` - Networks Networks `yaml:"networks,omitempty"` ShmSize base.MemStringOrInt `yaml:"shm_size,omitempty"` Tmpfs []string `yaml:"tmpfs,omitempty"` } diff --git a/pipeline/frontend/yaml/types/container_test.go b/pipeline/frontend/yaml/types/container_test.go index 5d8fbb0cc..3573fbc13 100644 --- a/pipeline/frontend/yaml/types/container_test.go +++ b/pipeline/frontend/yaml/types/container_test.go @@ -94,17 +94,11 @@ func TestUnmarshalContainer(t *testing.T) { MemLimit: base.MemStringOrInt(1024), MemSwapLimit: base.MemStringOrInt(1024), Name: "my-build-container", - Networks: Networks{ - Networks: []*Network{ - {Name: "some-network"}, - {Name: "other-network"}, - }, - }, - NetworkMode: "bridge", - Pull: true, - Privileged: true, - ShmSize: base.MemStringOrInt(1024), - Tmpfs: base.StringOrSlice{"/var/lib/test"}, + NetworkMode: "bridge", + Pull: true, + Privileged: true, + ShmSize: base.MemStringOrInt(1024), + Tmpfs: base.StringOrSlice{"/var/lib/test"}, Volumes: Volumes{ Volumes: []*Volume{ {Source: "", Destination: "/var/lib/mysql"},