@@ -34,7 +34,7 @@ import (
3434 "sigs.k8s.io/controller-runtime/pkg/client"
3535 "sigs.k8s.io/controller-runtime/pkg/log"
3636 "sigs.k8s.io/controller-runtime/pkg/source"
37- v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2 "
37+ gateway_api "sigs.k8s.io/gateway-api/apis/v1beta1 "
3838
3939 "github.com/aws/aws-application-networking-k8s/controllers/eventhandlers"
4040 "github.com/aws/aws-application-networking-k8s/pkg/aws"
@@ -112,13 +112,13 @@ func (r *GatewayReconciler) reconcile(ctx context.Context, req ctrl.Request) err
112112 gwLog := log .FromContext (ctx )
113113
114114 gwLog .Info ("GatewayReconciler" )
115- gw := & v1alpha2 .Gateway {}
115+ gw := & gateway_api .Gateway {}
116116
117117 if err := r .Client .Get (ctx , req .NamespacedName , gw ); err != nil {
118118 return client .IgnoreNotFound (err )
119119 }
120120
121- gwClass := & v1alpha2 .GatewayClass {}
121+ gwClass := & gateway_api .GatewayClass {}
122122 gwClassName := types.NamespacedName {
123123 Namespace : "default" ,
124124 Name : string (gw .Spec .GatewayClassName ),
@@ -135,7 +135,7 @@ func (r *GatewayReconciler) reconcile(ctx context.Context, req ctrl.Request) err
135135
136136 glog .V (6 ).Info (fmt .Sprintf ("Checking if gateway can be deleted %v\n " , gw .Name ))
137137
138- httpRouteList := & v1alpha2 .HTTPRouteList {}
138+ httpRouteList := & gateway_api .HTTPRouteList {}
139139
140140 r .Client .List (context .TODO (), httpRouteList )
141141 for _ , httpRoute := range httpRouteList .Items {
@@ -148,7 +148,7 @@ func (r *GatewayReconciler) reconcile(ctx context.Context, req ctrl.Request) err
148148 Name : string (httpRoute .Spec .ParentRefs [0 ].Name ),
149149 }
150150
151- httpGW := & v1alpha2 .Gateway {}
151+ httpGW := & gateway_api .Gateway {}
152152
153153 if err := r .Client .Get (context .TODO (), gwName , httpGW ); err != nil {
154154 continue
@@ -179,7 +179,7 @@ func (r *GatewayReconciler) reconcile(ctx context.Context, req ctrl.Request) err
179179 return nil
180180}
181181
182- func (r * GatewayReconciler ) buildAndDeployModel (ctx context.Context , gw * v1alpha2 .Gateway ) (core.Stack , * latticemodel.ServiceNetwork , error ) {
182+ func (r * GatewayReconciler ) buildAndDeployModel (ctx context.Context , gw * gateway_api .Gateway ) (core.Stack , * latticemodel.ServiceNetwork , error ) {
183183 gwLog := log .FromContext (ctx )
184184
185185 stack , serviceNetwork , err := r .modelBuilder .Build (ctx , gw )
@@ -204,7 +204,7 @@ func (r *GatewayReconciler) buildAndDeployModel(ctx context.Context, gw *v1alpha
204204
205205 return stack , serviceNetwork , err
206206}
207- func (r * GatewayReconciler ) reconcileGatewayResources (ctx context.Context , gw * v1alpha2 .Gateway ) error {
207+ func (r * GatewayReconciler ) reconcileGatewayResources (ctx context.Context , gw * gateway_api .Gateway ) error {
208208 gwLog := log .FromContext (ctx )
209209
210210 gwLog .Info ("reconcile gateway resource" )
@@ -238,13 +238,13 @@ func (r *GatewayReconciler) reconcileGatewayResources(ctx context.Context, gw *v
238238
239239}
240240
241- func (r * GatewayReconciler ) cleanupGatewayResources (ctx context.Context , gw * v1alpha2 .Gateway ) error {
241+ func (r * GatewayReconciler ) cleanupGatewayResources (ctx context.Context , gw * gateway_api .Gateway ) error {
242242 _ , _ , err := r .buildAndDeployModel (ctx , gw )
243243 return err
244244
245245}
246246
247- func (r * GatewayReconciler ) updateGatewayStatus (ctx context.Context , serviceNetworkStatus * latticestore.ServiceNetwork , gw * v1alpha2 .Gateway ) error {
247+ func (r * GatewayReconciler ) updateGatewayStatus (ctx context.Context , serviceNetworkStatus * latticestore.ServiceNetwork , gw * gateway_api .Gateway ) error {
248248
249249 gwOld := gw .DeepCopy ()
250250
@@ -272,9 +272,9 @@ func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error {
272272 gwClassEventHandler := eventhandlers .NewEnqueueRequestsForGatewayClassEvent (r .Client )
273273 return ctrl .NewControllerManagedBy (mgr ).
274274 // Uncomment the following line adding a pointer to an instance of the controlled resource as an argument
275- For (& v1alpha2 .Gateway {}).
275+ For (& gateway_api .Gateway {}).
276276 Watches (
277- & source.Kind {Type : & v1alpha2 .GatewayClass {}},
277+ & source.Kind {Type : & gateway_api .GatewayClass {}},
278278 gwClassEventHandler ).
279279 Complete (r )
280280}
0 commit comments