diff --git a/command/config/write/config_write.go b/command/config/write/config_write.go index 4150780c8..593b76eed 100644 --- a/command/config/write/config_write.go +++ b/command/config/write/config_write.go @@ -138,7 +138,13 @@ func newDecodeConfigEntry(raw map[string]interface{}) (api.ConfigEntry, error) { switch entry.GetKind() { case api.ProxyDefaults: + translateKeysDict = map[string]string{ + "mesh_gateway": "meshgateway", + } case api.ServiceDefaults: + translateKeysDict = map[string]string{ + "mesh_gateway": "meshgateway", + } case api.ServiceRouter: skipWhenPatching = []string{ "routes", diff --git a/command/config/write/config_write_test.go b/command/config/write/config_write_test.go index 809c44cfa..3211b8dcf 100644 --- a/command/config/write/config_write_test.go +++ b/command/config/write/config_write_test.go @@ -145,6 +145,9 @@ func TestParseConfigEntry(t *testing.T) { "moar" = "config" } } + mesh_gateway { + mode = "remote" + } `, camel: ` Kind = "proxy-defaults" @@ -156,6 +159,9 @@ func TestParseConfigEntry(t *testing.T) { "moar" = "config" } } + MeshGateway { + Mode = "remote" + } `, expect: &api.ProxyConfigEntry{ Kind: "proxy-defaults", @@ -167,6 +173,9 @@ func TestParseConfigEntry(t *testing.T) { "moar": "config", }, }, + MeshGateway: api.MeshGatewayConfig{ + Mode: api.MeshGatewayModeRemote, + }, }, }, { @@ -175,16 +184,25 @@ func TestParseConfigEntry(t *testing.T) { kind = "service-defaults" name = "main" protocol = "http" + mesh_gateway { + mode = "remote" + } `, camel: ` Kind = "service-defaults" Name = "main" Protocol = "http" + MeshGateway { + Mode = "remote" + } `, expect: &api.ServiceConfigEntry{ Kind: "service-defaults", Name: "main", Protocol: "http", + MeshGateway: api.MeshGatewayConfig{ + Mode: api.MeshGatewayModeRemote, + }, }, }, {