Skip to content

Commit

Permalink
Rename service to proxy in dataplane config json (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganeshrockz authored Sep 26, 2023
1 parent 57ac41e commit f3dd594
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions internal/dataplane/dataplane_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ func (i *GetDataplaneConfigJSONInput) GetDataplaneConfigJSON() ([]byte, error) {
GRPCPort: i.ConsulServerConfig.GRPC.Port,
SkipServerWatch: i.ConsulServerConfig.SkipServerWatch,
},
Service: ServiceConfig{
NodeName: i.ProxyRegistration.Node,
ProxyServiceID: i.ProxyRegistration.Service.ID,
Namespace: i.ProxyRegistration.Service.Namespace,
Partition: i.ProxyRegistration.Service.Partition,
Proxy: ProxyConfig{
NodeName: i.ProxyRegistration.Node,
ID: i.ProxyRegistration.Service.ID,
Namespace: i.ProxyRegistration.Service.Namespace,
Partition: i.ProxyRegistration.Service.Partition,
},
XDSServer: XDSServerConfig{
Address: localhostAddr,
Expand Down
16 changes: 8 additions & 8 deletions internal/dataplane/dataplane_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func TestGetDataplaneConfigJSON(t *testing.T) {
"disabled": true
}
},
"service": {
"proxy": {
"nodeName": "test-node-name",
"serviceID": "test-side-car-123",
"id": "test-side-car-123",
"namespace": "%s",
"partition": "%s"
},
Expand Down Expand Up @@ -100,9 +100,9 @@ func TestGetDataplaneConfigJSON(t *testing.T) {
"tlsServerName": "consul.dc1"
}
},
"service": {
"proxy": {
"nodeName": "test-node-name",
"serviceID": "test-side-car-123",
"id": "test-side-car-123",
"namespace": "%s",
"partition": "%s"
},
Expand Down Expand Up @@ -155,9 +155,9 @@ func TestGetDataplaneConfigJSON(t *testing.T) {
}
}
},
"service": {
"proxy": {
"nodeName": "test-node-name",
"serviceID": "test-side-car-123",
"id": "test-side-car-123",
"namespace": "%s",
"partition": "%s"
},
Expand Down Expand Up @@ -215,9 +215,9 @@ func TestGetDataplaneConfigJSON(t *testing.T) {
}
}
},
"service": {
"proxy": {
"nodeName": "test-node-name",
"serviceID": "test-side-car-123",
"id": "test-side-car-123",
"namespace": "%s",
"partition": "%s"
},
Expand Down
12 changes: 6 additions & 6 deletions internal/dataplane/dataplane_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

type dataplaneConfig struct {
Consul ConsulConfig `json:"consul"`
Service ServiceConfig `json:"service"`
Proxy ProxyConfig `json:"proxy"`
XDSServer XDSServerConfig `json:"xdsServer"`
Envoy EnvoyConfig `json:"envoy"`
Logging LoggingConfig `json:"logging"`
Expand Down Expand Up @@ -38,11 +38,11 @@ type StaticCredentialConfig struct {
Token string `json:"token"`
}

type ServiceConfig struct {
NodeName string `json:"nodeName"`
ProxyServiceID string `json:"serviceID"`
Namespace string `json:"namespace"`
Partition string `json:"partition"`
type ProxyConfig struct {
NodeName string `json:"nodeName"`
ID string `json:"id"`
Namespace string `json:"namespace"`
Partition string `json:"partition"`
}

type XDSServerConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions subcommand/control-plane/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1193,9 +1193,9 @@ func getExpectedDataplaneCfgJSON() string {
"disabled": true
}%s
},
"service": {
"proxy": {
"nodeName": "arn:aws:ecs:us-east-1:123456789:cluster/test",
"serviceID": "%s",
"id": "%s",
"namespace": "%s",
"partition": "%s"
},
Expand Down

0 comments on commit f3dd594

Please sign in to comment.