remove undocumented networks option from steps (#3915)

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
6543 2024-07-18 09:18:39 -07:00 committed by GitHub
parent c81a6d67b1
commit 7b7c83d040
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 20 deletions

View file

@ -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{

View file

@ -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")
}

View file

@ -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",

View file

@ -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"`
}

View file

@ -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"},