envoyproxy / envoyproxy/gateway

Discuss: refactor the out files under internal/xds/translator/testdata/out/xds-ir

オープン
#1,162 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
stale
主要言語
Go
スター
3k
フォーク
864
平均マージ
2日 2時間
マージ済み PR(30日)
140

説明

*Description*:
>Describe the issue.

The current xds translator test doesn't have corresponding requireXXX settings (though it has requireSecrets):
https://github.com/envoyproxy/gateway/blob/73e38e0a2811146671d503bc53ac363a81d29d50/internal/xds/translator/translator_test.go#L148-L156

For each test case, all four xds types need to be specific. This causes lots of duplicate files and a heavier burden to update them later.

### lots of duplicate files

Using rdfind shows us a result like that:
```
DUPTYPE_FIRST_OCCURRENCE 23 0 1205 2080 207885 1 internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 212938 1 internal/xds/translator/testdata/out/xds-ir/http-route-redirect.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 212346 1 internal/xds/translator/testdata/out/xds-ir/http-route-mirror.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 606945 1 internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 217152 1 internal/xds/translator/testdata/out/xds-ir/http-route-regex.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 218598 1 internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 224496 1 internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 242400 1 internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 252551 1 internal/xds/translator/testdata/out/xds-ir/http-route.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 252294 1 internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 252051 1 internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 243504 1 internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 243422 1 internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 242764 1 internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.listeners.yaml
DUPTYPE_WITHIN_SAME_TREE -23 0 1205 2080 242518 1 internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.listeners.yaml
```
We can find out that almost every HTTPFilter test cases share the same listener xds as the http-route case. It's expected as the HTTPFilter doesn't affect the listener.

### a heavier burden to update them later

For example, https://github.com/envoyproxy/gateway/pull/1095 needs to update over ten out files. As the number of test cases is growing, maybe the next time we have to update tens of files.

If the refactoring is permitted, I will take on it.

[optional *Relevant Links*:]
>Any extra documentation required to understand the issue.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。