Skip to content

Commit

Permalink
fix gofmt formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Courtney Pacheco <cpacheco@redhat.com>
  • Loading branch information
courtneypacheco committed May 14, 2021
1 parent 1fa54f2 commit ad2404c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
9 changes: 4 additions & 5 deletions controllers/nodefeaturediscovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion controllers/nodefeaturediscovery_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions controllers/nodefeaturediscovery_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ad2404c

Please sign in to comment.