Skip to content

Commit b9ae07e

Browse files
author
Arko Dasgupta
committed
fix build
Signed-off-by: Arko Dasgupta <[email protected]>
1 parent 464eec9 commit b9ae07e

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

internal/envoygateway/config/config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ func (s *Server) Validate() error {
9999
if _, err := url.Parse(s.EnvoyGateway.RateLimit.Backend.Redis.URL); err != nil {
100100
return fmt.Errorf("unknown ratelimit redis url format: %w", err)
101101
}
102-
case s.EnvoyGateway.Extension != nil:
103-
if s.EnvoyGateway.Extension.Hooks == nil || s.EnvoyGateway.Extension.Hooks.XDSTranslator == nil {
102+
case s.EnvoyGateway.ExtensionManager != nil:
103+
if s.EnvoyGateway.ExtensionManager.Hooks == nil || s.EnvoyGateway.ExtensionManager.Hooks.XDSTranslator == nil {
104104
return fmt.Errorf("registered extension has no hooks specified")
105105
}
106106

107-
if len(s.EnvoyGateway.Extension.Hooks.XDSTranslator.Pre) == 0 && len(s.EnvoyGateway.Extension.Hooks.XDSTranslator.Post) == 0 {
107+
if len(s.EnvoyGateway.ExtensionManager.Hooks.XDSTranslator.Pre) == 0 && len(s.EnvoyGateway.ExtensionManager.Hooks.XDSTranslator.Post) == 0 {
108108
return fmt.Errorf("registered extension has no hooks specified")
109109
}
110110

111-
if s.EnvoyGateway.Extension.Service == nil {
111+
if s.EnvoyGateway.ExtensionManager.Service == nil {
112112
return fmt.Errorf("extension service config is empty")
113113
}
114114

115-
if s.EnvoyGateway.Extension.Service.TLS != nil {
116-
certificateRefKind := s.EnvoyGateway.Extension.Service.TLS.CertificateRef.Kind
115+
if s.EnvoyGateway.ExtensionManager.Service.TLS != nil {
116+
certificateRefKind := s.EnvoyGateway.ExtensionManager.Service.TLS.CertificateRef.Kind
117117

118118
if certificateRefKind == nil {
119119
return fmt.Errorf("certificateRef empty in extension service server TLS settings")

internal/envoygateway/config/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func TestValidate(t *testing.T) {
187187
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
188188
Gateway: v1alpha1.DefaultGateway(),
189189
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
190-
Extension: &v1alpha1.Extension{
190+
ExtensionManager: &v1alpha1.ExtensionManager{
191191
Resources: []v1alpha1.GroupVersionKind{
192192
{
193193
Group: "foo.example.io",
@@ -224,7 +224,7 @@ func TestValidate(t *testing.T) {
224224
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
225225
Gateway: v1alpha1.DefaultGateway(),
226226
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
227-
Extension: &v1alpha1.Extension{
227+
ExtensionManager: &v1alpha1.ExtensionManager{
228228
Resources: []v1alpha1.GroupVersionKind{
229229
{
230230
Group: "foo.example.io",
@@ -267,7 +267,7 @@ func TestValidate(t *testing.T) {
267267
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
268268
Gateway: v1alpha1.DefaultGateway(),
269269
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
270-
Extension: &v1alpha1.Extension{
270+
ExtensionManager: &v1alpha1.ExtensionManager{
271271
Hooks: &v1alpha1.ExtensionHooks{
272272
XDSTranslator: &v1alpha1.XDSTranslatorHooks{
273273
Pre: []v1alpha1.XDSTranslatorHook{},
@@ -303,7 +303,7 @@ func TestValidate(t *testing.T) {
303303
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
304304
Gateway: v1alpha1.DefaultGateway(),
305305
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
306-
Extension: &v1alpha1.Extension{
306+
ExtensionManager: &v1alpha1.ExtensionManager{
307307
Resources: []v1alpha1.GroupVersionKind{
308308
{
309309
Group: "foo.example.io",
@@ -346,7 +346,7 @@ func TestValidate(t *testing.T) {
346346
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
347347
Gateway: v1alpha1.DefaultGateway(),
348348
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
349-
Extension: &v1alpha1.Extension{
349+
ExtensionManager: &v1alpha1.ExtensionManager{
350350
Resources: []v1alpha1.GroupVersionKind{
351351
{
352352
Group: "foo.example.io",
@@ -379,7 +379,7 @@ func TestValidate(t *testing.T) {
379379
EnvoyGatewaySpec: v1alpha1.EnvoyGatewaySpec{
380380
Gateway: v1alpha1.DefaultGateway(),
381381
Provider: v1alpha1.DefaultEnvoyGatewayProvider(),
382-
Extension: &v1alpha1.Extension{
382+
ExtensionManager: &v1alpha1.ExtensionManager{
383383
Resources: []v1alpha1.GroupVersionKind{
384384
{
385385
Group: "foo.example.io",

internal/extension/registry/extension_manager.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var _ extTypes.Manager = (*Manager)(nil)
4646
type Manager struct {
4747
k8sClient k8scli.Client
4848
namespace string
49-
extension v1alpha1.Extension
49+
extension v1alpha1.ExtensionManager
5050
extensionConnCache *grpc.ClientConn
5151
}
5252

@@ -57,14 +57,14 @@ func NewManager(cfg *config.Server) (extTypes.Manager, error) {
5757
return nil, err
5858
}
5959

60-
var extension *v1alpha1.Extension
60+
var extension *v1alpha1.ExtensionManager
6161
if cfg.EnvoyGateway != nil {
62-
extension = cfg.EnvoyGateway.Extension
62+
extension = cfg.EnvoyGateway.ExtensionManager
6363
}
6464

6565
// Setup an empty default in the case that no config was provided
6666
if extension == nil {
67-
extension = &v1alpha1.Extension{}
67+
extension = &v1alpha1.ExtensionManager{}
6868
}
6969

7070
return &Manager{
@@ -203,7 +203,7 @@ func parseCA(caSecret *corev1.Secret) (*x509.CertPool, error) {
203203
return cp, nil
204204
}
205205

206-
func setupGRPCOpts(ctx context.Context, client k8scli.Client, ext *v1alpha1.Extension, namespace string) ([]grpc.DialOption, error) {
206+
func setupGRPCOpts(ctx context.Context, client k8scli.Client, ext *v1alpha1.ExtensionManager, namespace string) ([]grpc.DialOption, error) {
207207
// These two errors shouldn't happen since we check these conditions when loading the extension
208208
if ext == nil {
209209
return nil, errors.New("the registered extension's config is nil")

internal/extension/testutils/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515
var _ extType.Manager = (*Manager)(nil)
1616

1717
type Manager struct {
18-
extension v1alpha1.Extension
18+
extension v1alpha1.ExtensionManager
1919
}
2020

21-
func NewManager(ext v1alpha1.Extension) extType.Manager {
21+
func NewManager(ext v1alpha1.ExtensionManager) extType.Manager {
2222
return &Manager{
2323
extension: ext,
2424
}

internal/gatewayapi/runner/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ func (r *Runner) subscribeAndTranslate(ctx context.Context) {
6565
}
6666

6767
// If an extension is loaded, pass its supported groups/kinds to the translator
68-
if r.EnvoyGateway.Extension != nil {
68+
if r.EnvoyGateway.ExtensionManager != nil {
6969
var extGKs []schema.GroupKind
70-
for _, gvk := range r.EnvoyGateway.Extension.Resources {
70+
for _, gvk := range r.EnvoyGateway.ExtensionManager.Resources {
7171
extGKs = append(extGKs, schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind})
7272
}
7373
t.ExtensionGroupKinds = extGKs

internal/gatewayapi/runner/runner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestRunner(t *testing.T) {
3333
ProviderResources: pResources,
3434
XdsIR: xdsIR,
3535
InfraIR: infraIR,
36-
ExtensionManager: testutils.NewManager(egv1a1cfg.Extension{}),
36+
ExtensionManager: testutils.NewManager(egv1a1cfg.ExtensionManager{}),
3737
})
3838
ctx := context.Background()
3939
// Start

internal/provider/kubernetes/controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ func newGatewayAPIController(mgr manager.Manager, cfg *config.Server, su status.
7575

7676
// Gather additional resources to watch from registered extensions
7777
var extGVKs []schema.GroupVersionKind
78-
if cfg.EnvoyGateway.Extension != nil {
79-
for _, rsrc := range cfg.EnvoyGateway.Extension.Resources {
78+
if cfg.EnvoyGateway.ExtensionManager != nil {
79+
for _, rsrc := range cfg.EnvoyGateway.ExtensionManager.Resources {
8080
gvk := schema.GroupVersionKind(rsrc)
8181
extGVKs = append(extGVKs, gvk)
8282
}
@@ -1229,7 +1229,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M
12291229
}
12301230

12311231
// Watch EnvoyPatchPolicy if enabled in config
1232-
if r.envoyGateway.Gateway.ExtensionAPIs != nil && r.envoyGateway.Gateway.ExtensionAPIs.EnableEnvoyPatchPolicy {
1232+
if r.envoyGateway.ExtensionAPIs != nil && r.envoyGateway.ExtensionAPIs.EnableEnvoyPatchPolicy {
12331233
// Watch EnvoyPatchPolicy CRUDs
12341234
if err := c.Watch(
12351235
source.Kind(mgr.GetCache(), &egv1a1.EnvoyPatchPolicy{}),

internal/xds/translator/translator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func TestTranslateXdsWithExtension(t *testing.T) {
287287
ServiceURL: ratelimit.GetServiceURL("envoy-gateway-system", "cluster.local"),
288288
},
289289
}
290-
ext := v1alpha1.Extension{
290+
ext := v1alpha1.ExtensionManager{
291291
Resources: []v1alpha1.GroupVersionKind{
292292
{
293293
Group: "foo.example.io",

0 commit comments

Comments
 (0)