8
8
9
9
"github.com/go-logr/logr"
10
10
ngxclient "github.com/nginxinc/nginx-plus-go-client/client"
11
- apiv1 "k8s.io/api/core/v1"
12
11
v1 "k8s.io/api/core/v1"
13
12
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14
13
"k8s.io/apimachinery/pkg/types"
@@ -20,7 +19,7 @@ import (
20
19
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/events"
21
20
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/helpers"
22
21
frameworkStatus "github.com/nginxinc/nginx-gateway-fabric/internal/framework/status"
23
- "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/config"
22
+
24
23
ngfConfig "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/config"
25
24
ngxConfig "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/nginx/config"
26
25
"github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/nginx/file"
@@ -75,7 +74,7 @@ type eventHandlerConfig struct {
75
74
// eventRecorder records events for Kubernetes resources.
76
75
eventRecorder record.EventRecorder
77
76
// usageReportConfig contains the configuration for NGINX Plus usage reporting.
78
- usageReportConfig * config .UsageReportConfig
77
+ usageReportConfig * ngfConfig .UsageReportConfig
79
78
// nginxConfiguredOnStartChecker sets the health of the Pod to Ready once we've written out our initial config.
80
79
nginxConfiguredOnStartChecker * nginxConfiguredOnStartChecker
81
80
// gatewayPodConfig contains information about this Pod.
@@ -89,7 +88,7 @@ type eventHandlerConfig struct {
89
88
}
90
89
91
90
const (
92
- // groups for GroupStatusUpdater
91
+ // groups for GroupStatusUpdater.
93
92
groupAllExceptGateways = "all-graphs-except-gateways"
94
93
groupGateways = "gateways"
95
94
groupControlPlane = "control-plane"
@@ -308,7 +307,7 @@ func (h *eventHandlerImpl) parseAndCaptureEvent(ctx context.Context, logger logr
308
307
}
309
308
}
310
309
311
- // updateNginxConf updates nginx conf files and reloads nginx
310
+ // updateNginxConf updates nginx conf files and reloads nginx.
312
311
func (h * eventHandlerImpl ) updateNginxConf (ctx context.Context , conf dataplane.Configuration ) error {
313
312
files := h .cfg .generator .Generate (conf )
314
313
if err := h .cfg .nginxFileMgr .ReplaceFiles (files ); err != nil {
@@ -324,7 +323,7 @@ func (h *eventHandlerImpl) updateNginxConf(ctx context.Context, conf dataplane.C
324
323
325
324
// updateUpstreamServers is called only when endpoints have changed. It updates nginx conf files and then:
326
325
// - if using NGINX Plus, determines which servers have changed and uses the N+ API to update them;
327
- // - otherwise if not using NGINX Plus, or an error was returned from the API, reloads nginx
326
+ // - otherwise if not using NGINX Plus, or an error was returned from the API, reloads nginx.
328
327
func (h * eventHandlerImpl ) updateUpstreamServers (
329
328
ctx context.Context ,
330
329
logger logr.Logger ,
@@ -410,7 +409,7 @@ func serversEqual(newServers []ngxclient.UpstreamServer, oldServers []ngxclient.
410
409
}
411
410
412
411
// updateControlPlaneAndSetStatus updates the control plane configuration and then sets the status
413
- // based on the outcome
412
+ // based on the outcome.
414
413
func (h * eventHandlerImpl ) updateControlPlaneAndSetStatus (
415
414
ctx context.Context ,
416
415
logger logr.Logger ,
@@ -429,7 +428,7 @@ func (h *eventHandlerImpl) updateControlPlaneAndSetStatus(
429
428
logger .Error (err , msg )
430
429
h .cfg .eventRecorder .Eventf (
431
430
cfg ,
432
- apiv1 .EventTypeWarning ,
431
+ v1 .EventTypeWarning ,
433
432
"UpdateFailed" ,
434
433
msg + ": %s" ,
435
434
err .Error (),
@@ -454,7 +453,7 @@ func getGatewayAddresses(
454
453
ctx context.Context ,
455
454
k8sClient client.Client ,
456
455
svc * v1.Service ,
457
- podConfig config .GatewayPodConfig ,
456
+ podConfig ngfConfig .GatewayPodConfig ,
458
457
) ([]gatewayv1.GatewayStatusAddress , error ) {
459
458
podAddress := []gatewayv1.GatewayStatusAddress {
460
459
{
0 commit comments