Skip to content

Conversation

@menghanl
Copy link
Contributor

Support new bootstrap fields

  • client_default_listener_resource_name_template
  • authorities

Changes

  • new struct for server config (URI, creds, v2/v3, node), and reused for top level and per-authority server
    • and fix all the usages
  • node proto message is now for each server, to be consistent with TransportAPI version
  • config test to use cmp.Diff

RELEASE NOTES:

  • xds/bootstrap: support new fields for client side listener resource name template and authorities

@menghanl menghanl requested a review from easwars October 13, 2021 00:21
@menghanl menghanl added the Type: Feature New features or improvements in behavior label Oct 13, 2021
@menghanl menghanl added this to the 1.42 Release milestone Oct 13, 2021
//
// The token "%s", if present in this string, will be replaced with the IP
// and port on which the server is listening. (e.g., "0.0.0.0:8080",
// "[::]:8080"). For example, a value of // "example/resource/%s" could
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of // inside this comment line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// If not present in the bootstrap file, defaults to
// "xdstp://<authority_name>/envoy.config.listener.v3.Listener/%s".
ClientListenerResourceNameTemplate string
// XDSServer is FIXME.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this comment mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXME is supposed to remind me to fix it before sending.

Updated.

return fmt.Errorf("xds: json.Unmarshal(%v) for field %q failed during bootstrap: %v", string(v), k, err)
}
case "client_listener_resource_name_template":
// FIXME: must start with "xdstp://<authority_name>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we just validate it in this PR? url.Parse() should be able to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done. line 393.
I forgot to delete the comment.

// Post-process the authorities' client listener resource template field:
// - if set, it must start with "xdstp://<authority_name>/"
// - if not set, it defaults to "xdstp://<authority_name>/envoy.config.listener.v3.Listener/%s"
for n, a := range config.Authorities {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was searching for a while as to where the authority_name is fetched from. Could we name n and a to something more meaningful. I understand these have a very small scope, but n and a don't convey much at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed

@easwars easwars assigned menghanl and unassigned easwars Oct 14, 2021
@menghanl menghanl assigned easwars and unassigned menghanl Oct 15, 2021
}

switch config.TransportAPI {
switch config.XDSServer.TransportAPI {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this check going forward? If so, should we have a similar check for the server configs per authority?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted.

@easwars easwars assigned menghanl and unassigned easwars Oct 15, 2021
@menghanl menghanl force-pushed the federation_bootstrap branch from 7d53614 to f3117fd Compare October 16, 2021 00:04
…ration

Support new bootstrap fields
- client_default_listener_resource_name_template
- authorities

Changes
- new struct for server config (URI, creds, v2/v3, node), and reused for top level and per-authority server
  - and fix all the usages
- node proto message is now for each server, to be consistent with TransportAPI version
- config test to use cmp.Diff
@menghanl menghanl force-pushed the federation_bootstrap branch from f3117fd to 964bc20 Compare October 19, 2021 21:13
@menghanl
Copy link
Contributor Author

Replaced by #4892

@menghanl menghanl closed this Oct 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants