From ad2404cee93a617dd394ab6ef84769d3450f162b Mon Sep 17 00:00:00 2001 From: Courtney Pacheco Date: Fri, 14 May 2021 16:31:39 -0400 Subject: [PATCH] fix gofmt formatting Signed-off-by: Courtney Pacheco --- controllers/nodefeaturediscovery_controller.go | 9 ++++----- controllers/nodefeaturediscovery_resources.go | 1 - controllers/nodefeaturediscovery_state.go | 8 ++++---- main.go | 14 +++++++------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/controllers/nodefeaturediscovery_controller.go b/controllers/nodefeaturediscovery_controller.go index 67d9fc59..143007ba 100644 --- a/controllers/nodefeaturediscovery_controller.go +++ b/controllers/nodefeaturediscovery_controller.go @@ -54,15 +54,15 @@ type NodeFeatureDiscoveryReconciler struct { client.Client // Log is used to log the reconciliation. Every controllers needs this. - Log logr.Logger + Log logr.Logger // Scheme is used by the kubebuilder library to set OwnerReferences. Every // controller needs this. - Scheme *runtime.Scheme + Scheme *runtime.Scheme // Recorder defines interfaces for working with OCP event recorders. This // field is needed by NFD in order for NFD to write events. - Recorder record.EventRecorder + Recorder record.EventRecorder // AssetsDir defines the directory with assets under the operator image AssetsDir string @@ -74,7 +74,7 @@ type NodeFeatureDiscoveryReconciler struct { // struct. func (r *NodeFeatureDiscoveryReconciler) SetupWithManager(mgr ctrl.Manager) error { - // The predicate package is used by the controller to filter events before + // The predicate package is used by the controller to filter events before // they are sent to event handlers. When "UpdateFunc" is used, it will // return "true" if a given update event should be processed. In this case, // the "validateUpdateEvent" function is used with UpdateFunc to initate the @@ -163,7 +163,6 @@ func (r *NodeFeatureDiscoveryReconciler) Reconcile(ctx context.Context, req ctrl instance := &nfdv1.NodeFeatureDiscovery{} err := r.Get(ctx, req.NamespacedName, instance) - // If an error occurs because "r.Get" cannot get the NFD instance // (e.g., due to timeouts, aborts, etc. defined by ctx), the // request likely needs to be requeued. diff --git a/controllers/nodefeaturediscovery_resources.go b/controllers/nodefeaturediscovery_resources.go index b9888d36..2b416567 100644 --- a/controllers/nodefeaturediscovery_resources.go +++ b/controllers/nodefeaturediscovery_resources.go @@ -118,7 +118,6 @@ func getAssetsFrom(path string) []assetsFromFile { return manifests } - func addResourcesControls(path string) (Resources, controlFunc) { // res is a Resources object that contains information about diff --git a/controllers/nodefeaturediscovery_state.go b/controllers/nodefeaturediscovery_state.go index 6b5cd427..2b865928 100644 --- a/controllers/nodefeaturediscovery_state.go +++ b/controllers/nodefeaturediscovery_state.go @@ -32,18 +32,18 @@ type NFD struct { // controls is a list that contains the status of an NFD resource // as being Ready (=0) or NotReady (=1) - controls []controlFunc + controls []controlFunc // rec represents the NFD reconciler struct used for reconciliation - rec *NodeFeatureDiscoveryReconciler + rec *NodeFeatureDiscoveryReconciler // ins is the NodeFeatureDiscovery struct that contains the Schema // for the nodefeaturediscoveries API - ins *nfdv1.NodeFeatureDiscovery + ins *nfdv1.NodeFeatureDiscovery // idx is the index that is used to step through the 'controls' list // and is set to 0 upon calling 'init()' - idx int + idx int } // addState takes a given path and finds resources in that path, then diff --git a/main.go b/main.go index 6d574d24..154cc47c 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,7 @@ import ( var ( // scheme holds a new scheme for the operator - scheme = runtime.NewScheme() + scheme = runtime.NewScheme() // setupLog will be used for logging the operator "setup" process so that users know // what parts of the logging are associated with the setup of the manager and @@ -59,14 +59,14 @@ func main() { // The bind address tells Prometheus which port to scrape this data's metrics from. var metricsAddr string - // enableLeaderElection should be set to 'disable' by default If we enable leader - // election, then only one node can run the controller manager and we will not - // have NFD Operator running on all nodes. + // enableLeaderElection should be set to 'disable' by default If we enable leader + // election, then only one node can run the controller manager and we will not + // have NFD Operator running on all nodes. var enableLeaderElection bool - // probeAddr is responsible for the health probe bind address, where the health - // probe is responsible for determining liveness, readiness, and configuration - // of the operator pods. + // probeAddr is responsible for the health probe bind address, where the health + // probe is responsible for determining liveness, readiness, and configuration + // of the operator pods. var probeAddr string // The following 3 lines setup the CLI arguments that are used upon initilization of