mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-19 01:47:43 +08:00
Remove NetworkMode support for HCL targets
Signed-off-by: Zachary Povey <zachary.povey@autotrader.co.uk>
This commit is contained in:
parent
ae53101e89
commit
4ee7f70400
@ -426,7 +426,7 @@ type Target struct {
|
|||||||
Outputs []string `json:"output,omitempty" hcl:"output,optional"`
|
Outputs []string `json:"output,omitempty" hcl:"output,optional"`
|
||||||
Pull *bool `json:"pull,omitempty" hcl:"pull,optional"`
|
Pull *bool `json:"pull,omitempty" hcl:"pull,optional"`
|
||||||
NoCache *bool `json:"no-cache,omitempty" hcl:"no-cache,optional"`
|
NoCache *bool `json:"no-cache,omitempty" hcl:"no-cache,optional"`
|
||||||
NetworkMode *string `json:"network,omitempty" hcl:"network,optional"`
|
NetworkMode *string
|
||||||
|
|
||||||
// IMPORTANT: if you add more fields here, do not forget to update newOverrides and README.
|
// IMPORTANT: if you add more fields here, do not forget to update newOverrides and README.
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ func TestHCLBasic(t *testing.T) {
|
|||||||
|
|
||||||
target "webapp-plus" {
|
target "webapp-plus" {
|
||||||
inherits = ["webapp", "cross"]
|
inherits = ["webapp", "cross"]
|
||||||
network = "host"
|
|
||||||
args = {
|
args = {
|
||||||
IAMCROSS = "true"
|
IAMCROSS = "true"
|
||||||
}
|
}
|
||||||
@ -64,7 +63,6 @@ func TestHCLBasic(t *testing.T) {
|
|||||||
require.Equal(t, c.Targets[3].Name, "webapp-plus")
|
require.Equal(t, c.Targets[3].Name, "webapp-plus")
|
||||||
require.Equal(t, 1, len(c.Targets[3].Args))
|
require.Equal(t, 1, len(c.Targets[3].Args))
|
||||||
require.Equal(t, map[string]string{"IAMCROSS": "true"}, c.Targets[3].Args)
|
require.Equal(t, map[string]string{"IAMCROSS": "true"}, c.Targets[3].Args)
|
||||||
require.Equal(t, "host", *c.Targets[3].NetworkMode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHCLBasicInJSON(t *testing.T) {
|
func TestHCLBasicInJSON(t *testing.T) {
|
||||||
@ -95,7 +93,6 @@ func TestHCLBasicInJSON(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"webapp-plus": {
|
"webapp-plus": {
|
||||||
"inherits": ["webapp", "cross"],
|
"inherits": ["webapp", "cross"],
|
||||||
"network": "host",
|
|
||||||
"args": {
|
"args": {
|
||||||
"IAMCROSS": "true"
|
"IAMCROSS": "true"
|
||||||
}
|
}
|
||||||
@ -126,7 +123,6 @@ func TestHCLBasicInJSON(t *testing.T) {
|
|||||||
require.Equal(t, c.Targets[3].Name, "webapp-plus")
|
require.Equal(t, c.Targets[3].Name, "webapp-plus")
|
||||||
require.Equal(t, 1, len(c.Targets[3].Args))
|
require.Equal(t, 1, len(c.Targets[3].Args))
|
||||||
require.Equal(t, map[string]string{"IAMCROSS": "true"}, c.Targets[3].Args)
|
require.Equal(t, map[string]string{"IAMCROSS": "true"}, c.Targets[3].Args)
|
||||||
require.Equal(t, "host", *c.Targets[3].NetworkMode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHCLWithFunctions(t *testing.T) {
|
func TestHCLWithFunctions(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user