From 5b2eee07ab4976a4a3383cd4a2b41f8ea184ee69 Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Tue, 26 Jan 2021 10:48:54 -0600 Subject: [PATCH] Fix formatting issues Signed-off-by: Sean Eagan Change-Id: Idb3332e8b387b08b100e18767961541311118588 --- .../airship.airshipit.org_sipclusters.yaml | 2 +- pkg/services/loadbalancer.go | 22 ++++++------ pkg/services/set.go | 34 +++++++++---------- testutil/testutil.go | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/config/crd/bases/airship.airshipit.org_sipclusters.yaml b/config/crd/bases/airship.airshipit.org_sipclusters.yaml index ba68814..1ab4293 100644 --- a/config/crd/bases/airship.airshipit.org_sipclusters.yaml +++ b/config/crd/bases/airship.airshipit.org_sipclusters.yaml @@ -45,7 +45,7 @@ spec: type: string nodeInterfaceId: type: string - nodePorts: + nodePort: type: integer nodelabels: additionalProperties: diff --git a/pkg/services/loadbalancer.go b/pkg/services/loadbalancer.go index e3ebe03..acfed4e 100644 --- a/pkg/services/loadbalancer.go +++ b/pkg/services/loadbalancer.go @@ -39,9 +39,9 @@ func (lb loadBalancer) Deploy() error { lb.config.Image = DefaultBalancerImage } if lb.config.NodePort < 30000 || lb.config.NodePort > 32767 { - lb.logger.Info("Either NodePort is not defined in the CR or NodePort is not in the required range of 30000-32767") - return nil - } + lb.logger.Info("Either NodePort is not defined in the CR or NodePort is not in the required range of 30000-32767") + return nil + } pod, secret, err := lb.generatePodAndSecret() if err != nil { @@ -186,11 +186,11 @@ type backend struct { } type loadBalancer struct { - client client.Client - sipName types.NamespacedName - logger logr.Logger - config airshipv1.InfraConfig - machines *airshipvms.MachineList + client client.Client + sipName types.NamespacedName + logger logr.Logger + config airshipv1.InfraConfig + machines *airshipvms.MachineList } func newLB(name, namespace string, @@ -211,13 +211,13 @@ func newLB(name, namespace string, } func (lb loadBalancer) Finalize() error { - // implete to delete loadbalancer - return nil + // implete to delete loadbalancer + return nil } // Type type of the service func (lb loadBalancer) Type() airshipv1.InfraService { - return airshipv1.LoadBalancerService + return airshipv1.LoadBalancerService } func generateTemplate(p proxy) ([]byte, error) { diff --git a/pkg/services/set.go b/pkg/services/set.go index 69d50a6..0fdda52 100644 --- a/pkg/services/set.go +++ b/pkg/services/set.go @@ -86,24 +86,24 @@ func (ss ServiceSet) Finalize() error { return ss.client.Delete(context.TODO(), serviceNamespace) } -func CreateNS (serviceNamespaceName string, c client.Client) error { - ns := &corev1.Namespace{} - key := client.ObjectKey{Name: serviceNamespaceName} - if err := c.Get(context.Background(), key, ns); err == nil { - // Namespace already exists - return nil - } +func CreateNS(serviceNamespaceName string, c client.Client) error { + ns := &corev1.Namespace{} + key := client.ObjectKey{Name: serviceNamespaceName} + if err := c.Get(context.Background(), key, ns); err == nil { + // Namespace already exists + return nil + } - serviceNamespace := &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Namespace", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: serviceNamespaceName, - }, - } - return c.Create(context.TODO(), serviceNamespace) + serviceNamespace := &corev1.Namespace{ + TypeMeta: metav1.TypeMeta{ + APIVersion: corev1.SchemeGroupVersion.String(), + Kind: "Namespace", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: serviceNamespaceName, + }, + } + return c.Create(context.TODO(), serviceNamespace) } // ServiceList returns all services defined in Set diff --git a/testutil/testutil.go b/testutil/testutil.go index b6de24f..21317ed 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -232,7 +232,7 @@ func CreateSIPCluster(name string, namespace string, masters int, workers int) * InfraServices: map[airshipv1.InfraService]airshipv1.InfraConfig{ airshipv1.LoadBalancerService: { NodeInterface: "eno3", - NodePort: 30000, + NodePort: 30000, }, }, },