From 444e768e27fb1ac30b870e7aa1b701b3adf2e6a0 Mon Sep 17 00:00:00 2001 From: Kate Osborn Date: Thu, 27 Oct 2022 13:40:17 -0600 Subject: [PATCH] Enable fieldalignemt and fix errors --- .golangci.yml | 3 ++ cmd/gateway/setup.go | 10 ++-- cmd/gateway/setup_test.go | 56 ++++++++++---------- internal/events/event.go | 4 +- internal/events/first_eventbatch_preparer.go | 2 +- internal/events/handler.go | 4 +- internal/events/loop.go | 7 ++- internal/manager/controllers_test.go | 2 +- internal/manager/predicate/service.go | 2 +- internal/manager/predicate/service_test.go | 2 +- internal/nginx/config/http/config.go | 2 +- internal/nginx/config/servers.go | 8 +-- internal/nginx/config/servers_test.go | 6 +-- internal/nginx/config/split_clients_test.go | 4 +- internal/nginx/config/upstreams_test.go | 2 +- internal/nginx/runtime/manager_test.go | 2 +- internal/state/backend_group.go | 8 +-- internal/state/backend_refs_test.go | 4 +- internal/state/configuration.go | 16 +++--- internal/state/configuration_test.go | 8 +-- internal/state/graph.go | 4 +- internal/state/graph_test.go | 4 +- internal/state/listener.go | 8 +-- internal/state/listener_test.go | 4 +- internal/state/resolver/resolver_test.go | 2 +- internal/state/sort_test.go | 7 +-- internal/state/statuses.go | 10 ++-- internal/status/gatewayclass_test.go | 4 +- internal/status/updater.go | 12 ++--- 29 files changed, 105 insertions(+), 102 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 19c2d3eece..bdf95b45b5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,6 +32,9 @@ linters-settings: - name: var-naming gocyclo: min-complexity: 15 + govet: + enable: + - fieldalignment linters: enable: diff --git a/cmd/gateway/setup.go b/cmd/gateway/setup.go index 5084eb9324..b490151225 100644 --- a/cmd/gateway/setup.go +++ b/cmd/gateway/setup.go @@ -22,16 +22,16 @@ const ( type ( Validator func(*flag.FlagSet) error ValidatorContext struct { - Key string V Validator + Key string } ) func GatewayControllerParam(domain string) ValidatorContext { name := "gateway-ctlr-name" return ValidatorContext{ - name, - func(flagset *flag.FlagSet) error { + Key: name, + V: func(flagset *flag.FlagSet) error { param, err := flagset.GetString(name) if err != nil { return err @@ -68,8 +68,8 @@ func validateControllerName(name string) error { func GatewayClassParam() ValidatorContext { name := "gatewayclass" return ValidatorContext{ - name, - func(flagset *flag.FlagSet) error { + Key: name, + V: func(flagset *flag.FlagSet) error { param, err := flagset.GetString(name) if err != nil { return err diff --git a/cmd/gateway/setup_test.go b/cmd/gateway/setup_test.go index b966ae41ae..915d58283b 100644 --- a/cmd/gateway/setup_test.go +++ b/cmd/gateway/setup_test.go @@ -12,8 +12,8 @@ import ( func MockValidator(name string, called *int, succeed bool) ValidatorContext { return ValidatorContext{ - name, - func(_ *flag.FlagSet) error { + Key: name, + V: func(_ *flag.FlagSet) error { *called++ if !succeed { @@ -41,71 +41,71 @@ var _ = Describe("Main", func() { It("should call all validators", func() { var called int table := []struct { + Contexts []ValidatorContext ExpectedCalls int Success bool - Contexts []ValidatorContext }{ { - 0, - true, - []ValidatorContext{}, + Contexts: []ValidatorContext{}, + ExpectedCalls: 0, + Success: true, }, { - 0, - true, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("no-flag-set", &called, true), }, + ExpectedCalls: 0, + Success: true, }, { - 1, - true, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("validator-1", &called, true), }, + ExpectedCalls: 1, + Success: true, }, { - 1, - true, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("no-flag-set", &called, true), MockValidator("validator-1", &called, true), }, + ExpectedCalls: 1, + Success: true, }, { - 2, - true, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("validator-1", &called, true), MockValidator("validator-2", &called, true), }, + ExpectedCalls: 2, + Success: true, }, { - 3, - true, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("validator-1", &called, true), MockValidator("validator-2", &called, true), MockValidator("validator-3", &called, true), }, + ExpectedCalls: 3, + Success: true, }, { - 3, - false, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("validator-1", &called, false), MockValidator("validator-2", &called, true), MockValidator("validator-3", &called, true), }, + ExpectedCalls: 3, + Success: false, }, { - 3, - false, - []ValidatorContext{ + Contexts: []ValidatorContext{ MockValidator("validator-1", &called, true), MockValidator("validator-2", &called, true), MockValidator("validator-3", &called, false), }, + ExpectedCalls: 3, + Success: false, }, } @@ -120,9 +120,9 @@ var _ = Describe("Main", func() { Describe("CLI argument validation", func() { type testCase struct { + ValidatorContext ValidatorContext Flag string Value string - ValidatorContext ValidatorContext ExpError bool } diff --git a/internal/events/event.go b/internal/events/event.go index 344ef377fb..5cade7ce9a 100644 --- a/internal/events/event.go +++ b/internal/events/event.go @@ -17,8 +17,8 @@ type UpsertEvent struct { // DeleteEvent representing deleting a resource. type DeleteEvent struct { - // NamespacedName is the namespace & name of the deleted resource. - NamespacedName types.NamespacedName // Type is the resource type. For example, if the event is for *v1beta1.HTTPRoute, pass &v1beta1.HTTPRoute{} as Type. Type client.Object + // NamespacedName is the namespace & name of the deleted resource. + NamespacedName types.NamespacedName } diff --git a/internal/events/first_eventbatch_preparer.go b/internal/events/first_eventbatch_preparer.go index e91eeed5db..ad89e729ba 100644 --- a/internal/events/first_eventbatch_preparer.go +++ b/internal/events/first_eventbatch_preparer.go @@ -36,9 +36,9 @@ type EachListItemFunc func(obj runtime.Object, fn func(runtime.Object) error) er // FirstEventBatchPreparerImpl is an implementation of FirstEventBatchPreparer. type FirstEventBatchPreparerImpl struct { reader Reader + eachListItem EachListItemFunc objects []client.Object objectLists []client.ObjectList - eachListItem EachListItemFunc } // NewFirstEventBatchPreparerImpl creates a new FirstEventBatchPreparerImpl. diff --git a/internal/events/handler.go b/internal/events/handler.go index e053982333..d4ab3e415b 100644 --- a/internal/events/handler.go +++ b/internal/events/handler.go @@ -35,14 +35,14 @@ type EventHandlerConfig struct { SecretMemoryManager state.SecretDiskMemoryManager // Generator is the nginx config Generator. Generator config.Generator - // Logger is the logger to be used by the EventHandler. - Logger logr.Logger // NginxFileMgr is the file Manager for nginx. NginxFileMgr file.Manager // NginxRuntimeMgr manages nginx runtime. NginxRuntimeMgr runtime.Manager // StatusUpdater updates statuses on Kubernetes resources. StatusUpdater status.Updater + // Logger is the logger to be used by the EventHandler. + Logger logr.Logger } // EventHandlerImpl implements EventHandler. diff --git a/internal/events/loop.go b/internal/events/loop.go index 23df1b866b..ba15d2a7ae 100644 --- a/internal/events/loop.go +++ b/internal/events/loop.go @@ -22,11 +22,10 @@ import ( // FIXME(pleshakov): better document the side effects and how to prevent and mitigate them. // So when the EventLoop have 100 saved events, it is better to process them at once rather than one by one. type EventLoop struct { - eventCh <-chan interface{} - logger logr.Logger - handler EventHandler - + handler EventHandler preparer FirstEventBatchPreparer + eventCh <-chan interface{} + logger logr.Logger } // NewEventLoop creates a new EventLoop. diff --git a/internal/manager/controllers_test.go b/internal/manager/controllers_test.go index 9a35574032..4c21e9884a 100644 --- a/internal/manager/controllers_test.go +++ b/internal/manager/controllers_test.go @@ -48,8 +48,8 @@ func TestRegisterController(t *testing.T) { tests := []struct { fakes fakes expectedErr error - expectedMgrAddCallCount int msg string + expectedMgrAddCallCount int }{ { fakes: getDefaultFakes(), diff --git a/internal/manager/predicate/service.go b/internal/manager/predicate/service.go index eed0e9e2d2..9ac8a1b1e4 100644 --- a/internal/manager/predicate/service.go +++ b/internal/manager/predicate/service.go @@ -15,8 +15,8 @@ type ServicePortsChangedPredicate struct { // ports contains the ports that the Gateway cares about. type ports struct { - servicePort int32 targetPort intstr.IntOrString + servicePort int32 } // Update implements default UpdateEvent filter for validating Service port changes. diff --git a/internal/manager/predicate/service_test.go b/internal/manager/predicate/service_test.go index 007905b1a2..4a2493ebc9 100644 --- a/internal/manager/predicate/service_test.go +++ b/internal/manager/predicate/service_test.go @@ -11,9 +11,9 @@ import ( func TestServicePortsChangedPredicate_Update(t *testing.T) { testcases := []struct { - msg string objectOld client.Object objectNew client.Object + msg string expUpdate bool }{ { diff --git a/internal/nginx/config/http/config.go b/internal/nginx/config/http/config.go index bdb55a872e..9e4088d5a2 100644 --- a/internal/nginx/config/http/config.go +++ b/internal/nginx/config/http/config.go @@ -20,8 +20,8 @@ type Location struct { // Return represents an HTTP return. type Return struct { - Code StatusCode URL string + Code StatusCode } // SSL holds all SSL related configuration. diff --git a/internal/nginx/config/servers.go b/internal/nginx/config/servers.go index 2068fafd8d..87f38d9368 100644 --- a/internal/nginx/config/servers.go +++ b/internal/nginx/config/servers.go @@ -181,16 +181,16 @@ func createReturnValForRedirectFilter(filter *v1beta1.HTTPRequestRedirectFilter, // The NJS httpmatches module will lookup this variable on the request object and compare the request against the Method, Headers, and QueryParams contained in httpMatch. // If the request satisfies the httpMatch, the request will be internally redirected to the location RedirectPath by NGINX. type httpMatch struct { - // Any represents a match with no match conditions. - Any bool `json:"any,omitempty"` // Method is the HTTPMethod of the HTTPRouteMatch. Method v1beta1.HTTPMethod `json:"method,omitempty"` + // RedirectPath is the path to redirect the request to if the request satisfies the match conditions. + RedirectPath string `json:"redirectPath,omitempty"` // Headers is a list of HTTPHeaders name value pairs with the format "{name}:{value}". Headers []string `json:"headers,omitempty"` // QueryParams is a list of HTTPQueryParams name value pairs with the format "{name}={value}". QueryParams []string `json:"params,omitempty"` - // RedirectPath is the path to redirect the request to if the request satisfies the match conditions. - RedirectPath string `json:"redirectPath,omitempty"` + // Any represents a match with no match conditions. + Any bool `json:"any,omitempty"` } func createHTTPMatch(match v1beta1.HTTPRouteMatch, redirectPath string) httpMatch { diff --git a/internal/nginx/config/servers_test.go b/internal/nginx/config/servers_test.go index 2b6871bd85..490472e69d 100644 --- a/internal/nginx/config/servers_test.go +++ b/internal/nginx/config/servers_test.go @@ -67,10 +67,10 @@ func TestExecuteServers(t *testing.T) { func TestExecuteForDefaultServers(t *testing.T) { testcases := []struct { + msg string conf state.Configuration httpDefault bool sslDefault bool - msg string }{ { conf: state.Configuration{}, @@ -624,8 +624,8 @@ func TestCreateHTTPMatch(t *testing.T) { tests := []struct { match v1beta1.HTTPRouteMatch - expected httpMatch msg string + expected httpMatch }{ { match: v1beta1.HTTPRouteMatch{ @@ -781,8 +781,8 @@ func TestCreateHeaderKeyValString(t *testing.T) { func TestIsPathOnlyMatch(t *testing.T) { tests := []struct { match v1beta1.HTTPRouteMatch - expected bool msg string + expected bool }{ { match: v1beta1.HTTPRouteMatch{ diff --git a/internal/nginx/config/split_clients_test.go b/internal/nginx/config/split_clients_test.go index 10afa9fdee..749d078c51 100644 --- a/internal/nginx/config/split_clients_test.go +++ b/internal/nginx/config/split_clients_test.go @@ -405,8 +405,8 @@ func TestCreateSplitClientDistributions(t *testing.T) { func TestGetSplitClientValue(t *testing.T) { tests := []struct { msg string - backend state.BackendRef expValue string + backend state.BackendRef }{ { msg: "valid backend", @@ -598,8 +598,8 @@ func TestBackendGroupNeedsSplit(t *testing.T) { func TestBackendGroupName(t *testing.T) { tests := []struct { msg string - backends []state.BackendRef expName string + backends []state.BackendRef }{ { msg: "empty backends", diff --git a/internal/nginx/config/upstreams_test.go b/internal/nginx/config/upstreams_test.go index 8d2f526289..3713d16a99 100644 --- a/internal/nginx/config/upstreams_test.go +++ b/internal/nginx/config/upstreams_test.go @@ -142,9 +142,9 @@ func TestCreateUpstreams(t *testing.T) { func TestCreateUpstream(t *testing.T) { tests := []struct { + msg string stateUpstream state.Upstream expectedUpstream http.Upstream - msg string }{ { stateUpstream: state.Upstream{ diff --git a/internal/nginx/runtime/manager_test.go b/internal/nginx/runtime/manager_test.go index 21ac7d5a87..8d716f8d9d 100644 --- a/internal/nginx/runtime/manager_test.go +++ b/internal/nginx/runtime/manager_test.go @@ -20,9 +20,9 @@ func TestFindMainProcess(t *testing.T) { tests := []struct { readFile readFileFunc + msg string expected int expectError bool - msg string }{ { readFile: readFileFuncGen([]byte("1\n")), diff --git a/internal/state/backend_group.go b/internal/state/backend_group.go index 9c8b5be3fe..215932aa57 100644 --- a/internal/state/backend_group.go +++ b/internal/state/backend_group.go @@ -9,19 +9,19 @@ import ( // BackendGroup represents a group of backends for a rule in an HTTPRoute. type BackendGroup struct { - Errors []string Source types.NamespacedName - RuleIdx int + Errors []string Backends []BackendRef + RuleIdx int } // BackendRef is an internal representation of a backendRef in an HTTPRoute. type BackendRef struct { - Name string Svc *v1.Service + Name string Port int32 - Valid bool Weight int32 + Valid bool } // GroupName returns the name of the backend group. diff --git a/internal/state/backend_refs_test.go b/internal/state/backend_refs_test.go index 432b62c11b..3b4c10d6dd 100644 --- a/internal/state/backend_refs_test.go +++ b/internal/state/backend_refs_test.go @@ -31,8 +31,8 @@ func getModifiedRef(mod func(ref v1beta1.BackendRef) v1beta1.BackendRef) v1beta1 func TestValidateBackendRef(t *testing.T) { tests := []struct { - msg string ref v1beta1.BackendRef + msg string expErr bool }{ { @@ -107,9 +107,9 @@ func TestGetServiceAndPortFromRef(t *testing.T) { } tests := []struct { - msg string ref v1beta1.BackendRef expService *v1.Service + msg string expPort int32 expErr bool }{ diff --git a/internal/state/configuration.go b/internal/state/configuration.go index 28e9b4e1a4..0edb5bd04d 100644 --- a/internal/state/configuration.go +++ b/internal/state/configuration.go @@ -30,12 +30,12 @@ type Configuration struct { // VirtualServer is a virtual server. type VirtualServer struct { + // SSL holds the SSL configuration options for the server. + SSL *SSL // Hostname is the hostname of the server. Hostname string // PathRules is a collection of routing rules. PathRules []PathRule - // SSL holds the SSL configuration options fo the server. - SSL *SSL } type Upstream struct { @@ -69,18 +69,18 @@ type Filters struct { // An HTTPRoute is guaranteed to have at least one rule with one match. // If no rule or match is specified by the user, the default rule {{path:{ type: "PathPrefix", value: "/"}}} is set by the schema. type MatchRule struct { - // MatchIdx is the index of the rule in the Rule.Matches. - MatchIdx int - // RuleIdx is the index of the corresponding rule in the HTTPRoute. - RuleIdx int // Filters holds the filters for the MatchRule. Filters Filters - // BackendGroup is the group of Backends that the rule routes to. - BackendGroup BackendGroup // Source is the corresponding HTTPRoute resource. // FIXME(pleshakov): Consider referencing only the parts needed for the config generation rather than // the entire resource. Source *v1beta1.HTTPRoute + // BackendGroup is the group of Backends that the rule routes to. + BackendGroup BackendGroup + // MatchIdx is the index of the rule in the Rule.Matches. + MatchIdx int + // RuleIdx is the index of the corresponding rule in the HTTPRoute. + RuleIdx int } // GetMatch returns the HTTPRouteMatch of the Route . diff --git a/internal/state/configuration_test.go b/internal/state/configuration_test.go index e22b779e4d..9c5bf37f2c 100644 --- a/internal/state/configuration_test.go +++ b/internal/state/configuration_test.go @@ -239,9 +239,9 @@ func TestBuildConfiguration(t *testing.T) { tests := []struct { graph *graph - expConf Configuration expWarns Warnings msg string + expConf Configuration }{ { graph: &graph{ @@ -885,9 +885,9 @@ func TestCreateFilters(t *testing.T) { } tests := []struct { - filters []v1beta1.HTTPRouteFilter expected Filters msg string + filters []v1beta1.HTTPRouteFilter }{ { filters: []v1beta1.HTTPRouteFilter{}, @@ -960,9 +960,9 @@ func TestMatchRuleGetMatch(t *testing.T) { } tests := []struct { - name, + name string expPath string - rule MatchRule + rule MatchRule }{ { name: "first match in first rule", diff --git a/internal/state/graph.go b/internal/state/graph.go index 86c2267b5c..5ffdfdb9f7 100644 --- a/internal/state/graph.go +++ b/internal/state/graph.go @@ -41,10 +41,10 @@ type route struct { type gatewayClass struct { // Source is the source resource. Source *v1beta1.GatewayClass + // ErrorMsg explains the error when the resource is invalid. + ErrorMsg string // Valid shows whether the GatewayClass is valid. Valid bool - // ErrorMsg explains the error when the resource is not valid. - ErrorMsg string } // graph is a graph-like representation of Gateway API resources. diff --git a/internal/state/graph_test.go b/internal/state/graph_test.go index 30f97ee138..d85bfde758 100644 --- a/internal/state/graph_test.go +++ b/internal/state/graph_test.go @@ -830,10 +830,10 @@ func TestBindRouteToListeners(t *testing.T) { gw *v1beta1.Gateway ignoredGws map[types.NamespacedName]*v1beta1.Gateway listeners map[string]*listener - expectedIgnored bool expectedRoute *route expectedListeners map[string]*listener msg string + expectedIgnored bool }{ { httpRoute: createRoute("foo.example.com"), @@ -1042,9 +1042,9 @@ func TestFindAcceptedHostnames(t *testing.T) { tests := []struct { listenerHostname *v1beta1.Hostname + msg string routeHostnames []v1beta1.Hostname expected []string - msg string }{ { listenerHostname: &listenerHostnameFoo, diff --git a/internal/state/listener.go b/internal/state/listener.go index f7764e09e9..988895f17a 100644 --- a/internal/state/listener.go +++ b/internal/state/listener.go @@ -10,15 +10,15 @@ import ( type listener struct { // Source holds the source of the listener from the Gateway resource. Source v1beta1.Listener - // Valid shows whether the listener is valid. - Valid bool - // SecretPath is the path to the secret on disk. - SecretPath string // Routes holds the routes attached to the listener. Routes map[types.NamespacedName]*route // AcceptedHostnames is an intersection between the hostnames supported by the listener and the hostnames // from the attached routes. AcceptedHostnames map[string]struct{} + // SecretPath is the path to the secret on disk. + SecretPath string + // Valid shows whether the listener is valid. + Valid bool } type listenerConfigurator interface { diff --git a/internal/state/listener_test.go b/internal/state/listener_test.go index 4b55174e9b..2aa0d9eec7 100644 --- a/internal/state/listener_test.go +++ b/internal/state/listener_test.go @@ -11,8 +11,8 @@ import ( func TestValidateHTTPListener(t *testing.T) { tests := []struct { l v1beta1.Listener - expected bool msg string + expected bool }{ { l: v1beta1.Listener{ @@ -63,8 +63,8 @@ func TestValidateHTTPSListener(t *testing.T) { tests := []struct { l v1beta1.Listener - expected bool msg string + expected bool }{ { l: v1beta1.Listener{ diff --git a/internal/state/resolver/resolver_test.go b/internal/state/resolver/resolver_test.go index 0b02a427f1..3c0c3e1a91 100644 --- a/internal/state/resolver/resolver_test.go +++ b/internal/state/resolver/resolver_test.go @@ -293,8 +293,8 @@ func TestIgnoreEndpointSlice(t *testing.T) { func TestEndpointReady(t *testing.T) { testcases := []struct { - msg string endpoint discoveryV1.Endpoint + msg string ready bool }{ { diff --git a/internal/state/sort_test.go b/internal/state/sort_test.go index 8d44df22a0..dc991f07cc 100644 --- a/internal/state/sort_test.go +++ b/internal/state/sort_test.go @@ -210,9 +210,10 @@ func TestLessObjectMeta(t *testing.T) { later := metav1.NewTime(sooner.Add(10 * time.Millisecond)) tests := []struct { - meta1, meta2 *metav1.ObjectMeta - expected bool - msg string + meta1 *metav1.ObjectMeta + meta2 *metav1.ObjectMeta + msg string + expected bool }{ { meta1: &metav1.ObjectMeta{ diff --git a/internal/state/statuses.go b/internal/state/statuses.go index f3f0eb4de7..ee99de00cd 100644 --- a/internal/state/statuses.go +++ b/internal/state/statuses.go @@ -21,8 +21,8 @@ type Statuses struct { // GatewayStatus holds the status of the winning Gateway resource. type GatewayStatus struct { - NsName types.NamespacedName ListenerStatuses ListenerStatuses + NsName types.NamespacedName } // IgnoredGatewayStatuses holds the statuses of the ignored Gateway resources. @@ -46,10 +46,10 @@ type ParentStatuses map[string]ParentStatus // HTTPRouteStatus holds the status-related information about an HTTPRoute resource. type HTTPRouteStatus struct { - // ObservedGeneration is the generation of the resource that was processed. - ObservedGeneration int64 // ParentStatuses holds the statuses for parentRefs of the HTTPRoute. ParentStatuses ParentStatuses + // ObservedGeneration is the generation of the resource that was processed. + ObservedGeneration int64 } // ParentStatus holds status-related information related to how the HTTPRoute binds to a specific parentRef. @@ -60,12 +60,12 @@ type ParentStatus struct { // GatewayClassStatus holds status-related infortmation about the GatewayClass resource. type GatewayClassStatus struct { - // Valid shows if the resource is valid. - Valid bool // ErrorMsg describe the error when the resource is invalid. ErrorMsg string // ObservedGeneration is the generation of the resource that was processed. ObservedGeneration int64 + // Valid shows if the resource is valid. + Valid bool } // buildStatuses builds statuses from a graph. diff --git a/internal/status/gatewayclass_test.go b/internal/status/gatewayclass_test.go index 5b810bc119..f57a99d33f 100644 --- a/internal/status/gatewayclass_test.go +++ b/internal/status/gatewayclass_test.go @@ -15,9 +15,9 @@ func TestPrepareGatewayClassStatus(t *testing.T) { transitionTime := metav1.NewTime(time.Now()) tests := []struct { - status state.GatewayClassStatus - expected v1beta1.GatewayClassStatus msg string + expected v1beta1.GatewayClassStatus + status state.GatewayClassStatus }{ { status: state.GatewayClassStatus{ diff --git a/internal/status/updater.go b/internal/status/updater.go index d276ae1ebb..350edda041 100644 --- a/internal/status/updater.go +++ b/internal/status/updater.go @@ -22,16 +22,16 @@ type Updater interface { // UpdaterConfig holds configuration parameters for Updater. type UpdaterConfig struct { - // GatewayCtlrName is the name of the Gateway controller. - GatewayCtlrName string - // GatewayClassName is the name of the GatewayClass resource. - GatewayClassName string // Client is a Kubernetes API client. Client client.Client - // Logger holds a logger to be used. - Logger logr.Logger // Clock is used as a source of time for the LastTransitionTime field in Conditions in resource statuses. Clock Clock + // Logger holds a logger to be used. + Logger logr.Logger + // GatewayCtlrName is the name of the Gateway controller. + GatewayCtlrName string + // GatewayClassName is the name of the GatewayClass resource. + GatewayClassName string } // updaterImpl updates statuses of the Gateway API resources.