Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ClientDefaultListenerResourceNameTemplate when used with --include-xdstp-name-in-lds-experimental #57

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ func generate(in configInput) ([]byte, error) {
// xdstp://<authority>/envoy.config.listener.v3.Listener/<project_number>/<(network)|(mesh:mesh_name)>/id
ClientListenerResourceNameTemplate: fmt.Sprintf("xdstp://%s/envoy.config.listener.v3.Listener/%d/%s/%%s", tdAuthority, in.gcpProjectNumber, networkIdentifier),
}
c.ClientDefaultListenerResourceNameTemplate = fmt.Sprintf("xdstp://%s/envoy.config.listener.v3.Listener/%d/%s/%%s", tdAuthority, in.gcpProjectNumber, networkIdentifier)
}

c2pAuthority := "traffic-director-c2p.xds.googleapis.com"
Expand Down Expand Up @@ -462,11 +463,12 @@ func getFromMetadata(urlStr string) ([]byte, error) {
}

type config struct {
XdsServers []server `json:"xds_servers,omitempty"`
Authorities map[string]Authority `json:"authorities,omitempty"`
Node *node `json:"node,omitempty"`
CertificateProviders map[string]certificateProviderConfig `json:"certificate_providers,omitempty"`
ServerListenerResourceNameTemplate string `json:"server_listener_resource_name_template,omitempty"`
XdsServers []server `json:"xds_servers,omitempty"`
Authorities map[string]Authority `json:"authorities,omitempty"`
Node *node `json:"node,omitempty"`
CertificateProviders map[string]certificateProviderConfig `json:"certificate_providers,omitempty"`
ServerListenerResourceNameTemplate string `json:"server_listener_resource_name_template,omitempty"`
ClientDefaultListenerResourceNameTemplate string `json:"client_default_listener_resource_name_template,omitempty"`
}

type server struct {
Expand Down
3 changes: 2 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ func TestGenerate(t *testing.T) {
}
}
},
"server_listener_resource_name_template": "grpc/server?xds.resource.listening_address=%s"
"server_listener_resource_name_template": "grpc/server?xds.resource.listening_address=%s",
"client_default_listener_resource_name_template": "xdstp://traffic-director-global.xds.googleapis.com/envoy.config.listener.v3.Listener/123456789012345/thedefault/%s"
}`,
},
}
Expand Down
Loading