Skip to content

Commit

Permalink
operator: remove unused internal gateway api model
Browse files Browse the repository at this point in the history
This commit removes the unused and empty model within the gateway controller.

Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
  • Loading branch information
mhofstetter authored and pull[bot] committed Dec 27, 2023
1 parent 0f68ad4 commit 098d628
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 31 deletions.
22 changes: 2 additions & 20 deletions operator/pkg/gateway-api/controller.go
Expand Up @@ -37,9 +37,7 @@ const (
gatewayIndex = "gatewayIndex"
)

var (
scheme = runtime.NewScheme()
)
var scheme = runtime.NewScheme()

func init() {
utilruntime.Must(gatewayv1.AddToScheme(scheme))
Expand All @@ -49,15 +47,8 @@ func init() {
utilruntime.Must(ciliumv2.AddToScheme(scheme))
}

type internalModel struct {
// TODO(tam): I am not sure if we need to cache anything for performance gain,
// the client is reading from cache already.
}

type Controller struct {
mgr ctrl.Manager

model *internalModel
}

// NewController returns a new gateway controller, which is implemented
Expand All @@ -75,12 +66,9 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
return nil, err
}

m := new(internalModel)

gwcReconciler := &gatewayClassReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Model: m,
controllerName: controllerName,
}
if err = gwcReconciler.SetupWithManager(mgr); err != nil {
Expand All @@ -91,7 +79,6 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
SecretsNamespace: secretsNamespace,
Model: m,
controllerName: controllerName,
IdleTimeoutSeconds: idleTimeoutSeconds,
}
Expand All @@ -102,7 +89,6 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
hrReconciler := &httpRouteReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Model: m,
}
if err = hrReconciler.SetupWithManager(mgr); err != nil {
return nil, err
Expand All @@ -111,7 +97,6 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
grReconciler := &grpcRouteReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Model: m,
}
if err = grReconciler.SetupWithManager(mgr); err != nil {
return nil, err
Expand All @@ -120,7 +105,6 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
tlsReconciler := &tlsRouteReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Model: m,
}
if err = tlsReconciler.SetupWithManager(mgr); err != nil {
return nil, err
Expand All @@ -129,7 +113,6 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
rgReconciler := &referenceGrantReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Model: m,
}
if err = rgReconciler.SetupWithManager(mgr); err != nil {
return nil, err
Expand All @@ -148,8 +131,7 @@ func NewController(enableSecretSync bool, secretsNamespace string, idleTimeoutSe
}

return &Controller{
mgr: mgr,
model: m,
mgr: mgr,
}, nil
}

Expand Down
1 change: 0 additions & 1 deletion operator/pkg/gateway-api/gateway.go
Expand Up @@ -40,7 +40,6 @@ type gatewayReconciler struct {
IdleTimeoutSeconds int

controllerName string
Model *internalModel
}

// SetupWithManager sets up the controller with the Manager.
Expand Down
2 changes: 0 additions & 2 deletions operator/pkg/gateway-api/gatewayclass.go
Expand Up @@ -17,8 +17,6 @@ type gatewayClassReconciler struct {
client.Client
Scheme *runtime.Scheme

Model *internalModel

controllerName string
}

Expand Down
2 changes: 0 additions & 2 deletions operator/pkg/gateway-api/grpcroute.go
Expand Up @@ -28,8 +28,6 @@ import (
type grpcRouteReconciler struct {
client.Client
Scheme *runtime.Scheme

Model *internalModel
}

// SetupWithManager sets up the controller with the Manager.
Expand Down
2 changes: 0 additions & 2 deletions operator/pkg/gateway-api/httproute.go
Expand Up @@ -28,8 +28,6 @@ import (
type httpRouteReconciler struct {
client.Client
Scheme *runtime.Scheme

Model *internalModel
}

// SetupWithManager sets up the controller with the Manager.
Expand Down
2 changes: 0 additions & 2 deletions operator/pkg/gateway-api/referencegrant.go
Expand Up @@ -14,8 +14,6 @@ import (
type referenceGrantReconciler struct {
client.Client
Scheme *runtime.Scheme

Model *internalModel
}

// SetupWithManager sets up the controller with the Manager.
Expand Down
2 changes: 0 additions & 2 deletions operator/pkg/gateway-api/tlsroute.go
Expand Up @@ -28,8 +28,6 @@ import (
type tlsRouteReconciler struct {
client.Client
Scheme *runtime.Scheme

Model *internalModel
}

// SetupWithManager sets up the controller with the Manager.
Expand Down

0 comments on commit 098d628

Please sign in to comment.