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

istiod: fully drop xds v2 #44679

Merged
merged 1 commit into from
May 2, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func TestApplyListenerPatches(t *testing.T) {
Value: buildPatchStruct(`
{"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager",
"@type": "type.googleapis.com/type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"xffNumTrustedHops": "4"
}
}`),
Expand Down
8 changes: 8 additions & 0 deletions pkg/config/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,13 @@ var ValidateEnvoyFilter = registerValidateFunc("ValidateEnvoyFilter",
}
// ensure that the struct is valid
if _, err := xds.BuildXDSObjectFromStruct(cp.ApplyTo, cp.Patch.Value, false); err != nil {
if strings.Contains(err.Error(), "could not resolve Any message type") {
if strings.Contains(err.Error(), ".v2.") {
err = fmt.Errorf("referenced type unknown (hint: try using the v3 XDS API): %v", err)
} else {
err = fmt.Errorf("referenced type unknown: %v", err)
}
}
errs = appendValidation(errs, err)
} else {
// Run with strict validation, and emit warnings. This helps capture cases like unknown fields
Expand All @@ -922,6 +929,7 @@ var ValidateEnvoyFilter = registerValidateFunc("ValidateEnvoyFilter",

// Append any deprecation notices
if obj != nil {
// Note: since we no longer import v2 protos, v2 references will fail during BuildXDSObjectFromStruct.
errs = appendValidation(errs, validateDeprecatedFilterTypes(obj))
errs = appendValidation(errs, validateMissingTypedConfigFilterTypes(obj))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4411,7 +4411,7 @@ func TestValidateEnvoyFilter(t *testing.T) {
},
},
},
}, error: "", warning: "using deprecated type_url"},
}, error: "referenced type unknown (hint: try using the v3 XDS API)"},
{name: "deprecated type", in: &networking.EnvoyFilter{
ConfigPatches: []*networking.EnvoyFilter_EnvoyConfigObjectPatch{
{
Expand Down
106 changes: 0 additions & 106 deletions pkg/config/xds/filter_types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/config/xds/filter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
//go:generate sh -c "echo '// limitations under the License.\n' >> filter_types.gen.go"
//go:generate sh -c "echo '// GENERATED FILE -- DO NOT EDIT\n' >> filter_types.gen.go"
//go:generate sh -c "echo 'package xds\n\nimport (' >> filter_types.gen.go"
//go:generate sh -c "go list github.com/envoyproxy/go-control-plane/... | grep 'v[2-9]' | grep -v /pkg/ | xargs -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "go list github.com/envoyproxy/go-control-plane/... | grep 'v3' | grep -v /pkg/ | xargs -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "echo '\n\t// Istio-specific Envoy filters' >> filter_types.gen.go"
//go:generate sh -c "go list istio.io/api/envoy/config/filter/... | grep 'v[2-9]' | xargs -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "go list istio.io/api/envoy/config/filter/... | grep 'v[0-9]' | xargs -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "echo ')' >> filter_types.gen.go"
package xds

Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/drop-xds-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: release-notes/v2
kind: feature
area: traffic-management
releaseNotes:
- |
**Removed** support for XDS v2 types in `EnvoyFilter`s. These should use the v3 interface. This has been a warning for multiple releases and is now upgraded to an error.