Skip to content

Commit

Permalink
Support server_listener_resource_name_template (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars authored Mar 2, 2021
1 parent 66de7ea commit 8af4336
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func generate(in configInput) ([]byte, error) {
},
},
}
c.GRPCServerResourceNameID = "grpc/server"
c.ServerListenerResourceNameTemplate = "grpc/server?xds.resource.listening_address=%s"
}

return json.MarshalIndent(c, "", " ")
Expand Down Expand Up @@ -243,10 +243,10 @@ func getFromMetadata(urlStr string) ([]byte, error) {
}

type config struct {
XdsServers []server `json:"xds_servers,omitempty"`
Node *node `json:"node,omitempty"`
CertificateProviders map[string]certificateProviderConfig `json:"certificate_providers,omitempty"`
GRPCServerResourceNameID string `json:"grpc_server_resource_name_id,omitempty"`
XdsServers []server `json:"xds_servers,omitempty"`
Node *node `json:"node,omitempty"`
CertificateProviders map[string]certificateProviderConfig `json:"certificate_providers,omitempty"`
ServerListenerResourceNameTemplate string `json:"server_listener_resource_name_template,omitempty"`
}

type server struct {
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestGenerate(t *testing.T) {
}
}
},
"grpc_server_resource_name_id": "grpc/server"
"server_listener_resource_name_template": "grpc/server?xds.resource.listening_address=%s"
}`,
},
}
Expand Down

0 comments on commit 8af4336

Please sign in to comment.