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

xds/xdsclient: ignore resource deletion as per gRFC A53 #6035

Merged
merged 15 commits into from Apr 4, 2023
7 changes: 7 additions & 0 deletions internal/testutils/xds/bootstrap/bootstrap.go
Expand Up @@ -37,6 +37,10 @@ type Options struct {
NodeID string
// ServerURI is the address of the management server.
ServerURI string
// IgnoreResourceDeletion, if true, results in a bootstrap config with the
// `server_features` list containing `ignore_resource_deletion`. This results
// in gRPC ignoring resource deletions from the management server, as per A53.
IgnoreResourceDeletion bool
// ClientDefaultListenerResourceNameTemplate is the default listener
// resource name template to be used on the gRPC client.
ClientDefaultListenerResourceNameTemplate string
Expand Down Expand Up @@ -108,6 +112,9 @@ func Contents(opts Options) ([]byte, error) {
ServerListenerResourceNameTemplate: opts.ServerListenerResourceNameTemplate,
}
cfg.XdsServers[0].ServerFeatures = append(cfg.XdsServers[0].ServerFeatures, "xds_v3")
if opts.IgnoreResourceDeletion {
cfg.XdsServers[0].ServerFeatures = append(cfg.XdsServers[0].ServerFeatures, "ignore_resource_deletion")
}

auths := make(map[string]authority)
if envconfig.XDSFederation {
Expand Down
6 changes: 6 additions & 0 deletions internal/testutils/xds/e2e/server.go
Expand Up @@ -81,6 +81,12 @@ type ManagementServerOptions struct {
// set to true only for tests which explicitly require the other behavior.
AllowResourceSubset bool

// ServerFeaturesIgnoreResourceDeletion, if set, results in a bootstrap config
// where the server features list contains `ignore_resource_deletion`. This
// results in gRPC ignoring resource deletions from the management server, as
// per A53.
ServerFeaturesIgnoreResourceDeletion bool

// The callbacks defined below correspond to the state of the world (sotw)
// version of the xDS API on the management server.

Expand Down