Skip to content

Commit

Permalink
run lint
Browse files Browse the repository at this point in the history
Fix comments, add const
  • Loading branch information
lewisdenny committed Jun 23, 2023
1 parent 7c468ae commit b530cc0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/bases/neutron.openstack.org_neutronapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2096,8 +2096,8 @@ spec:
description: RouteAnnotations to be added to the created route
properties:
timeout:
default: "60"
description: HAProxy Timeout for route
description: Timeout - Provides the HAProxy Timeout value for
the route
type: string
type: object
secret:
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/neutronapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ type NeutronAPIDebug struct {
Service bool `json:"service"`
}

// NeutronRouteAnnotations defines the route annotations
type NeutronRouteAnnotations struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="60"
// HAProxy Timeout for route
// Timeout - Provides the HAProxy Timeout value for the route
Timeout string `json:"timeout"`
}

Expand Down
16 changes: 16 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config/crd/bases/neutron.openstack.org_neutronapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2096,8 +2096,8 @@ spec:
description: RouteAnnotations to be added to the created route
properties:
timeout:
default: "60"
description: HAProxy Timeout for route
description: Timeout - Provides the HAProxy Timeout value for
the route
type: string
type: object
secret:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/neutron_v1beta1_neutronapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ spec:
replicas: 1
secret: neutron-secret
routeAnnotations:
timeout: 120s
timeout: 120s
6 changes: 5 additions & 1 deletion controllers/neutronapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
routeTimeoutAnnotationName string = "haproxy.router.openshift.io/timeout"
)

// NeutronAPIReconciler reconciles a NeutronAPI object
type NeutronAPIReconciler struct {
client.Client
Expand Down Expand Up @@ -414,7 +418,7 @@ func (r *NeutronAPIReconciler) reconcileInit(

routeAnnotations := make(map[string]string)
if instance.Spec.RouteAnnotations.Timeout != "" {
routeAnnotations["haproxy.router.openshift.io/timeout"] = instance.Spec.RouteAnnotations.Timeout
routeAnnotations[routeTimeoutAnnotationName] = instance.Spec.RouteAnnotations.Timeout
}

apiEndpoints, ctrlResult, err := endpoint.ExposeEndpoints(
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,3 @@ require (
)

replace github.com/openstack-k8s-operators/neutron-operator/api => ./api

replace github.com/openstack-k8s-operators/lib-common/modules/common => /Users/ldenny/Code/openstack/openstack-operators/lib-common/modules/common

0 comments on commit b530cc0

Please sign in to comment.