Skip to content

Commit b69ed21

Browse files
committed
Fix lint issues
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
1 parent dd6e207 commit b69ed21

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

internal/extension/registry/composite_hook_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type hookClientEntry struct {
2626
name string
2727
client types.XDSHookClient
2828
failOpen bool
29-
policyGVKSet map[string]struct{} // used for per-extension policy filtering in PostTranslateModifyHook
30-
translationConfig *egv1a1.TranslationConfig // used for per-extension resource-type gating in PostTranslateModifyHook
29+
policyGVKSet map[string]struct{} // used for per-extension policy filtering in PostTranslateModifyHook
30+
translationConfig *egv1a1.TranslationConfig // used for per-extension resource-type gating in PostTranslateModifyHook
3131
}
3232

3333
// compositeXDSHookClient chains multiple XDSHookClient calls sequentially.

internal/extension/registry/composite_hook_client_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ func TestCompositeHookClient_PostRouteModifyHook(t *testing.T) {
7373
t.Run("chains two clients", func(t *testing.T) {
7474
client1 := &mockXDSHookClient{
7575
postRouteModifyHook: func(r *route.Route, _ []string, _ []*unstructured.Unstructured) (*route.Route, error) {
76-
r.Name = r.Name + "-ext1"
76+
r.Name += "-ext1"
7777
return r, nil
7878
},
7979
}
8080
client2 := &mockXDSHookClient{
8181
postRouteModifyHook: func(r *route.Route, _ []string, _ []*unstructured.Unstructured) (*route.Route, error) {
82-
r.Name = r.Name + "-ext2"
82+
r.Name += "-ext2"
8383
return r, nil
8484
},
8585
}
@@ -105,7 +105,7 @@ func TestCompositeHookClient_PostRouteModifyHook(t *testing.T) {
105105
}
106106
client2 := &mockXDSHookClient{
107107
postRouteModifyHook: func(r *route.Route, _ []string, _ []*unstructured.Unstructured) (*route.Route, error) {
108-
r.Name = r.Name + "-ext2"
108+
r.Name += "-ext2"
109109
return r, nil
110110
},
111111
}
@@ -146,13 +146,13 @@ func TestCompositeHookClient_PostRouteModifyHook(t *testing.T) {
146146
func TestCompositeHookClient_PostVirtualHostModifyHook(t *testing.T) {
147147
client1 := &mockXDSHookClient{
148148
postVirtualHostModifyHook: func(vh *route.VirtualHost) (*route.VirtualHost, error) {
149-
vh.Name = vh.Name + "-ext1"
149+
vh.Name += "-ext1"
150150
return vh, nil
151151
},
152152
}
153153
client2 := &mockXDSHookClient{
154154
postVirtualHostModifyHook: func(vh *route.VirtualHost) (*route.VirtualHost, error) {
155-
vh.Name = vh.Name + "-ext2"
155+
vh.Name += "-ext2"
156156
return vh, nil
157157
},
158158
}
@@ -173,13 +173,13 @@ func TestCompositeHookClient_PostVirtualHostModifyHook(t *testing.T) {
173173
func TestCompositeHookClient_PostHTTPListenerModifyHook(t *testing.T) {
174174
client1 := &mockXDSHookClient{
175175
postHTTPListenerModifyHook: func(l *listener.Listener, _ []*unstructured.Unstructured) (*listener.Listener, error) {
176-
l.Name = l.Name + "-ext1"
176+
l.Name += "-ext1"
177177
return l, nil
178178
},
179179
}
180180
client2 := &mockXDSHookClient{
181181
postHTTPListenerModifyHook: func(l *listener.Listener, _ []*unstructured.Unstructured) (*listener.Listener, error) {
182-
l.Name = l.Name + "-ext2"
182+
l.Name += "-ext2"
183183
return l, nil
184184
},
185185
}
@@ -200,13 +200,13 @@ func TestCompositeHookClient_PostHTTPListenerModifyHook(t *testing.T) {
200200
func TestCompositeHookClient_PostClusterModifyHook(t *testing.T) {
201201
client1 := &mockXDSHookClient{
202202
postClusterModifyHook: func(c *cluster.Cluster, _ []*unstructured.Unstructured) (*cluster.Cluster, error) {
203-
c.Name = c.Name + "-ext1"
203+
c.Name += "-ext1"
204204
return c, nil
205205
},
206206
}
207207
client2 := &mockXDSHookClient{
208208
postClusterModifyHook: func(c *cluster.Cluster, _ []*unstructured.Unstructured) (*cluster.Cluster, error) {
209-
c.Name = c.Name + "-ext2"
209+
c.Name += "-ext2"
210210
return c, nil
211211
},
212212
}
@@ -349,8 +349,8 @@ func TestCompositeHookClient_PostTranslateModifyHook(t *testing.T) {
349349
name: "ext1",
350350
client: client1,
351351
translationConfig: &egv1a1.TranslationConfig{
352-
Cluster: &egv1a1.ClusterTranslationConfig{IncludeAll: ptr.To(true)},
353-
Secret: &egv1a1.SecretTranslationConfig{IncludeAll: ptr.To(false)},
352+
Cluster: &egv1a1.ClusterTranslationConfig{IncludeAll: ptr.To(true)},
353+
Secret: &egv1a1.SecretTranslationConfig{IncludeAll: ptr.To(false)},
354354
// Listener and Route nil → defaults false
355355
},
356356
},

0 commit comments

Comments
 (0)