Repository: metal3-io/baremetal-operator
Pull request #1600 (2024-03-06 10:14:39)

[release-0.5] 🌱 Add golangci-lint github workflow
This is an automated cherry-pick of #1394

/assign kashifest


Patch:
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
new file mode 100644
index 00000000..4f232cd2
--- /dev/null
+++ b/.github/workflows/golangci-lint.yml
@@ -0,0 +1,35 @@
+name: golangci-lint
+
+on:
+  pull_request:
+    types: [opened, edited, synchronize, reopened]
+
+# Remove all permissions from GITHUB_TOKEN except metadata.
+permissions: {}
+
+jobs:
+  golangci:
+    name: lint
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        working-directory:
+          - ""
+          - test
+          - apis
+          - pkg/hardwareutils
+    steps:
+      - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+      - name: Calculate go version
+        id: vars
+        run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
+      - name: Set up Go
+        uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+        with:
+          go-version: ${{ steps.vars.outputs.go_version }}
+      - name: golangci-lint-${{matrix.working-directory}}
+        uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
+        with:
+          version: v1.54.2
+          working-directory: ${{matrix.working-directory}}
diff --git a/.golangci.yaml b/.golangci.yaml
new file mode 100644
index 00000000..19aaf51d
--- /dev/null
+++ b/.golangci.yaml
@@ -0,0 +1,160 @@
+run:
+  deadline: 5m
+  skip-dirs:
+    - mock*
+  skip-files:
+    - "zz_generated.*\\.go$"
+    - ".*conversion.*\\.go$"
+linters:
+  disable-all: true
+  enable:
+    - asciicheck
+    - bodyclose
+    - dogsled
+    # - errcheck
+    # - errorlint
+    - exportloopref
+    # - goconst
+    # - gocritic
+    # - godot
+    # - gofmt
+    # - goimports
+    # - gosimple
+    # - govet
+    # - importas
+    # - gosec
+    # - ineffassign
+    # - misspell
+    # - nakedret
+    # - nilerr
+    # - noctx
+    # - nolintlint
+    # - prealloc
+    # - predeclared
+    # - revive
+    # - rowserrcheck
+    # - staticcheck
+    # - stylecheck
+    # - thelper
+    # - typecheck
+    # - unconvert
+    # - unused
+    # - whitespace
+  # Run with --fast=false for more extensive checks
+  fast: true
+
+linters-settings:
+  gosec:
+    go: "1.20"
+    severity: medium
+    confidence: medium
+    concurrency: 8
+  importas:
+    no-unaliased: true
+    alias:
+      # Kubernetes
+      - pkg: k8s.io/api/core/v1
+        alias: corev1
+      - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
+        alias: apiextensionsv1
+      - pkg: k8s.io/apimachinery/pkg/apis/meta/v1
+        alias: metav1
+      - pkg: k8s.io/apimachinery/pkg/api/errors
+        alias: k8serrors
+      - pkg: k8s.io/apimachinery/pkg/util/errors
+        alias: kerrors
+      - pkg: k8s.io/component-base/logs/api/v1
+        alias: logsv1
+      # Controller Runtime
+      - pkg: sigs.k8s.io/controller-runtime
+        alias: ctrl
+      # BMO
+      - pkg: github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1
+        alias: metal3api
+  nolintlint:
+    allow-unused: false
+    allow-leading-space: false
+    require-specific: true
+  staticcheck:
+    go: "1.20"
+  stylecheck:
+    go: "1.20"
+  gocritic:
+    enabled-tags:
+      - experimental
+    disabled-checks:
+      - appendAssign
+      - dupImport # https://github.com/go-critic/go-critic/issues/845
+      - evalOrder
+      - ifElseChain
+      - octalLiteral
+      - regexpSimplify
+      - sloppyReassign
+      - truncateCmp
+      - typeDefFirst
+      - unnamedResult
+      - unnecessaryDefer
+      - whyNoLint
+      - wrapperFunc
+  unused:
+    go: "1.20"
+issues:
+  exclude-rules:
+    - path: test/e2e
+      linters:
+        - gosec
+    - path: _test\.go
+      linters:
+        - unused
+    # Specific exclude rules for deprecated fields that are still part of the codebase.
+    # These should be removed as the referenced deprecated item is removed from the project.
+    - linters:
+        - staticcheck
+      text: "SA1019:"
+    # Disable linters for conversion
+    - linters:
+        - staticcheck
+      text: "SA1019:"
+      path: .*(api|types)\/.*\/conversion.*\.go$
+    # Dot imports for gomega or ginkgo are allowed
+    # within test files.
+    - path: _test\.go
+      text: should not use dot imports
+    - path: (test|e2e)/.*.go
+      text: should not use dot imports
+    - linters:
+        - revive
+      text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
+    # Exclude some packages or code to require comments, for example test code, or fake clients.
+    - linters:
+        - revive
+      text: exported (method|function|type|const) (.+) should have comment or be unexported
+      source: (func|type).*Fake.*
+    - linters:
+        - revive
+      text: exported (method|function|type|const) (.+) should have comment or be unexported
+      path: fake_\.go
+    - linters:
+        - revive
+      text: exported (method|function|type|const) (.+) should have comment or be unexported
+      path: .*(api|types)\/.*\/conversion.*\.go$
+    - linters:
+        - revive
+      text: "var-naming: don't use underscores in Go names;"
+      path: .*(api|types)\/.*\/conversion.*\.go$
+    - linters:
+        - revive
+      text: "receiver-naming: receiver name"
+      path: .*(api|types)\/.*\/conversion.*\.go$
+    - linters:
+        - stylecheck
+      text: "ST1003: should not use underscores in Go names;"
+      path: .*(api|types)\/.*\/conversion.*\.go$
+    - linters:
+        - stylecheck
+      text: "ST1016: methods on the same type should have the same receiver name"
+      path: .*(api|types)\/.*\/conversion.*\.go$
+  include:
+    - EXC0002 # include "missing comments" issues from golangci-lint
+  max-issues-per-linter: 0
+  max-same-issues: 0
diff --git a/.golangci.yml b/.golangci.yml
deleted file mode 100644
index 2ce83b39..00000000
--- a/.golangci.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-run:
-  timeout: "5m"
-
-linters:
-  disable-all: true
-  enable: [
-    "revive",
-    "govet",
-    "goimports",
-    "gofmt",
-    "gosec",
-    "staticcheck",
-  ]
-
-linters-settings:
-  goimports:
-    local-prefixes: "github.com/metal3-io/baremetal-operator"
-  govet:
-    check-shadowing: false
-
-issues:
-  max-issues-per-linter: 0
-  max-same-issues: 0
-  exclude-rules:
-  - linters:
-    - staticcheck
-    text: "SA1019:"
-  # Dot imports for gomega and ginkgo are allowed
-  # within test files and test utils.
-  - linters:
-    - revive
-    - stylecheck
-    path: _test\.go
-    text: should not use dot imports
-  - linters:
-    - revive
-    - stylecheck
-    path: (e2e)/.*.go
-    text: should not use dot imports
diff --git a/cmd/get-hardware-details/main.go b/cmd/get-hardware-details/main.go
index c06dc7fc..f51cfcef 100644
--- a/cmd/get-hardware-details/main.go
+++ b/cmd/get-hardware-details/main.go
@@ -28,7 +28,7 @@ func main() {
 	ironicTrustedCAFile := os.Getenv("IRONIC_CACERT_FILE")
 	ironicInsecureStr := os.Getenv("IRONIC_INSECURE")
 	ironicInsecure := false
-	if strings.ToLower(ironicInsecureStr) == "true" {
+	if strings.EqualFold(ironicInsecureStr, "true") {
 		ironicInsecure = true
 	}
 
diff --git a/cmd/make-bm-worker/main.go b/cmd/make-bm-worker/main.go
index 5eac99d8..3bf4c695 100644
--- a/cmd/make-bm-worker/main.go
+++ b/cmd/make-bm-worker/main.go
@@ -105,5 +105,4 @@ func main() {
 	}
 
 	fmt.Fprint(os.Stdout, result)
-
 }
diff --git a/cmd/make-virt-host/main.go b/cmd/make-virt-host/main.go
index b1fc2baa..b5130665 100644
--- a/cmd/make-virt-host/main.go
+++ b/cmd/make-virt-host/main.go
@@ -29,26 +29,26 @@ const (
    </interface>
 */
 
-// MAC is a hardware address for a NIC
+// MAC is a hardware address for a NIC.
 type MAC struct {
 	XMLName xml.Name `xml:"mac"`
 	Address string   `xml:"address,attr"`
 }
 
-// Source is the network to which the interface is attached
+// Source is the network to which the interface is attached.
 type Source struct {
 	XMLName xml.Name `xml:"source"`
 	Bridge  string   `xml:"bridge,attr"`
 }
 
-// Interface is one NIC
+// Interface is one NIC.
 type Interface struct {
 	XMLName xml.Name `xml:"interface"`
 	MAC     MAC      `xml:"mac"`
 	Source  Source   `xml:"source"`
 }
 
-// Domain is the main tag for the XML document
+// Domain is the main tag for the XML document.
 type Domain struct {
 	Interfaces []Interface `xml:"devices>interface"`
 }
@@ -113,7 +113,7 @@ vbmc list -f json -c 'Domain name' -c Port
 */
 
 // VBMC holds the parameters for describing a virtual machine
-// controller
+// controller.
 type VBMC struct {
 	Port int    `json:"Port"`
 	Name string `json:"Domain name"`
diff --git a/controllers/metal3.io/action_result.go b/controllers/metal3.io/action_result.go
index 33df2e5f..eb1d7fed 100644
--- a/controllers/metal3.io/action_result.go
+++ b/controllers/metal3.io/action_result.go
@@ -8,12 +8,12 @@ import (
 
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
 
-	metal3 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner"
 )
 
 // This is an upper limit for the ErrorCount, so that the max backoff
-// timeout will not exceed (roughly) 8 hours
+// timeout will not exceed (roughly) 8 hours.
 const maxBackOffCount = 9
 
 func init() {
@@ -57,7 +57,7 @@ func (r actionUpdate) Dirty() bool {
 }
 
 // actionDelayed it's the same of an actionUpdate, but the requeue time
-// is calculated using a fixed backoff with jitter
+// is calculated using a fixed backoff with jitter.
 type actionDelayed struct {
 	actionUpdate
 }
@@ -120,7 +120,7 @@ func (r actionError) NeedsRegistration() bool {
 // and that the resource should be marked as in error.
 type actionFailed struct {
 	dirty      bool
-	ErrorType  metal3.ErrorType
+	ErrorType  metal3api.ErrorType
 	errorCount int
 }
 
@@ -133,9 +133,8 @@ type actionFailed struct {
 // 6  [32m, 1h4m]
 // 7  [1h4m, 2h8m]
 // 8  [2h8m, 4h16m]
-// 9  [4h16m, 8h32m]
+// 9  [4h16m, 8h32m].
 func calculateBackoff(errorCount int) time.Duration {
-
 	if errorCount > maxBackOffCount {
 		errorCount = maxBackOffCount
 	}
diff --git a/controllers/metal3.io/baremetalhost_controller.go b/controllers/metal3.io/baremetalhost_controller.go
index d9e7b0ad..6b68f7f4 100644
--- a/controllers/metal3.io/baremetalhost_controller.go
+++ b/controllers/metal3.io/baremetalhost_controller.go
@@ -59,7 +59,7 @@ const (
 	hardwareDataFinalizer         = metal3api.BareMetalHostFinalizer + "/hardwareData"
 )
 
-// BareMetalHostReconciler reconciles a BareMetalHost object
+// BareMetalHostReconciler reconciles a BareMetalHost object.
 type BareMetalHostReconciler struct {
 	client.Client
 	Log                logr.Logger
@@ -68,7 +68,7 @@ type BareMetalHostReconciler struct {
 }
 
 // Instead of passing a zillion arguments to the action of a phase,
-// hold them in a context
+// hold them in a context.
 type reconcileInfo struct {
 	log               logr.Logger
 	host              *metal3api.BareMetalHost
@@ -79,7 +79,7 @@ type reconcileInfo struct {
 	postSaveCallbacks []func()
 }
 
-// match the provisioner.EventPublisher interface
+// match the provisioner.EventPublisher interface.
 func (info *reconcileInfo) publishEvent(reason, message string) {
 	info.events = append(info.events, info.host.NewEvent(reason, message))
 }
@@ -98,9 +98,8 @@ func (info *reconcileInfo) publishEvent(reason, message string) {
 //+kubebuilder:rbac:groups=metal3.io,resources=firmwareschemas,verbs=get;list;watch;create;update;patch
 //+kubebuilder:rbac:groups=metal3.io,resources=bmceventsubscriptions,verbs=get;list;watch;create;update;patch
 
-// Reconcile handles changes to BareMetalHost resources
+// Reconcile handles changes to BareMetalHost resources.
 func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Request) (result ctrl.Result, err error) {
-
 	reconcileCounters.With(hostMetricLabels(request)).Inc()
 	defer func() {
 		if err != nil {
@@ -232,7 +231,6 @@ func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Re
 	// over when there is an unrecoverable error (tracked through the
 	// error state of the host).
 	if actResult.Dirty() {
-
 		// Save Host
 		info.log.Info("saving host status",
 			"operational status", host.OperationalStatus(),
@@ -258,7 +256,7 @@ func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Re
 }
 
 // Consume inspect.metal3.io/hardwaredetails when either
-// inspect.metal3.io=disabled or there are no existing HardwareDetails
+// inspect.metal3.io=disabled or there are no existing HardwareDetails.
 func (r *BareMetalHostReconciler) updateHardwareDetails(request ctrl.Request, host *metal3api.BareMetalHost) (bool, error) {
 	updated := false
 	if host.Status.HardwareDetails == nil || inspectionDisabled(host) {
@@ -307,7 +305,6 @@ func logResult(info *reconcileInfo, result ctrl.Result) {
 }
 
 func recordActionFailure(info *reconcileInfo, errorType metal3api.ErrorType, errorMessage string) actionFailed {
-
 	setErrorMessage(info.host, errorType, errorMessage)
 
 	eventType := map[metal3api.ErrorType]string{
@@ -379,7 +376,7 @@ func (r *BareMetalHostReconciler) credentialsErrorResult(err error, request ctrl
 	}
 }
 
-// hasRebootAnnotation checks for existence of reboot annotations and returns true if at least one exist
+// hasRebootAnnotation checks for existence of reboot annotations and returns true if at least one exist.
 func hasRebootAnnotation(info *reconcileInfo, expectForce bool) (hasReboot bool, rebootMode metal3api.RebootMode) {
 	rebootMode = metal3api.RebootModeSoft
 
@@ -420,12 +417,12 @@ func getRebootAnnotationArguments(annotation string, info *reconcileInfo) (resul
 	return
 }
 
-// isRebootAnnotation returns true if the provided annotation is a reboot annotation (either suffixed or not)
+// isRebootAnnotation returns true if the provided annotation is a reboot annotation (either suffixed or not).
 func isRebootAnnotation(annotation string) bool {
 	return strings.HasPrefix(annotation, metal3api.RebootAnnotationPrefix+"/") || annotation == metal3api.RebootAnnotationPrefix
 }
 
-// clearRebootAnnotations deletes all reboot annotations exist on the provided host
+// clearRebootAnnotations deletes all reboot annotations exist on the provided host.
 func clearRebootAnnotations(host *metal3api.BareMetalHost) (dirty bool) {
 	for annotation := range host.Annotations {
 		if isRebootAnnotation(annotation) {
@@ -438,14 +435,14 @@ func clearRebootAnnotations(host *metal3api.BareMetalHost) (dirty bool) {
 }
 
 // inspectionDisabled checks for existence of inspect.metal3.io=disabled
-// which means we don't inspect even in Inspecting state
+// which means we don't inspect even in Inspecting state.
 func inspectionDisabled(host *metal3api.BareMetalHost) bool {
 	annotations := host.GetAnnotations()
 	return annotations[metal3api.InspectAnnotationPrefix] == "disabled"
 }
 
 // hasInspectAnnotation checks for existence of inspect.metal3.io annotation
-// and returns true if it exist
+// and returns true if it exist.
 func hasInspectAnnotation(host *metal3api.BareMetalHost) bool {
 	annotations := host.GetAnnotations()
 	if annotations != nil {
@@ -472,7 +469,7 @@ func clearError(host *metal3api.BareMetalHost) (dirty bool) {
 }
 
 // setErrorMessage updates the ErrorMessage in the host Status struct
-// and increases the ErrorCount
+// and increases the ErrorCount.
 func setErrorMessage(host *metal3api.BareMetalHost, errType metal3api.ErrorType, message string) {
 	host.Status.OperationalStatus = metal3api.OperationalStatusError
 	host.Status.ErrorType = errType
@@ -505,7 +502,7 @@ func (r *BareMetalHostReconciler) actionPowerOffBeforeDeleting(prov provisioner.
 	return actionComplete{}
 }
 
-// Manage deletion of the host
+// Manage deletion of the host.
 func (r *BareMetalHostReconciler) actionDeleting(prov provisioner.Provisioner, info *reconcileInfo) actionResult {
 	info.log.Info(
 		"marked to be deleted",
@@ -583,7 +580,7 @@ func hasCustomDeploy(host *metal3api.BareMetalHost) bool {
 	}
 }
 
-// detachHost() detaches the host from the Provisioner
+// detachHost() detaches the host from the Provisioner.
 func (r *BareMetalHostReconciler) detachHost(prov provisioner.Provisioner, info *reconcileInfo) actionResult {
 	provResult, err := prov.Detach()
 	if err != nil {
@@ -1500,7 +1497,6 @@ func saveHostProvisioningSettings(host *metal3api.BareMetalHost, info *reconcile
 }
 
 func (r *BareMetalHostReconciler) createHostFirmwareSettings(info *reconcileInfo) error {
-
 	// Check if HostFirmwareSettings already exists
 	hfs := &metal3api.HostFirmwareSettings{}
 	if err := r.Get(context.TODO(), info.request.NamespacedName, hfs); err != nil {
@@ -1521,7 +1517,6 @@ func (r *BareMetalHostReconciler) createHostFirmwareSettings(info *reconcileInfo
 			}
 
 			info.log.Info("created new hostFirmwareSettings resource")
-
 		} else {
 			// Error reading the object
 			return errors.Wrap(err, "could not load hostFirmwareSettings resource")
@@ -1531,12 +1526,10 @@ func (r *BareMetalHostReconciler) createHostFirmwareSettings(info *reconcileInfo
 	return nil
 }
 
-// Get the stored firmware settings if there are valid changes
+// Get the stored firmware settings if there are valid changes.
 func (r *BareMetalHostReconciler) getHostFirmwareSettings(info *reconcileInfo) (dirty bool, hfs *metal3api.HostFirmwareSettings, err error) {
-
 	hfs = &metal3api.HostFirmwareSettings{}
 	if err = r.Get(context.TODO(), info.request.NamespacedName, hfs); err != nil {
-
 		if !k8serrors.IsNotFound(err) {
 			// Error reading the object
 			return false, nil, errors.Wrap(err, "could not load host firmware settings")
@@ -1549,7 +1542,6 @@ func (r *BareMetalHostReconciler) getHostFirmwareSettings(info *reconcileInfo) (
 
 	// Check if there are settings in the Spec that are different than the Status
 	if meta.IsStatusConditionTrue(hfs.Status.Conditions, string(metal3api.FirmwareSettingsChangeDetected)) {
-
 		// Check if the status settings have been populated
 		if len(hfs.Status.Settings) == 0 {
 			return false, nil, errors.New("host firmware status settings not available")
@@ -1583,7 +1575,7 @@ func unmarshalStatusAnnotation(content []byte) (*metal3api.BareMetalHostStatus,
 	return objStatus, nil
 }
 
-// extract host from Status annotation
+// extract host from Status annotation.
 func (r *BareMetalHostReconciler) getHostStatusFromAnnotation(host *metal3api.BareMetalHost) (*metal3api.BareMetalHostStatus, error) {
 	annotations := host.GetAnnotations()
 	content := []byte(annotations[metal3api.StatusAnnotation])
@@ -1597,7 +1589,7 @@ func (r *BareMetalHostReconciler) getHostStatusFromAnnotation(host *metal3api.Ba
 	return objStatus, nil
 }
 
-// extract HardwareDetails from annotation if present
+// extract HardwareDetails from annotation if present.
 func (r *BareMetalHostReconciler) getHardwareDetailsFromAnnotation(host *metal3api.BareMetalHost) (*metal3api.HardwareDetails, error) {
 	annotations := host.GetAnnotations()
 	if annotations[metal3api.HardwareDetailsAnnotation] == "" {
@@ -1635,7 +1627,6 @@ func (r *BareMetalHostReconciler) secretManager(log logr.Logger) secretutils.Sec
 
 // Retrieve the secret containing the credentials for talking to the BMC.
 func (r *BareMetalHostReconciler) getBMCSecretAndSetOwner(request ctrl.Request, host *metal3api.BareMetalHost) (*corev1.Secret, error) {
-
 	if host.Spec.BMC.CredentialsName == "" {
 		return nil, &EmptyBMCSecretError{message: "The BMC secret reference is empty"}
 	}
@@ -1672,7 +1663,6 @@ func credentialsFromSecret(bmcCredsSecret *corev1.Secret) *bmc.Credentials {
 // right and manufacture bmc.Credentials.  This does not actually try
 // to use the credentials.
 func (r *BareMetalHostReconciler) buildAndValidateBMCCredentials(request ctrl.Request, host *metal3api.BareMetalHost) (bmcCreds *bmc.Credentials, bmcCredsSecret *corev1.Secret, err error) {
-
 	// Retrieve the BMC secret from Kubernetes for this host
 	bmcCredsSecret, err = r.getBMCSecretAndSetOwner(request, host)
 	if err != nil {
@@ -1704,7 +1694,6 @@ func (r *BareMetalHostReconciler) publishEvent(request ctrl.Request, event corev
 		reqLogger.Info("failed to record event, ignoring",
 			"reason", event.Reason, "message", event.Message, "error", err)
 	}
-	return
 }
 
 func (r *BareMetalHostReconciler) hostHasStatus(host *metal3api.BareMetalHost) bool {
@@ -1726,12 +1715,12 @@ func (r *BareMetalHostReconciler) updateEventHandler(e event.UpdateEvent) bool {
 		return true
 	}
 
-	//If the update increased the resource Generation then let's process it
+	// If the update increased the resource Generation then let's process it
 	if e.ObjectNew.GetGeneration() != e.ObjectOld.GetGeneration() {
 		return true
 	}
 
-	//Discard updates that did not increase the resource Generation (such as on Status.LastUpdated), except for the finalizers or annotations
+	// Discard updates that did not increase the resource Generation (such as on Status.LastUpdated), except for the finalizers or annotations
 	if reflect.DeepEqual(e.ObjectNew.GetFinalizers(), e.ObjectOld.GetFinalizers()) && reflect.DeepEqual(e.ObjectNew.GetAnnotations(), e.ObjectOld.GetAnnotations()) {
 		return false
 	}
@@ -1739,9 +1728,8 @@ func (r *BareMetalHostReconciler) updateEventHandler(e event.UpdateEvent) bool {
 	return true
 }
 
-// SetupWithManager registers the reconciler to be run by the manager
+// SetupWithManager registers the reconciler to be run by the manager.
 func (r *BareMetalHostReconciler) SetupWithManager(mgr ctrl.Manager, preprovImgEnable bool, maxConcurrentReconcile int) error {
-
 	controller := ctrl.NewControllerManagedBy(mgr).
 		For(&metal3api.BareMetalHost{}).
 		WithEventFilter(
@@ -1761,7 +1749,6 @@ func (r *BareMetalHostReconciler) SetupWithManager(mgr ctrl.Manager, preprovImgE
 }
 
 func (r *BareMetalHostReconciler) reconciletHostData(ctx context.Context, host *metal3api.BareMetalHost, request ctrl.Request) (result ctrl.Result, err error) {
-
 	reqLogger := r.Log.WithValues("baremetalhost", request.NamespacedName)
 
 	// Fetch the HardwareData
@@ -1814,7 +1801,6 @@ func (r *BareMetalHostReconciler) reconciletHostData(ctx context.Context, host *
 			return ctrl.Result{Requeue: true}, nil
 		}
 		reqLogger.Info("No status cache found")
-
 	}
 	// The status annotation is unneeded, as the status subresource is
 	// already present. The annotation data will get outdated, so remove it.
@@ -1839,5 +1825,4 @@ func (r *BareMetalHostReconciler) reconciletHostData(ctx context.Context, host *
 		return ctrl.Result{Requeue: true}, nil
 	}
 	return ctrl.Result{}, nil
-
 }
diff --git a/controllers/metal3.io/bmceventsubscription_controller.go b/controllers/metal3.io/bmceventsubscription_controller.go
index 2a2fa6b4..1fe3c273 100644
--- a/controllers/metal3.io/bmceventsubscription_controller.go
+++ b/controllers/metal3.io/bmceventsubscription_controller.go
@@ -127,7 +127,6 @@ func (r *BMCEventSubscriptionReconciler) Reconcile(ctx context.Context, request
 	}
 
 	return
-
 }
 
 func (r *BMCEventSubscriptionReconciler) handleError(ctx context.Context, subscription *metal3api.BMCEventSubscription, e error, message string, requeue bool) (ctrl.Result, error) {
@@ -142,7 +141,6 @@ func (r *BMCEventSubscriptionReconciler) handleError(ctx context.Context, subscr
 	}
 
 	return ctrl.Result{}, errors.Wrap(e, message)
-
 }
 
 func (r *BMCEventSubscriptionReconciler) addFinalizer(ctx context.Context, subscription *metal3api.BMCEventSubscription) error {
@@ -179,7 +177,7 @@ func (r *BMCEventSubscriptionReconciler) createSubscription(ctx context.Context,
 
 	if err != nil {
 		reqLogger.Error(err, "failed to get http headers")
-		subscription.Status.Error = fmt.Sprintf("failed to retrieve HTTP headers secret")
+		subscription.Status.Error = "failed to retrieve HTTP headers secret"
 		updateErr := r.Status().Update(ctx, subscription)
 		if updateErr != nil {
 			return errors.Wrap(updateErr, "failed to update subscription status")
@@ -289,9 +287,8 @@ func (r *BMCEventSubscriptionReconciler) updateEventHandler(e event.UpdateEvent)
 	return true
 }
 
-// SetupWithManager registers the reconciler to be run by the manager
+// SetupWithManager registers the reconciler to be run by the manager.
 func (r *BMCEventSubscriptionReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconcile int) error {
-
 	return ctrl.NewControllerManagedBy(mgr).
 		For(&metal3api.BMCEventSubscription{}).
 		WithOptions(controller.Options{MaxConcurrentReconciles: maxConcurrentReconcile}).
diff --git a/controllers/metal3.io/errors.go b/controllers/metal3.io/errors.go
index beea98b9..713e384a 100644
--- a/controllers/metal3.io/errors.go
+++ b/controllers/metal3.io/errors.go
@@ -5,7 +5,7 @@ import (
 )
 
 // EmptyBMCAddressError is returned when the BMC address field
-// for a host is empty
+// for a host is empty.
 type EmptyBMCAddressError struct {
 	message string
 }
@@ -16,7 +16,7 @@ func (e EmptyBMCAddressError) Error() string {
 }
 
 // EmptyBMCSecretError is returned when the BMC secret
-// for a host is empty
+// for a host is empty.
 type EmptyBMCSecretError struct {
 	message string
 }
@@ -27,7 +27,7 @@ func (e EmptyBMCSecretError) Error() string {
 }
 
 // ResolveBMCSecretRefError is returned when the BMC secret
-// for a host is defined but cannot be found
+// for a host is defined but cannot be found.
 type ResolveBMCSecretRefError struct {
 	message string
 }
@@ -38,7 +38,7 @@ func (e ResolveBMCSecretRefError) Error() string {
 }
 
 // NoDataInSecretError is returned when host configuration
-// data were not found in referenced secret
+// data were not found in referenced secret.
 type NoDataInSecretError struct {
 	secret string
 	key    string
diff --git a/controllers/metal3.io/host_config_data.go b/controllers/metal3.io/host_config_data.go
index 266ffd86..8b668565 100644
--- a/controllers/metal3.io/host_config_data.go
+++ b/controllers/metal3.io/host_config_data.go
@@ -10,7 +10,7 @@ import (
 )
 
 // hostConfigData is an implementation of host configuration data interface.
-// Object is able to retrive data from secrets referenced in a host spec
+// Object is able to retrieve data from secrets referenced in a host spec.
 type hostConfigData struct {
 	host          *metal3api.BareMetalHost
 	log           logr.Logger
@@ -19,7 +19,7 @@ type hostConfigData struct {
 
 // Generic method for data extraction from a Secret. Function uses dataKey
 // parameter to detirmine which data to return in case secret contins multiple
-// keys
+// keys.
 func (hcd *hostConfigData) getSecretData(name, namespace, dataKey string) (string, error) {
 	key := types.NamespacedName{
 		Name:      name,
@@ -45,7 +45,7 @@ func (hcd *hostConfigData) getSecretData(name, namespace, dataKey string) (strin
 	return string(data), nil
 }
 
-// UserData get Operating System configuration data
+// UserData get Operating System configuration data.
 func (hcd *hostConfigData) UserData() (string, error) {
 	if hcd.host.Spec.UserData == nil {
 		hcd.log.Info("UserData is not set return empty string")
@@ -60,10 +60,9 @@ func (hcd *hostConfigData) UserData() (string, error) {
 		namespace,
 		"userData",
 	)
-
 }
 
-// NetworkData get network configuration
+// NetworkData get network configuration.
 func (hcd *hostConfigData) NetworkData() (string, error) {
 	networkData := hcd.host.Spec.NetworkData
 	if networkData == nil && hcd.host.Spec.PreprovisioningNetworkDataName != "" {
diff --git a/controllers/metal3.io/host_state_machine.go b/controllers/metal3.io/host_state_machine.go
index 0a92ea28..7b97d6a3 100644
--- a/controllers/metal3.io/host_state_machine.go
+++ b/controllers/metal3.io/host_state_machine.go
@@ -98,7 +98,6 @@ func (hsm *hostStateMachine) ensureCapacity(info *reconcileInfo, state metal3api
 func (hsm *hostStateMachine) updateHostStateFrom(initialState metal3api.ProvisioningState,
 	info *reconcileInfo) actionResult {
 	if hsm.NextState != initialState {
-
 		// Check if there is a free slot available when trying to
 		// (de)provision an host - if not the action will be delayed.
 		// The check is limited to only the (de)provisioning states to
@@ -146,7 +145,6 @@ func (hsm *hostStateMachine) updateHostStateFrom(initialState metal3api.Provisio
 }
 
 func (hsm *hostStateMachine) checkDelayedHost(info *reconcileInfo) actionResult {
-
 	// Check if there's a free slot for hosts that have been previously delayed
 	if info.host.Status.OperationalStatus == metal3api.OperationalStatusDelayed {
 		if actionRes := hsm.ensureCapacity(info, info.host.Status.Provisioning.State); actionRes != nil {
@@ -203,7 +201,7 @@ func (hsm *hostStateMachine) ReconcileState(info *reconcileInfo) (actionRes acti
 	}
 
 	info.log.Info("No handler found for state", "state", initialState)
-	return actionError{fmt.Errorf("No handler found for state \"%s\"", initialState)}
+	return actionError{fmt.Errorf("no handler found for state \"%s\"", initialState)}
 }
 
 func updateBootModeStatus(host *metal3api.BareMetalHost) bool {
@@ -261,7 +259,7 @@ func (hsm *hostStateMachine) checkInitiateDelete(log logr.Logger) bool {
 	return true
 }
 
-// hasDetachedAnnotation checks for existence of baremetalhost.metal3.io/detached
+// hasDetachedAnnotation checks for existence of baremetalhost.metal3.io/detached.
 func hasDetachedAnnotation(host *metal3api.BareMetalHost) bool {
 	annotations := host.GetAnnotations()
 	if annotations != nil {
diff --git a/controllers/metal3.io/hostfirmwaresettings_controller.go b/controllers/metal3.io/hostfirmwaresettings_controller.go
index a2f97b23..71cc84f6 100644
--- a/controllers/metal3.io/hostfirmwaresettings_controller.go
+++ b/controllers/metal3.io/hostfirmwaresettings_controller.go
@@ -51,7 +51,7 @@ const (
 	reconcilerRequeueDelayChangeDetected = time.Minute * 1
 )
 
-// HostFirmwareSettingsReconciler reconciles a HostFirmwareSettings object
+// HostFirmwareSettingsReconciler reconciles a HostFirmwareSettings object.
 type HostFirmwareSettingsReconciler struct {
 	client.Client
 	Log                logr.Logger
@@ -73,7 +73,6 @@ const (
 )
 
 func (info *rInfo) publishEvent(reason, message string) {
-
 	t := metav1.Now()
 	hfsEvent := corev1.Event{
 		ObjectMeta: metav1.ObjectMeta{
@@ -113,7 +112,6 @@ func (info *rInfo) publishEvent(reason, message string) {
 // For more details, check Reconcile and its Result here:
 // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile
 func (r *HostFirmwareSettingsReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error) {
-
 	reqLogger := r.Log.WithValues("hostfirmwaresettings", req.NamespacedName)
 	reqLogger.Info("start")
 
@@ -188,9 +186,8 @@ func (r *HostFirmwareSettingsReconciler) Reconcile(ctx context.Context, req ctrl
 	return ctrl.Result{Requeue: true, RequeueAfter: reconcilerRequeueDelay}, nil
 }
 
-// Get the firmware settings from the provisioner and update hostFirmwareSettings
+// Get the firmware settings from the provisioner and update hostFirmwareSettings.
 func (r *HostFirmwareSettingsReconciler) updateHostFirmwareSettings(currentSettings metal3api.SettingsMap, schema map[string]metal3api.SettingSchema, info *rInfo) (err error) {
-
 	// get or create a firmwareSchema to hold schema
 	firmwareSchema, err := r.getOrCreateFirmwareSchema(info, schema)
 	if err != nil {
@@ -204,9 +201,8 @@ func (r *HostFirmwareSettingsReconciler) updateHostFirmwareSettings(currentSetti
 	return nil
 }
 
-// Update the HostFirmwareSettings resource using the settings and schema from provisioner
+// Update the HostFirmwareSettings resource using the settings and schema from provisioner.
 func (r *HostFirmwareSettingsReconciler) updateStatus(info *rInfo, settings metal3api.SettingsMap, schema *metal3api.FirmwareSchema) (err error) {
-
 	dirty := false
 	var newStatus metal3api.HostFirmwareSettingsStatus
 	newStatus.Settings = make(metal3api.SettingsMap)
@@ -292,12 +288,10 @@ func (r *HostFirmwareSettingsReconciler) updateStatus(info *rInfo, settings meta
 		return r.Status().Update(context.TODO(), info.hfs)
 	}
 	return nil
-
 }
 
-// Get a firmware schema that matches the host vendor or create one if it doesn't exist
+// Get a firmware schema that matches the host vendor or create one if it doesn't exist.
 func (r *HostFirmwareSettingsReconciler) getOrCreateFirmwareSchema(info *rInfo, schema map[string]metal3api.SettingSchema) (fSchema *metal3api.FirmwareSchema, err error) {
-
 	info.log.Info("getting firmwareSchema")
 
 	schemaName := GetSchemaName(schema)
@@ -306,7 +300,6 @@ func (r *HostFirmwareSettingsReconciler) getOrCreateFirmwareSchema(info *rInfo,
 	// If a schema exists that matches, use that, otherwise create a new one
 	if err = r.Get(context.TODO(), client.ObjectKey{Namespace: info.hfs.ObjectMeta.Namespace, Name: schemaName},
 		firmwareSchema); err == nil {
-
 		info.log.Info("found existing firmwareSchema resource")
 
 		// Add hfs as owner so can be garbage collected on delete, if already an owner it will just be overwritten
@@ -366,7 +359,6 @@ func (r *HostFirmwareSettingsReconciler) getOrCreateFirmwareSchema(info *rInfo,
 
 // SetupWithManager sets up the controller with the Manager.
 func (r *HostFirmwareSettingsReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconcile int) error {
-
 	return ctrl.NewControllerManagedBy(mgr).
 		For(&metal3api.HostFirmwareSettings{}).
 		WithOptions(controller.Options{MaxConcurrentReconciles: maxConcurrentReconcile}).
@@ -378,10 +370,9 @@ func (r *HostFirmwareSettingsReconciler) SetupWithManager(mgr ctrl.Manager, maxC
 }
 
 func (r *HostFirmwareSettingsReconciler) updateEventHandler(e event.UpdateEvent) bool {
-
 	r.Log.Info("hostfirmwaresettings in event handler")
 
-	//If the update increased the resource Generation then let's process it
+	// If the update increased the resource Generation then let's process it
 	if e.ObjectNew.GetGeneration() != e.ObjectOld.GetGeneration() {
 		r.Log.Info("returning true as generation changed from event handler")
 		return true
@@ -390,21 +381,20 @@ func (r *HostFirmwareSettingsReconciler) updateEventHandler(e event.UpdateEvent)
 	return false
 }
 
-// Validate the HostFirmwareSetting Spec against the schema
+// Validate the HostFirmwareSetting Spec against the schema.
 func (r *HostFirmwareSettingsReconciler) validateHostFirmwareSettings(info *rInfo, status *metal3api.HostFirmwareSettingsStatus, schema *metal3api.FirmwareSchema) []error {
-
 	var errors []error
 
 	for name, val := range info.hfs.Spec.Settings {
 		// Prohibit any Spec settings with "Password"
 		if strings.Contains(name, "Password") {
-			errors = append(errors, fmt.Errorf("Cannot set Password field"))
+			errors = append(errors, fmt.Errorf("cannot set Password field"))
 			continue
 		}
 
 		// The setting must be in the Status
 		if _, ok := status.Settings[name]; !ok {
-			errors = append(errors, fmt.Errorf("Setting %s is not in the Status field", name))
+			errors = append(errors, fmt.Errorf("setting %s is not in the Status field", name))
 			continue
 		}
 
@@ -431,7 +421,6 @@ func (r *HostFirmwareSettingsReconciler) publishEvent(request ctrl.Request, even
 		reqLogger.Info("failed to record event, ignoring",
 			"reason", event.Reason, "message", event.Message, "error", err)
 	}
-	return
 }
 
 func setCondition(generation int64, status *metal3api.HostFirmwareSettingsStatus, info *rInfo,
@@ -453,17 +442,14 @@ func setCondition(generation int64, status *metal3api.HostFirmwareSettingsStatus
 	return false
 }
 
-// Generate a name based on the schema key and values which should be the same for similar hardware
+// Generate a name based on the schema key and values which should be the same for similar hardware.
 func GetSchemaName(schema map[string]metal3api.SettingSchema) string {
-
 	// Schemas from the same vendor and model should be identical for both keys and values.
 	hashkeys := make([]string, 0, len(schema))
 	for k, v := range schema {
 		hashkeys = append(hashkeys, k)
 		hashkeys = append(hashkeys, v.AttributeType)
-		for _, av := range v.AllowableValues {
-			hashkeys = append(hashkeys, av)
-		}
+		hashkeys = append(hashkeys, v.AllowableValues...)
 		if v.LowerBound != nil {
 			hashkeys = append(hashkeys, strconv.Itoa(*v.LowerBound))
 		}
@@ -483,7 +469,7 @@ func GetSchemaName(schema map[string]metal3api.SettingSchema) string {
 	sort.Strings(hashkeys)
 
 	h := sha256.New()
-	h.Write([]byte(fmt.Sprintf("%v", hashkeys)))
+	fmt.Fprintf(h, "%v", hashkeys)
 	hash := fmt.Sprintf("%x", h.Sum(nil))[:8]
 
 	return "schema-" + hash
diff --git a/controllers/metal3.io/preprovisioningimage_controller.go b/controllers/metal3.io/preprovisioningimage_controller.go
index a8f2ebe7..1ccd577a 100644
--- a/controllers/metal3.io/preprovisioningimage_controller.go
+++ b/controllers/metal3.io/preprovisioningimage_controller.go
@@ -33,7 +33,7 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/controller"
 
-	metal3 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	"github.com/metal3-io/baremetal-operator/pkg/imageprovider"
 	"github.com/metal3-io/baremetal-operator/pkg/secretutils"
 	"github.com/metal3-io/baremetal-operator/pkg/utils"
@@ -44,7 +44,7 @@ const (
 	maxRetryDelay = time.Minute * 10
 )
 
-// PreprovisioningImageReconciler reconciles a PreprovisioningImage object
+// PreprovisioningImageReconciler reconciles a PreprovisioningImage object.
 type PreprovisioningImageReconciler struct {
 	client.Client
 	Log           logr.Logger
@@ -71,7 +71,7 @@ func (r *PreprovisioningImageReconciler) Reconcile(ctx context.Context, req ctrl
 
 	result := ctrl.Result{}
 
-	img := metal3.PreprovisioningImage{}
+	img := metal3api.PreprovisioningImage{}
 	err := r.Get(ctx, req.NamespacedName, &img)
 	if err != nil {
 		if k8serrors.IsNotFound(err) {
@@ -87,7 +87,7 @@ func (r *PreprovisioningImageReconciler) Reconcile(ctx context.Context, req ctrl
 			return ctrl.Result{}, err
 		}
 		img.Finalizers = utils.FilterStringFromList(
-			img.Finalizers, metal3.PreprovisioningImageFinalizer)
+			img.Finalizers, metal3api.PreprovisioningImageFinalizer)
 		err := r.Update(ctx, &img)
 		if err != nil {
 			return ctrl.Result{}, errors.Wrap(err, "failed to remove finalizer")
@@ -95,9 +95,9 @@ func (r *PreprovisioningImageReconciler) Reconcile(ctx context.Context, req ctrl
 		return ctrl.Result{}, nil
 	}
 
-	if !utils.StringInList(img.Finalizers, metal3.PreprovisioningImageFinalizer) {
+	if !utils.StringInList(img.Finalizers, metal3api.PreprovisioningImageFinalizer) {
 		log.Info("adding finalizer")
-		img.Finalizers = append(img.Finalizers, metal3.PreprovisioningImageFinalizer)
+		img.Finalizers = append(img.Finalizers, metal3api.PreprovisioningImageFinalizer)
 		err := r.Update(ctx, &img)
 		if err != nil {
 			return ctrl.Result{}, errors.Wrap(err, "failed to add finalizer")
@@ -130,13 +130,13 @@ func (r *PreprovisioningImageReconciler) Reconcile(ctx context.Context, req ctrl
 	return result, err
 }
 
-func configChanged(img *metal3.PreprovisioningImage, format metal3.ImageFormat, networkDataStatus metal3.SecretStatus) bool {
+func configChanged(img *metal3api.PreprovisioningImage, format metal3api.ImageFormat, networkDataStatus metal3api.SecretStatus) bool {
 	return !(img.Status.Format == format &&
 		img.Status.Architecture == img.Spec.Architecture &&
 		img.Status.NetworkData == networkDataStatus)
 }
 
-func (r *PreprovisioningImageReconciler) update(img *metal3.PreprovisioningImage, log logr.Logger) (bool, error) {
+func (r *PreprovisioningImageReconciler) update(img *metal3api.PreprovisioningImage, log logr.Logger) (bool, error) {
 	generation := img.GetGeneration()
 
 	if !r.ImageProvider.SupportsArchitecture(img.Spec.Architecture) {
@@ -161,7 +161,7 @@ func (r *PreprovisioningImageReconciler) update(img *metal3.PreprovisioningImage
 
 	if configChanged(img, format, secretStatus) {
 		reason := "Config changed"
-		if meta.IsStatusConditionTrue(img.Status.Conditions, string(metal3.ConditionImageReady)) {
+		if meta.IsStatusConditionTrue(img.Status.Conditions, string(metal3api.ConditionImageReady)) {
 			// Ensure we mark the status as not ready before we remove the build
 			// from the image cache.
 			setUnready(generation, &img.Status, reason)
@@ -204,7 +204,7 @@ func (r *PreprovisioningImageReconciler) update(img *metal3.PreprovisioningImage
 		"Generated image"), nil
 }
 
-func (r *PreprovisioningImageReconciler) getImageFormat(spec metal3.PreprovisioningImageSpec, log logr.Logger) (format metal3.ImageFormat) {
+func (r *PreprovisioningImageReconciler) getImageFormat(spec metal3api.PreprovisioningImageSpec, log logr.Logger) (format metal3api.ImageFormat) {
 	for _, acceptableFormat := range spec.AcceptFormats {
 		if r.ImageProvider.SupportsFormat(acceptableFormat) {
 			return acceptableFormat
@@ -218,7 +218,7 @@ func (r *PreprovisioningImageReconciler) getImageFormat(spec metal3.Preprovision
 	return
 }
 
-func (r *PreprovisioningImageReconciler) discardExistingImage(img *metal3.PreprovisioningImage, log logr.Logger) error {
+func (r *PreprovisioningImageReconciler) discardExistingImage(img *metal3api.PreprovisioningImage, log logr.Logger) error {
 	if img.Status.Format == "" {
 		return nil
 	}
@@ -231,8 +231,8 @@ func (r *PreprovisioningImageReconciler) discardExistingImage(img *metal3.Prepro
 	})
 }
 
-func getErrorRetryDelay(status metal3.PreprovisioningImageStatus) time.Duration {
-	errorCond := meta.FindStatusCondition(status.Conditions, string(metal3.ConditionImageError))
+func getErrorRetryDelay(status metal3api.PreprovisioningImageStatus) time.Duration {
+	errorCond := meta.FindStatusCondition(status.Conditions, string(metal3api.ConditionImageError))
 	if errorCond == nil || errorCond.Status != metav1.ConditionTrue {
 		return 0
 	}
@@ -246,10 +246,10 @@ func getErrorRetryDelay(status metal3.PreprovisioningImageStatus) time.Duration
 	return delay
 }
 
-func getNetworkData(secretManager secretutils.SecretManager, img *metal3.PreprovisioningImage) (*corev1.Secret, metal3.SecretStatus, error) {
+func getNetworkData(secretManager secretutils.SecretManager, img *metal3api.PreprovisioningImage) (*corev1.Secret, metal3api.SecretStatus, error) {
 	networkDataSecret := img.Spec.NetworkDataName
 	if networkDataSecret == "" {
-		return nil, metal3.SecretStatus{}, nil
+		return nil, metal3api.SecretStatus{}, nil
 	}
 
 	secretKey := client.ObjectKey{
@@ -258,17 +258,17 @@ func getNetworkData(secretManager secretutils.SecretManager, img *metal3.Preprov
 	}
 	secret, err := secretManager.AcquireSecret(secretKey, img, false)
 	if err != nil {
-		return nil, metal3.SecretStatus{}, err
+		return nil, metal3api.SecretStatus{}, err
 	}
 
-	return secret, metal3.SecretStatus{
+	return secret, metal3api.SecretStatus{
 		Name:    networkDataSecret,
 		Version: secret.GetResourceVersion(),
 	}, nil
 }
 
-func setImageCondition(generation int64, status *metal3.PreprovisioningImageStatus,
-	cond metal3.ImageStatusConditionType, newStatus metav1.ConditionStatus,
+func setImageCondition(generation int64, status *metal3api.PreprovisioningImageStatus,
+	cond metal3api.ImageStatusConditionType, newStatus metav1.ConditionStatus,
 	time metav1.Time, reason imageConditionReason, message string) {
 	newCondition := metav1.Condition{
 		Type:               string(cond),
@@ -281,10 +281,9 @@ func setImageCondition(generation int64, status *metal3.PreprovisioningImageStat
 	meta.SetStatusCondition(&status.Conditions, newCondition)
 }
 
-func setImage(generation int64, status *metal3.PreprovisioningImageStatus, image imageprovider.GeneratedImage,
-	format metal3.ImageFormat, networkData metal3.SecretStatus, arch string,
+func setImage(generation int64, status *metal3api.PreprovisioningImageStatus, image imageprovider.GeneratedImage,
+	format metal3api.ImageFormat, networkData metal3api.SecretStatus, arch string,
 	message string) bool {
-
 	newStatus := status.DeepCopy()
 	newStatus.ImageUrl = image.ImageURL
 	newStatus.KernelUrl = image.KernelURL
@@ -300,10 +299,10 @@ func setImage(generation int64, status *metal3.PreprovisioningImageStatus, image
 		ready = metav1.ConditionTrue
 	}
 	setImageCondition(generation, newStatus,
-		metal3.ConditionImageReady, ready,
+		metal3api.ConditionImageReady, ready,
 		time, reason, message)
 	setImageCondition(generation, newStatus,
-		metal3.ConditionImageError, metav1.ConditionFalse,
+		metal3api.ConditionImageError, metav1.ConditionFalse,
 		time, reason, "")
 
 	changed := !apiequality.Semantic.DeepEqual(status, &newStatus)
@@ -311,13 +310,13 @@ func setImage(generation int64, status *metal3.PreprovisioningImageStatus, image
 	return changed
 }
 
-func setUnready(generation int64, status *metal3.PreprovisioningImageStatus, message string) bool {
+func setUnready(generation int64, status *metal3api.PreprovisioningImageStatus, message string) bool {
 	newStatus := status.DeepCopy()
 
 	time := metav1.Now()
 	reason := reasonImageSuccess
 	setImageCondition(generation, newStatus,
-		metal3.ConditionImageReady, metav1.ConditionFalse,
+		metal3api.ConditionImageReady, metav1.ConditionFalse,
 		time, reason, message)
 
 	changed := !apiequality.Semantic.DeepEqual(status, &newStatus)
@@ -325,16 +324,16 @@ func setUnready(generation int64, status *metal3.PreprovisioningImageStatus, mes
 	return changed
 }
 
-func setError(generation int64, status *metal3.PreprovisioningImageStatus, reason imageConditionReason, message string) bool {
+func setError(generation int64, status *metal3api.PreprovisioningImageStatus, reason imageConditionReason, message string) bool {
 	newStatus := status.DeepCopy()
 	newStatus.ImageUrl = ""
 
 	time := metav1.Now()
 	setImageCondition(generation, newStatus,
-		metal3.ConditionImageReady, metav1.ConditionFalse,
+		metal3api.ConditionImageReady, metav1.ConditionFalse,
 		time, reason, "")
 	setImageCondition(generation, newStatus,
-		metal3.ConditionImageError, metav1.ConditionTrue,
+		metal3api.ConditionImageError, metav1.ConditionTrue,
 		time, reason, message)
 
 	changed := !apiequality.Semantic.DeepEqual(status, &newStatus)
@@ -343,7 +342,7 @@ func setError(generation int64, status *metal3.PreprovisioningImageStatus, reaso
 }
 
 func (r *PreprovisioningImageReconciler) CanStart() bool {
-	for _, fmt := range []metal3.ImageFormat{metal3.ImageFormatISO, metal3.ImageFormatInitRD} {
+	for _, fmt := range []metal3api.ImageFormat{metal3api.ImageFormatISO, metal3api.ImageFormatInitRD} {
 		if r.ImageProvider.SupportsFormat(fmt) {
 			return true
 		}
@@ -354,7 +353,7 @@ func (r *PreprovisioningImageReconciler) CanStart() bool {
 
 func (r *PreprovisioningImageReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconcile int) error {
 	return ctrl.NewControllerManagedBy(mgr).
-		For(&metal3.PreprovisioningImage{}).
+		For(&metal3api.PreprovisioningImage{}).
 		WithOptions(controller.Options{MaxConcurrentReconciles: maxConcurrentReconcile}).
 		Owns(&corev1.Secret{}, builder.MatchEveryOwner).
 		Complete(r)
diff --git a/main.go b/main.go
index 8ea82bf3..7e418dc5 100644
--- a/main.go
+++ b/main.go
@@ -36,7 +36,7 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 	"sigs.k8s.io/controller-runtime/pkg/webhook"
 
-	metal3iov1alpha1 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	metal3iocontroller "github.com/metal3-io/baremetal-operator/controllers/metal3.io"
 	"github.com/metal3-io/baremetal-operator/pkg/imageprovider"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner"
@@ -73,7 +73,7 @@ const leaderElectionID = "baremetal-operator"
 func init() {
 	_ = clientgoscheme.AddToScheme(scheme)
 
-	_ = metal3iov1alpha1.AddToScheme(scheme)
+	_ = metal3api.AddToScheme(scheme)
 }
 
 func printVersion() {
@@ -97,7 +97,7 @@ func setupChecks(mgr ctrl.Manager) {
 }
 
 func setupWebhooks(mgr ctrl.Manager) {
-	var bmh webhook.Validator = &metal3iov1alpha1.BareMetalHost{}
+	var bmh webhook.Validator = &metal3api.BareMetalHost{}
 	if err := ctrl.NewWebhookManagedBy(mgr).
 		For(bmh).
 		Complete(); err != nil {
@@ -105,7 +105,7 @@ func setupWebhooks(mgr ctrl.Manager) {
 		os.Exit(1)
 	}
 
-	var bmces webhook.Validator = &metal3iov1alpha1.BMCEventSubscription{}
+	var bmces webhook.Validator = &metal3api.BMCEventSubscription{}
 	if err := ctrl.NewWebhookManagedBy(mgr).
 		For(bmces).
 		Complete(); err != nil {
diff --git a/pkg/imageprovider/default.go b/pkg/imageprovider/default.go
index f63d0a71..99b3b7dd 100644
--- a/pkg/imageprovider/default.go
+++ b/pkg/imageprovider/default.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/go-logr/logr"
 
-	metal3 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 )
 
 type envImageProvider struct {
@@ -25,11 +25,11 @@ func (eip envImageProvider) SupportsArchitecture(_ string) bool {
 	return true
 }
 
-func (eip envImageProvider) SupportsFormat(format metal3.ImageFormat) bool {
+func (eip envImageProvider) SupportsFormat(format metal3api.ImageFormat) bool {
 	switch format {
-	case metal3.ImageFormatISO:
+	case metal3api.ImageFormatISO:
 		return eip.isoURL != ""
-	case metal3.ImageFormatInitRD:
+	case metal3api.ImageFormatInitRD:
 		// Assume we are running inside the same process as the BMH controller -
 		// if there is no kernel URL then it will be unable to use the initrd.
 		if os.Getenv("DEPLOY_KERNEL_URL") == "" {
@@ -43,12 +43,12 @@ func (eip envImageProvider) SupportsFormat(format metal3.ImageFormat) bool {
 
 func (eip envImageProvider) BuildImage(data ImageData, _ NetworkData, _ logr.Logger) (image GeneratedImage, err error) {
 	switch data.Format {
-	case metal3.ImageFormatISO:
+	case metal3api.ImageFormatISO:
 		image.ImageURL = eip.isoURL
-	case metal3.ImageFormatInitRD:
+	case metal3api.ImageFormatInitRD:
 		image.ImageURL = eip.initrdURL
 	default:
-		err = BuildInvalidError(fmt.Errorf("Unsupported image format \"%s\"", data.Format))
+		err = BuildInvalidError(fmt.Errorf("unsupported image format \"%s\"", data.Format))
 	}
 	return
 }
diff --git a/pkg/imageprovider/imageprovider.go b/pkg/imageprovider/imageprovider.go
index 0dd85e94..638de1ae 100644
--- a/pkg/imageprovider/imageprovider.go
+++ b/pkg/imageprovider/imageprovider.go
@@ -5,16 +5,16 @@ import (
 
 	"github.com/go-logr/logr"
 
-	metal3 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 )
 
 // ImageData contains information about the image type being requested, and
 // metadata about the request.
 type ImageData struct {
 	ImageMetadata     *metav1.ObjectMeta
-	Format            metal3.ImageFormat
+	Format            metal3api.ImageFormat
 	Architecture      string
-	NetworkDataStatus metal3.SecretStatus
+	NetworkDataStatus metal3api.SecretStatus
 }
 
 // GeneratedImage contains information about the generated image. At least the
@@ -34,7 +34,7 @@ type ImageProvider interface {
 
 	// SupportsFormat returns whether the ImageProvider can provide images in
 	// the given format.
-	SupportsFormat(metal3.ImageFormat) bool
+	SupportsFormat(metal3api.ImageFormat) bool
 
 	// BuildImage requests the ImageProvider to build an image with the
 	// supplied network data and return a URL where it can be accessed.
diff --git a/pkg/provisioner/demo/demo.go b/pkg/provisioner/demo/demo.go
index 3d575524..edc5a91e 100644
--- a/pkg/provisioner/demo/demo.go
+++ b/pkg/provisioner/demo/demo.go
@@ -67,7 +67,7 @@ type demoProvisioner struct {
 
 type Demo struct{}
 
-// NewProvisioner returns a new demo Provisioner
+// NewProvisioner returns a new demo Provisioner.
 func (d Demo) NewProvisioner(hostData provisioner.HostData, publisher provisioner.EventPublisher) (provisioner.Provisioner, error) {
 	p := &demoProvisioner{
 		objectMeta: hostData.ObjectMeta,
@@ -91,7 +91,6 @@ func (p *demoProvisioner) ValidateManagementAccess(_ provisioner.ManagementAcces
 	hostName := p.objectMeta.Name
 
 	switch hostName {
-
 	case RegistrationErrorHost:
 		// We have set an error, so Reconcile() will stop
 		result.ErrorMessage = "failed to register new host"
@@ -192,12 +191,11 @@ func (p *demoProvisioner) UpdateHardwareState() (hwState provisioner.HardwareSta
 	return
 }
 
-// Prepare remove existing configuration and set new configuration
+// Prepare remove existing configuration and set new configuration.
 func (p *demoProvisioner) Prepare(_ provisioner.PrepareData, unprepared bool, _ bool) (result provisioner.Result, started bool, err error) {
 	hostName := p.objectMeta.Name
 
 	switch hostName {
-
 	case PreparingErrorHost:
 		p.log.Info("preparing error host")
 		result.ErrorMessage = "preparing failed"
@@ -228,12 +226,10 @@ func (p *demoProvisioner) Adopt(_ provisioner.AdoptData, _ bool) (result provisi
 // be called multiple times, and should return true for its dirty flag
 // until the provisioning operation is completed.
 func (p *demoProvisioner) Provision(_ provisioner.ProvisionData, _ bool) (result provisioner.Result, err error) {
-
 	hostName := p.objectMeta.Name
 	p.log.Info("provisioning image to host")
 
 	switch hostName {
-
 	case ValidationErrorHost:
 		p.log.Info("setting validation error")
 		result.ErrorMessage = "validation failed"
@@ -254,7 +250,6 @@ func (p *demoProvisioner) Provision(_ provisioner.ProvisionData, _ bool) (result
 // multiple times, and should return true for its dirty flag until the
 // deprovisioning operation is completed.
 func (p *demoProvisioner) Deprovision(_ bool) (result provisioner.Result, err error) {
-
 	hostName := p.objectMeta.Name
 	switch hostName {
 	default:
@@ -310,7 +305,6 @@ func (p *demoProvisioner) Detach() (result provisioner.Result, err error) {
 // PowerOn ensures the server is powered on independently of any image
 // provisioning operation.
 func (p *demoProvisioner) PowerOn(_ bool) (result provisioner.Result, err error) {
-
 	hostName := p.objectMeta.Name
 	switch hostName {
 	default:
@@ -331,7 +325,6 @@ func (p *demoProvisioner) PowerOn(_ bool) (result provisioner.Result, err error)
 // PowerOff ensures the server is powered off independently of any image
 // provisioning operation.
 func (p *demoProvisioner) PowerOff(_ metal3api.RebootMode, _ bool) (result provisioner.Result, err error) {
-
 	hostName := p.objectMeta.Name
 	switch hostName {
 	default:
@@ -355,7 +348,6 @@ func (p *demoProvisioner) TryInit() (result bool, err error) {
 }
 
 func (p *demoProvisioner) GetFirmwareSettings(_ bool) (settings metal3api.SettingsMap, schema map[string]metal3api.SettingSchema, err error) {
-
 	p.log.Info("getting BIOS settings")
 	return
 }
diff --git a/pkg/provisioner/fixture/fixture.go b/pkg/provisioner/fixture/fixture.go
index 9b869d12..1d43c6bc 100644
--- a/pkg/provisioner/fixture/fixture.go
+++ b/pkg/provisioner/fixture/fixture.go
@@ -21,7 +21,7 @@ type fixtureHostConfigData struct {
 	metaData    string
 }
 
-// NewHostConfigData creates new host configuration data
+// NewHostConfigData creates new host configuration data.
 func NewHostConfigData(userData string, networkData string, metaData string) provisioner.HostConfigData {
 	return &fixtureHostConfigData{
 		userData:    userData,
@@ -57,7 +57,7 @@ type fixtureProvisioner struct {
 	state *Fixture
 }
 
-// Fixture contains persistent state for a particular host
+// Fixture contains persistent state for a particular host.
 type Fixture struct {
 	// counter to set the provisioner as ready
 	BecomeReadyCounter int
@@ -75,7 +75,7 @@ type Fixture struct {
 	customDeploy *metal3api.CustomDeploy
 }
 
-// NewProvisioner returns a new Fixture Provisioner
+// NewProvisioner returns a new Fixture Provisioner.
 func (f *Fixture) NewProvisioner(hostData provisioner.HostData, publisher provisioner.EventPublisher) (provisioner.Provisioner, error) {
 	p := &fixtureProvisioner{
 		provID:    hostData.ProvisionerID,
@@ -190,7 +190,7 @@ func (p *fixtureProvisioner) UpdateHardwareState() (hwState provisioner.Hardware
 	return
 }
 
-// Prepare remove existing configuration and set new configuration
+// Prepare remove existing configuration and set new configuration.
 func (p *fixtureProvisioner) Prepare(_ provisioner.PrepareData, unprepared bool, _ bool) (result provisioner.Result, started bool, err error) {
 	p.log.Info("preparing host")
 	started = unprepared
diff --git a/pkg/provisioner/ironic/clients/auth.go b/pkg/provisioner/ironic/clients/auth.go
index fe9e7370..84f0469a 100644
--- a/pkg/provisioner/ironic/clients/auth.go
+++ b/pkg/provisioner/ironic/clients/auth.go
@@ -9,17 +9,17 @@ import (
 	"strings"
 )
 
-// AuthType is the method of authenticating requests to the server
+// AuthType is the method of authenticating requests to the server.
 type AuthType string
 
 const (
-	// NoAuth uses no authentication
+	// NoAuth uses no authentication.
 	NoAuth AuthType = "noauth"
-	// HTTPBasicAuth uses HTTP Basic Authentication
+	// HTTPBasicAuth uses HTTP Basic Authentication.
 	HTTPBasicAuth AuthType = "http_basic"
 )
 
-// AuthConfig contains data needed to configure authentication in the client
+// AuthConfig contains data needed to configure authentication in the client.
 type AuthConfig struct {
 	Type     AuthType
 	Username string
@@ -39,7 +39,7 @@ func readAuthFile(filename string) (string, error) {
 	return strings.TrimSpace(string(content)), err
 }
 
-// LoadAuth loads the Ironic configuration from the environment
+// LoadAuth loads the Ironic configuration from the environment.
 func LoadAuth() (auth AuthConfig, err error) {
 	authPath := path.Join(authRoot(), "ironic")
 
@@ -63,9 +63,9 @@ func LoadAuth() (auth AuthConfig, err error) {
 	}
 
 	if auth.Username == "" {
-		err = fmt.Errorf("Empty HTTP Basic Auth username")
+		err = fmt.Errorf("empty HTTP Basic Auth username")
 	} else if auth.Password == "" {
-		err = fmt.Errorf("Empty HTTP Basic Auth password")
+		err = fmt.Errorf("empty HTTP Basic Auth password")
 	}
 	return
 }
@@ -84,7 +84,7 @@ func ConfigFromEndpointURL(endpointURL string) (endpoint string, auth AuthConfig
 		auth.Username = parsedURL.User.Username()
 		auth.Password, hasPasswd = parsedURL.User.Password()
 		if !hasPasswd {
-			err = fmt.Errorf("No password supplied for HTTP Basic Auth")
+			err = fmt.Errorf("no password supplied for HTTP Basic Auth")
 		}
 		parsedURL.User = nil
 	} else {
diff --git a/pkg/provisioner/ironic/clients/client.go b/pkg/provisioner/ironic/clients/client.go
index 9753b8d4..e175b1f0 100644
--- a/pkg/provisioner/ironic/clients/client.go
+++ b/pkg/provisioner/ironic/clients/client.go
@@ -71,7 +71,7 @@ func updateHTTPClient(client *gophercloud.ServiceClient, tlsConf TLSConfig) erro
 	return nil
 }
 
-// IronicClient creates a client for Ironic
+// IronicClient creates a client for Ironic.
 func IronicClient(ironicEndpoint string, auth AuthConfig, tls TLSConfig) (client *gophercloud.ServiceClient, err error) {
 	switch auth.Type {
 	case NoAuth:
@@ -85,7 +85,7 @@ func IronicClient(ironicEndpoint string, auth AuthConfig, tls TLSConfig) (client
 			IronicUserPassword: auth.Password,
 		})
 	default:
-		err = fmt.Errorf("Unknown auth type %s", auth.Type)
+		err = fmt.Errorf("unknown auth type %s", auth.Type)
 	}
 	if err != nil {
 		return
diff --git a/pkg/provisioner/ironic/factory.go b/pkg/provisioner/ironic/factory.go
index 4a2a140e..6815c1ca 100644
--- a/pkg/provisioner/ironic/factory.go
+++ b/pkg/provisioner/ironic/factory.go
@@ -115,7 +115,7 @@ func loadConfigFromEnv(havePreprovImgBuilder bool) (ironicConfig, error) {
 	if !havePreprovImgBuilder {
 		if c.deployISOURL == "" &&
 			(c.deployKernelURL == "" || c.deployRamdiskURL == "") {
-			return c, errors.New("Either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set")
+			return c, errors.New("either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set")
 		}
 		if (c.deployKernelURL == "" && c.deployRamdiskURL != "") ||
 			(c.deployKernelURL != "" && c.deployRamdiskURL == "") {
@@ -130,14 +130,14 @@ func loadConfigFromEnv(havePreprovImgBuilder bool) (ironicConfig, error) {
 	if maxHostsStr := os.Getenv("PROVISIONING_LIMIT"); maxHostsStr != "" {
 		value, err := strconv.Atoi(maxHostsStr)
 		if err != nil {
-			return c, fmt.Errorf("Invalid value set for variable PROVISIONING_LIMIT=%s", maxHostsStr)
+			return c, fmt.Errorf("invalid value set for variable PROVISIONING_LIMIT=%s", maxHostsStr)
 		}
 		c.maxBusyHosts = value
 	}
 
 	if forcePersistentBootDevice := os.Getenv("LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE"); forcePersistentBootDevice != "" {
 		if forcePersistentBootDevice != "Default" && forcePersistentBootDevice != "Always" && forcePersistentBootDevice != "Never" {
-			return c, fmt.Errorf("Invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE, must be one of Default, Always or Never")
+			return c, fmt.Errorf("invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE, must be one of Default, Always or Never")
 		}
 		c.liveISOForcePersistentBootDevice = forcePersistentBootDevice
 	}
@@ -159,7 +159,7 @@ func loadConfigFromEnv(havePreprovImgBuilder bool) (ironicConfig, error) {
 func loadEndpointsFromEnv() (ironicEndpoint string, err error) {
 	ironicEndpoint = os.Getenv("IRONIC_ENDPOINT")
 	if ironicEndpoint == "" {
-		err = errors.New("No IRONIC_ENDPOINT variable set")
+		err = errors.New("no IRONIC_ENDPOINT variable set")
 	}
 	return
 }
@@ -179,12 +179,12 @@ func loadTLSConfigFromEnv() clients.TLSConfig {
 	}
 	insecure := false
 	ironicInsecureStr := os.Getenv("IRONIC_INSECURE")
-	if strings.ToLower(ironicInsecureStr) == "true" {
+	if strings.EqualFold(ironicInsecureStr, "true") {
 		insecure = true
 	}
 	skipClientSANVerify := false
 	ironicSkipClientSANVerifyStr := os.Getenv("IRONIC_SKIP_CLIENT_SAN_VERIFY")
-	if strings.ToLower(ironicSkipClientSANVerifyStr) == "true" {
+	if strings.EqualFold(ironicSkipClientSANVerifyStr, "true") {
 		skipClientSANVerify = true
 	}
 	return clients.TLSConfig{
diff --git a/pkg/provisioner/ironic/ironic.go b/pkg/provisioner/ironic/ironic.go
index 45b4d1b2..75aaed4b 100644
--- a/pkg/provisioner/ironic/ironic.go
+++ b/pkg/provisioner/ironic/ironic.go
@@ -37,7 +37,7 @@ var (
 )
 
 const (
-	// See nodes.Node.PowerState for details
+	// See nodes.Node.PowerState for details.
 	powerOn              = string(nodes.PowerOn)
 	powerOff             = string(nodes.PowerOff)
 	softPowerOff         = string(nodes.SoftPowerOff)
@@ -66,7 +66,7 @@ func (e macAddressConflictError) Error() string {
 	return fmt.Sprintf("MAC address %s conflicts with existing node %s", e.Address, e.ExistingNode)
 }
 
-// NewMacAddressConflictError is a wrap for macAddressConflictError error
+// NewMacAddressConflictError is a wrap for macAddressConflictError error.
 func NewMacAddressConflictError(address, node string) error {
 	return macAddressConflictError{Address: address, ExistingNode: node}
 }
@@ -163,7 +163,6 @@ func (p *ironicProvisioner) listAllPorts(address string) ([]ports.Port, error) {
 	}
 
 	return ports.ExtractPorts(allPages)
-
 }
 
 func (p *ironicProvisioner) getNode() (*nodes.Node, error) {
@@ -519,7 +518,6 @@ func (p *ironicProvisioner) ValidateManagementAccess(data provisioner.Management
 
 	// Ensure the node is marked manageable.
 	switch nodes.ProvisionState(ironicNode.ProvisionState) {
-
 	case nodes.Enroll:
 
 		// If ironic is reporting an error, stop working on the node.
@@ -1083,12 +1081,11 @@ func (p *ironicProvisioner) getUpdateOptsForNode(ironicNode *nodes.Node, data pr
 	return updater
 }
 
-// GetFirmwareSettings gets the BIOS settings and optional schema from the host and returns maps
+// GetFirmwareSettings gets the BIOS settings and optional schema from the host and returns maps.
 func (p *ironicProvisioner) GetFirmwareSettings(includeSchema bool) (settings metal3api.SettingsMap, schema map[string]metal3api.SettingSchema, err error) {
-
 	ironicNode, err := p.getNode()
 	if err != nil {
-		return nil, nil, errors.Wrap(err, fmt.Sprintf("could not get node for BIOS settings"))
+		return nil, nil, errors.Wrap(err, "could not get node for BIOS settings")
 	}
 
 	// Get the settings from Ironic via Gophercloud
@@ -1137,7 +1134,6 @@ func (p *ironicProvisioner) GetFirmwareSettings(includeSchema bool) (settings me
 // encapsulates the logic for building the value and knowing which
 // update operation to use with the results.
 func buildCapabilitiesValue(ironicNode *nodes.Node, bootMode metal3api.BootMode) string {
-
 	capabilities, ok := ironicNode.Properties["capabilities"]
 	if !ok {
 		// There is no existing capabilities value
@@ -1163,7 +1159,6 @@ func buildCapabilitiesValue(ironicNode *nodes.Node, bootMode metal3api.BootMode)
 }
 
 func (p *ironicProvisioner) setUpForProvisioning(ironicNode *nodes.Node, data provisioner.ProvisionData) (result provisioner.Result, err error) {
-
 	p.log.Info("starting provisioning", "node properties", ironicNode.Properties)
 
 	ironicNode, success, result, err := p.tryUpdateNode(ironicNode,
@@ -1220,7 +1215,7 @@ func (p *ironicProvisioner) Adopt(data provisioner.AdoptData, restartOnFailure b
 
 	switch nodes.ProvisionState(ironicNode.ProvisionState) {
 	case nodes.Enroll, nodes.Verifying:
-		return transientError(fmt.Errorf("Invalid state for adopt: %s",
+		return transientError(fmt.Errorf("invalid state for adopt: %s",
 			ironicNode.ProvisionState))
 	case nodes.Manageable:
 		_, hasImageSource := ironicNode.InstanceInfo["image_source"]
@@ -1494,7 +1489,7 @@ func (p *ironicProvisioner) Prepare(data provisioner.PrepareData, unprepared boo
 		result, err = operationContinuing(provisionRequeueDelay)
 
 	default:
-		result, err = transientError(fmt.Errorf("Have unexpected ironic node state %s", ironicNode.ProvisionState))
+		result, err = transientError(fmt.Errorf("have unexpected ironic node state %s", ironicNode.ProvisionState))
 	}
 	return
 }
@@ -1582,7 +1577,6 @@ func (p *ironicProvisioner) Provision(data provisioner.ProvisionData, forceReboo
 	// Ironic has the settings it needs, see if it finds any issues
 	// with them.
 	switch nodes.ProvisionState(ironicNode.ProvisionState) {
-
 	case nodes.DeployFail:
 		// Since we were here ironic has recorded an error for this host,
 		// with the image and checksum we have been trying to use, so we
@@ -1801,7 +1795,7 @@ func (p *ironicProvisioner) Deprovision(restartOnFailure bool) (result provision
 
 	default:
 		// FIXME(zaneb): this error is unlikely to actually be transient
-		return transientError(fmt.Errorf("Unhandled ironic state %s", ironicNode.ProvisionState))
+		return transientError(fmt.Errorf("unhandled ironic state %s", ironicNode.ProvisionState))
 	}
 }
 
@@ -2038,7 +2032,6 @@ func (p *ironicProvisioner) HasCapacity() (result bool, err error) {
 }
 
 func (p *ironicProvisioner) loadBusyHosts() (hosts map[string]struct{}, err error) {
-
 	hosts = make(map[string]struct{})
 	pager := nodes.List(p.client, nodes.ListOpts{
 		Fields: []string{"uuid,name,provision_state,boot_interface"},
@@ -2055,7 +2048,6 @@ func (p *ironicProvisioner) loadBusyHosts() (hosts map[string]struct{}, err erro
 	}
 
 	for _, node := range allNodes {
-
 		switch nodes.ProvisionState(node.ProvisionState) {
 		case nodes.Cleaning, nodes.CleanWait,
 			nodes.Inspecting, nodes.InspectWait,
diff --git a/pkg/provisioner/ironic/raid.go b/pkg/provisioner/ironic/raid.go
index d055af63..03718eb5 100644
--- a/pkg/provisioner/ironic/raid.go
+++ b/pkg/provisioner/ironic/raid.go
@@ -17,7 +17,7 @@ const (
 	softwareRAIDInterface string = "agent"
 )
 
-// setTargetRAIDCfg set the RAID settings to the ironic Node for RAID configuration steps
+// setTargetRAIDCfg set the RAID settings to the ironic Node for RAID configuration steps.
 func setTargetRAIDCfg(p *ironicProvisioner, raidInterface string, ironicNode *nodes.Node, data provisioner.PrepareData) (provisioner.Result, error) {
 	targetRaidInterface, err := CheckRAIDInterface(raidInterface, data.TargetRAIDConfig, data.ActualRAIDConfig)
 	if err != nil {
@@ -62,7 +62,7 @@ func setTargetRAIDCfg(p *ironicProvisioner, raidInterface string, ironicNode *no
 	return provisioner.Result{}, nil
 }
 
-// BuildTargetRAIDCfg build RAID logical disks, this method doesn't set the root volume
+// BuildTargetRAIDCfg build RAID logical disks, this method doesn't set the root volume.
 func BuildTargetRAIDCfg(raid *metal3api.RAIDConfig) (logicalDisks []nodes.LogicalDisk, err error) {
 	// Deal possible panic
 	defer func() {
@@ -86,7 +86,7 @@ func BuildTargetRAIDCfg(raid *metal3api.RAIDConfig) (logicalDisks []nodes.Logica
 	return
 }
 
-// A private method to build hardware RAID disks
+// A private method to build hardware RAID disks.
 func buildTargetHardwareRAIDCfg(volumes []metal3api.HardwareRAIDVolume) (logicalDisks []nodes.LogicalDisk, err error) {
 	var (
 		logicalDisk    nodes.LogicalDisk
@@ -151,7 +151,7 @@ func buildTargetHardwareRAIDCfg(volumes []metal3api.HardwareRAIDVolume) (logical
 	return
 }
 
-// A private method to build software RAID disks
+// A private method to build software RAID disks.
 func buildTargetSoftwareRAIDCfg(volumes []metal3api.SoftwareRAIDVolume) (logicalDisks []nodes.LogicalDisk, err error) {
 	var (
 		logicalDisk nodes.LogicalDisk
@@ -183,7 +183,7 @@ func buildTargetSoftwareRAIDCfg(volumes []metal3api.SoftwareRAIDVolume) (logical
 	return
 }
 
-// BuildRAIDCleanSteps build the clean steps for RAID configuration from BaremetalHost spec
+// BuildRAIDCleanSteps build the clean steps for RAID configuration from BaremetalHost spec.
 func BuildRAIDCleanSteps(raidInterface string, target *metal3api.RAIDConfig, actual *metal3api.RAIDConfig) (cleanSteps []nodes.CleanStep, err error) {
 	_, err = CheckRAIDInterface(raidInterface, target, actual)
 	if err != nil {
@@ -276,7 +276,7 @@ func BuildRAIDCleanSteps(raidInterface string, target *metal3api.RAIDConfig, act
 	return
 }
 
-// CheckRAIDInterface checks the current RAID interface against the requested configuration
+// CheckRAIDInterface checks the current RAID interface against the requested configuration.
 func CheckRAIDInterface(raidInterface string, target, actual *metal3api.RAIDConfig) (string, error) {
 	if target == nil {
 		return raidInterface, nil
diff --git a/pkg/provisioner/provisioner.go b/pkg/provisioner/provisioner.go
index 3b791de5..24191e58 100644
--- a/pkg/provisioner/provisioner.go
+++ b/pkg/provisioner/provisioner.go
@@ -40,7 +40,7 @@ func BuildHostData(host metal3api.BareMetalHost, bmcCreds bmc.Credentials) HostD
 	}
 }
 
-// For controllers that do not need to manage the BMC just set the host and node ID to use with Ironic API
+// For controllers that do not need to manage the BMC just set the host and node ID to use with Ironic API.
 func BuildHostDataNoBMC(host metal3api.BareMetalHost) HostData {
 	return HostData{
 		ObjectMeta:    *host.ObjectMeta.DeepCopy(),
@@ -53,7 +53,7 @@ type Factory interface {
 	NewProvisioner(hostData HostData, publish EventPublisher) (Provisioner, error)
 }
 
-// HostConfigData retrieves host configuration data
+// HostConfigData retrieves host configuration data.
 type HostConfigData interface {
 	// UserData is the interface for a function to retrieve user
 	// data for a host being provisioned.
@@ -213,16 +213,16 @@ type Result struct {
 	ErrorMessage string
 }
 
-// HardwareState holds the response from an UpdateHardwareState call
+// HardwareState holds the response from an UpdateHardwareState call.
 type HardwareState struct {
 	// PoweredOn is a pointer to a bool indicating whether the Host is currently
 	// powered on. The value is nil if the power state cannot be determined.
 	PoweredOn *bool
 }
 
-// ErrNeedsRegistration is returned if the host is not registered
-var ErrNeedsRegistration = errors.New("Host not registered")
+// ErrNeedsRegistration is returned if the host is not registered.
+var ErrNeedsRegistration = errors.New("host not registered")
 
 // ErrNeedsPreprovisioningImage is returned if a preprovisioning image is
-// required
-var ErrNeedsPreprovisioningImage = errors.New("No suitable Preprovisioning image available")
+// required.
+var ErrNeedsPreprovisioningImage = errors.New("no suitable Preprovisioning image available")
diff --git a/pkg/secretutils/secret_manager.go b/pkg/secretutils/secret_manager.go
index 27e07c5a..981dc33a 100644
--- a/pkg/secretutils/secret_manager.go
+++ b/pkg/secretutils/secret_manager.go
@@ -30,7 +30,7 @@ type SecretManager struct {
 	apiReader client.Reader
 }
 
-// NewSecretManager returns a new SecretManager
+// NewSecretManager returns a new SecretManager.
 func NewSecretManager(log logr.Logger, cacheClient client.Client, apiReader client.Reader) SecretManager {
 	return SecretManager{
 		log:       log.WithName("secret_manager"),
@@ -69,7 +69,7 @@ func (sm *SecretManager) claimSecret(secret *corev1.Secret, owner client.Object,
 	log := sm.log.WithValues("secret", secret.Name, "secretNamespace", secret.Namespace)
 	needsUpdate := false
 	if !metav1.HasLabel(secret.ObjectMeta, LabelEnvironmentName) {
-		log.Info("settting secret environment label")
+		log.Info("setting secret environment label")
 		metav1.SetMetaDataLabel(&secret.ObjectMeta, LabelEnvironmentName, LabelEnvironmentValue)
 		needsUpdate = true
 	}


Test patch:
diff --git a/cmd/make-bm-worker/templates/templates_test.go b/cmd/make-bm-worker/templates/templates_test.go
index 1546d646..2f8b22d0 100644
--- a/cmd/make-bm-worker/templates/templates_test.go
+++ b/cmd/make-bm-worker/templates/templates_test.go
@@ -6,6 +6,7 @@ import (
 )
 
 func compareStrings(t *testing.T, s1, s2 string) bool {
+	t.Helper()
 	if s1 == s2 {
 		return true
 	}
diff --git a/controllers/metal3.io/action_result_test.go b/controllers/metal3.io/action_result_test.go
index 770a87ee..3886314d 100644
--- a/controllers/metal3.io/action_result_test.go
+++ b/controllers/metal3.io/action_result_test.go
@@ -9,7 +9,6 @@ import (
 )
 
 func TestBackoffIncrements(t *testing.T) {
-
 	var backOff time.Duration
 	for i := 1; i <= maxBackOffCount; i++ {
 		prev := backOff
@@ -17,11 +16,9 @@ func TestBackoffIncrements(t *testing.T) {
 
 		assert.GreaterOrEqual(t, backOff.Milliseconds(), prev.Milliseconds())
 	}
-
 }
 
 func TestMaxBackoffDuration(t *testing.T) {
-
 	maxBackOffDuration := (time.Minute * time.Duration(math.Exp2(float64(maxBackOffCount)))).Milliseconds()
 
 	assert.LessOrEqual(t, calculateBackoff(maxBackOffCount-1).Milliseconds(), maxBackOffDuration)
diff --git a/controllers/metal3.io/baremetalhost_controller_test.go b/controllers/metal3.io/baremetalhost_controller_test.go
index 507ebd2d..52c35151 100644
--- a/controllers/metal3.io/baremetalhost_controller_test.go
+++ b/controllers/metal3.io/baremetalhost_controller_test.go
@@ -2,7 +2,6 @@ package controllers
 
 import (
 	"context"
-	goctx "context"
 	"encoding/base64"
 	"encoding/json"
 	"errors"
@@ -104,7 +103,8 @@ func newHostFirmwareSettings(host *metal3api.BareMetalHost, conditions []metav1.
 	return hfs
 }
 
-func newDefaultNamedHost(name string, t *testing.T) *metal3api.BareMetalHost {
+func newDefaultNamedHost(t *testing.T, name string) *metal3api.BareMetalHost {
+	t.Helper()
 	spec := &metal3api.BareMetalHostSpec{
 		BMC: metal3api.BMCDetails{
 			Address:         "ipmi://192.168.122.1:6233",
@@ -130,7 +130,8 @@ func newDefaultNamedHost(name string, t *testing.T) *metal3api.BareMetalHost {
 }
 
 func newDefaultHost(t *testing.T) *metal3api.BareMetalHost {
-	return newDefaultNamedHost(t.Name(), t)
+	t.Helper()
+	return newDefaultNamedHost(t, t.Name())
 }
 
 func newTestReconcilerWithFixture(fix *fixture.Fixture, initObjs ...runtime.Object) *BareMetalHostReconciler {
@@ -141,7 +142,7 @@ func newTestReconcilerWithFixture(fix *fixture.Fixture, initObjs ...runtime.Obje
 	c := clientBuilder.Build()
 	// Add a default secret that can be used by most hosts.
 	bmcSecret := newBMCCredsSecret(defaultSecretName, "User", "Pass")
-	c.Create(goctx.TODO(), bmcSecret)
+	c.Create(context.TODO(), bmcSecret)
 
 	return &BareMetalHostReconciler{
 		Client:             c,
@@ -167,7 +168,7 @@ func newRequest(host *metal3api.BareMetalHost) ctrl.Request {
 }
 
 func tryReconcile(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost, isDone DoneFunc) {
-
+	t.Helper()
 	request := newRequest(host)
 
 	for i := 0; ; i++ {
@@ -186,7 +187,7 @@ func tryReconcile(t *testing.T, r *BareMetalHostReconciler, host *metal3api.Bare
 		// need to replace the one we have with the updated data in
 		// order to test it. In case it was not found, let's set it to nil
 		updatedHost := &metal3api.BareMetalHost{}
-		if err = r.Get(goctx.TODO(), request.NamespacedName, updatedHost); k8serrors.IsNotFound(err) {
+		if err = r.Get(context.TODO(), request.NamespacedName, updatedHost); k8serrors.IsNotFound(err) {
 			host = nil
 		} else {
 			updatedHost.DeepCopyInto(host)
@@ -205,6 +206,7 @@ func tryReconcile(t *testing.T, r *BareMetalHostReconciler, host *metal3api.Bare
 }
 
 func waitForStatus(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost, desiredStatus metal3api.OperationalStatus) {
+	t.Helper()
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			state := host.OperationalStatus()
@@ -215,6 +217,7 @@ func waitForStatus(t *testing.T, r *BareMetalHostReconciler, host *metal3api.Bar
 }
 
 func waitForError(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost) {
+	t.Helper()
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("Waiting for error: %q", host.Status.ErrorMessage)
@@ -224,6 +227,7 @@ func waitForError(t *testing.T, r *BareMetalHostReconciler, host *metal3api.Bare
 }
 
 func waitForNoError(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost) {
+	t.Helper()
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("Waiting for no error message: %q", host.Status.ErrorMessage)
@@ -233,6 +237,7 @@ func waitForNoError(t *testing.T, r *BareMetalHostReconciler, host *metal3api.Ba
 }
 
 func waitForProvisioningState(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost, desiredState metal3api.ProvisioningState) {
+	t.Helper()
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("Waiting for state %q have state %q", desiredState, host.Status.Provisioning.State)
@@ -243,7 +248,7 @@ func waitForProvisioningState(t *testing.T, r *BareMetalHostReconciler, host *me
 
 // TestHardwareDetails_EmptyStatus ensures that hardware details in
 // the status field are populated when the hardwaredetails annotation
-// is present and no existing HarwareDetails are present
+// is present and no existing HarwareDetails are present.
 func TestHardwareDetails_EmptyStatus(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = map[string]string{
@@ -264,7 +269,7 @@ func TestHardwareDetails_EmptyStatus(t *testing.T) {
 }
 
 // TestHardwareDetails_StatusPresent ensures that hardware details in
-// the hardwaredetails annotation is ignored with existing Status
+// the hardwaredetails annotation is ignored with existing Status.
 func TestHardwareDetails_StatusPresent(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = map[string]string{
@@ -291,7 +296,7 @@ func TestHardwareDetails_StatusPresent(t *testing.T) {
 
 // TestHardwareDetails_StatusPresentInspectDisabled ensures that
 // hardware details in the hardwaredetails annotation are consumed
-// even when existing status exists, when inspection is disabled
+// even when existing status exists, when inspection is disabled.
 func TestHardwareDetails_StatusPresentInspectDisabled(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = map[string]string{
@@ -318,7 +323,7 @@ func TestHardwareDetails_StatusPresentInspectDisabled(t *testing.T) {
 }
 
 // TestHardwareDetails_Invalid
-// Tests scenario where the hardwaredetails value is invalid
+// Tests scenario where the hardwaredetails value is invalid.
 func TestHardwareDetails_Invalid(t *testing.T) {
 	host := newDefaultHost(t)
 	badAnnotation := fmt.Sprintf("{\"hardware\": %s}", hwdAnnotation)
@@ -426,7 +431,6 @@ func TestStatusAnnotation_Partial(t *testing.T) {
 // TestHardwareDataExist ensures hardwareData takes precedence over
 // statusAnnotation when updating during BareMetalHost status.
 func TestHardwareDataExist(t *testing.T) {
-
 	host := newDefaultHost(t)
 	host.Annotations = map[string]string{
 		metal3api.StatusAnnotation: statusAnnotation,
@@ -483,7 +487,7 @@ func TestPause(t *testing.T) {
 	)
 }
 
-// TestInspectDisabled ensures that Inspection is skipped when disabled
+// TestInspectDisabled ensures that Inspection is skipped when disabled.
 func TestInspectDisabled(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = map[string]string{
@@ -494,7 +498,7 @@ func TestInspectDisabled(t *testing.T) {
 	assert.Nil(t, host.Status.HardwareDetails)
 }
 
-// TestInspectEnabled ensures that Inspection is completed when not disabled
+// TestInspectEnabled ensures that Inspection is completed when not disabled.
 func TestInspectEnabled(t *testing.T) {
 	host := newDefaultHost(t)
 	r := newTestReconciler(host)
@@ -525,7 +529,7 @@ func TestAddFinalizers(t *testing.T) {
 
 // TestDoNotAddSecretFinalizersDuringDelete verifies that during a host deletion,
 // in case the removal of a secret finalizer triggers an immediate reconcile loop,
-// then the secret finalizer is not added again
+// then the secret finalizer is not added again.
 func TestDoNotAddSecretFinalizersDuringDelete(t *testing.T) {
 	host := newDefaultHost(t)
 	r := newTestReconciler(host)
@@ -547,7 +551,7 @@ func TestDoNotAddSecretFinalizersDuringDelete(t *testing.T) {
 	// The fake client will immediately remove the host
 	// from its cache, so let's keep the latest updated
 	// host
-	r.Get(goctx.TODO(), request.NamespacedName, host)
+	r.Get(context.TODO(), request.NamespacedName, host)
 	_, err = r.Reconcile(context.Background(), request)
 	assert.NoError(t, err)
 
@@ -575,10 +579,7 @@ func TestSetLastUpdated(t *testing.T) {
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("LastUpdated: %v", host.Status.LastUpdated)
-			if !host.Status.LastUpdated.IsZero() {
-				return true
-			}
-			return false
+			return !host.Status.LastUpdated.IsZero()
 		},
 	)
 }
@@ -601,7 +602,6 @@ func makeReconcileInfo(host *metal3api.BareMetalHost) *reconcileInfo {
 }
 
 func TestHasRebootAnnotation(t *testing.T) {
-
 	testCases := []struct {
 		Scenario       string
 		Annotations    map[string]string
@@ -702,7 +702,7 @@ func TestHasRebootAnnotation(t *testing.T) {
 }
 
 // TestRebootWithSuffixlessAnnotation tests full reboot cycle with suffixless
-// annotation which doesn't wait for annotation removal before power on
+// annotation which doesn't wait for annotation removal before power on.
 func TestRebootWithSuffixlessAnnotation(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = make(map[string]string)
@@ -718,11 +718,7 @@ func TestRebootWithSuffixlessAnnotation(t *testing.T) {
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-			if host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return !host.Status.PoweredOn
 		},
 	)
 
@@ -738,29 +734,20 @@ func TestRebootWithSuffixlessAnnotation(t *testing.T) {
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-			if !host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return host.Status.PoweredOn
 		},
 	)
 
-	//make sure we don't go into another reboot
+	// make sure we don't go into another reboot
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-
-			if !host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return host.Status.PoweredOn
 		},
 	)
 }
 
 // TestRebootWithSuffixedAnnotation tests a full reboot cycle, with suffixed annotation
-// to verify that controller holds power off until annotation removal
+// to verify that controller holds power off until annotation removal.
 func TestRebootWithSuffixedAnnotation(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Annotations = make(map[string]string)
@@ -777,58 +764,42 @@ func TestRebootWithSuffixedAnnotation(t *testing.T) {
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-			if host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return !host.Status.PoweredOn
 		},
 	)
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-			//we expect that the machine will be powered off until we remove annotation
-			if host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			// we expect that the machine will be powered off until we remove annotation
+			return !host.Status.PoweredOn
 		},
 	)
 
 	delete(host.Annotations, annotation)
-	r.Update(goctx.TODO(), host)
+	r.Update(context.TODO(), host)
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-
-			if !host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return host.Status.PoweredOn
 		},
 	)
 
-	//make sure we don't go into another reboot
+	// make sure we don't go into another reboot
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-			if !host.Status.PoweredOn {
-				return false
-			}
-
-			return true
+			return host.Status.PoweredOn
 		},
 	)
 }
 
 func getHostSecret(t *testing.T, r *BareMetalHostReconciler, host *metal3api.BareMetalHost) (secret *corev1.Secret) {
+	t.Helper()
 	secret = &corev1.Secret{}
 	secretName := types.NamespacedName{
 		Namespace: host.Namespace,
 		Name:      host.Spec.BMC.CredentialsName,
 	}
-	err := r.Get(goctx.TODO(), secretName, secret)
+	err := r.Get(context.TODO(), secretName, secret)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -851,7 +822,6 @@ func TestSecretUpdateOwnerRefAndEnvironmentLabelOnStartup(t *testing.T) {
 	assert.Nil(t, secret.OwnerReferences[0].Controller)
 	assert.Nil(t, secret.OwnerReferences[0].BlockOwnerDeletion)
 	assert.Equal(t, "baremetal", secret.Labels["environment.metal3.io"])
-
 }
 
 // TestUpdateCredentialsSecretSuccessFields ensures that the
@@ -865,13 +835,9 @@ func TestUpdateCredentialsSecretSuccessFields(t *testing.T) {
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("ref: %v ver: %s", host.Status.GoodCredentials.Reference,
 				host.Status.GoodCredentials.Version)
-			if host.Status.GoodCredentials.Version != "" {
-				return true
-			}
-			return false
+			return host.Status.GoodCredentials.Version != ""
 		},
 	)
-
 }
 
 // TestUpdateGoodCredentialsOnNewSecret ensures that the
@@ -885,22 +851,19 @@ func TestUpdateGoodCredentialsOnNewSecret(t *testing.T) {
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("ref: %v ver: %s", host.Status.GoodCredentials.Reference,
 				host.Status.GoodCredentials.Version)
-			if host.Status.GoodCredentials.Version != "" {
-				return true
-			}
-			return false
+			return host.Status.GoodCredentials.Version != ""
 		},
 	)
 
 	// Define a second valid secret and update the host to use it.
 	secret2 := newBMCCredsSecret("bmc-creds-valid2", "User", "Pass")
-	err := r.Create(goctx.TODO(), secret2)
+	err := r.Create(context.TODO(), secret2)
 	if err != nil {
 		t.Fatal(err)
 	}
 
 	host.Spec.BMC.CredentialsName = "bmc-creds-valid2"
-	err = r.Update(goctx.TODO(), host)
+	err = r.Update(context.TODO(), host)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -929,22 +892,18 @@ func TestUpdateGoodCredentialsOnBadSecret(t *testing.T) {
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("ref: %v ver: %s", host.Status.GoodCredentials.Reference,
 				host.Status.GoodCredentials.Version)
-			if host.Status.GoodCredentials.Version != "" {
-				return true
-			}
-			return false
+			return host.Status.GoodCredentials.Version != ""
 		},
 	)
 
 	host.Spec.BMC.CredentialsName = "bmc-creds-no-user"
-	err := r.Update(goctx.TODO(), host)
+	err := r.Update(context.TODO(), host)
 	if err != nil {
 		t.Fatal(err)
 	}
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
-
 			t.Logf("ref: %v ver: %s", host.Status.GoodCredentials.Reference,
 				host.Status.GoodCredentials.Version)
 			if host.Spec.BMC.CredentialsName != "bmc-creds-no-user" {
@@ -981,7 +940,6 @@ func TestDiscoveredHost(t *testing.T) {
 // TestMissingBMCParameters ensures that a host that is missing some
 // of the required BMC settings is put into an error state.
 func TestMissingBMCParameters(t *testing.T) {
-
 	testCases := []struct {
 		Scenario string
 		Secret   *corev1.Secret
@@ -1065,7 +1023,6 @@ func TestMissingBMCParameters(t *testing.T) {
 // TestFixSecret ensures that when the secret for a host is updated to
 // be correct the status of the host moves out of the error state.
 func TestFixSecret(t *testing.T) {
-
 	secret := newBMCCredsSecret("bmc-creds-no-user", "", "Pass")
 	host := newHost("fix-secret",
 		&metal3api.BareMetalHostSpec{
@@ -1082,12 +1039,12 @@ func TestFixSecret(t *testing.T) {
 		Namespace: namespace,
 		Name:      "bmc-creds-no-user",
 	}
-	err := r.Get(goctx.TODO(), secretName, secret)
+	err := r.Get(context.TODO(), secretName, secret)
 	if err != nil {
 		t.Fatal(err)
 	}
 	secret.Data["username"] = []byte(base64.StdEncoding.EncodeToString([]byte("username")))
-	err = r.Update(goctx.TODO(), secret)
+	err = r.Update(context.TODO(), secret)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -1098,7 +1055,6 @@ func TestFixSecret(t *testing.T) {
 // is updated to be broken, and then correct, the status of the host
 // moves out of the error state.
 func TestBreakThenFixSecret(t *testing.T) {
-
 	// Create the host without any errors and wait for it to be
 	// registered and get a provisioning ID.
 	secret := newBMCCredsSecret("bmc-creds-toggle-user", "User", "Pass")
@@ -1125,13 +1081,13 @@ func TestBreakThenFixSecret(t *testing.T) {
 		Namespace: namespace,
 		Name:      "bmc-creds-toggle-user",
 	}
-	err := r.Get(goctx.TODO(), secretName, secret)
+	err := r.Get(context.TODO(), secretName, secret)
 	if err != nil {
 		t.Fatal(err)
 	}
 	oldUsername := secret.Data["username"]
 	secret.Data["username"] = []byte{}
-	err = r.Update(goctx.TODO(), secret)
+	err = r.Update(context.TODO(), secret)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -1140,17 +1096,16 @@ func TestBreakThenFixSecret(t *testing.T) {
 	// Modify the secret to be correct again. Wait for the error to be
 	// cleared from the host.
 	secret = &corev1.Secret{}
-	err = r.Get(goctx.TODO(), secretName, secret)
+	err = r.Get(context.TODO(), secretName, secret)
 	if err != nil {
 		t.Fatal(err)
 	}
 	secret.Data["username"] = oldUsername
-	err = r.Update(goctx.TODO(), secret)
+	err = r.Update(context.TODO(), secret)
 	if err != nil {
 		t.Fatal(err)
 	}
 	waitForNoError(t, r, host)
-
 }
 
 // TestSetHardwareProfile ensures that the host has a label with
@@ -1162,10 +1117,7 @@ func TestSetHardwareProfile(t *testing.T) {
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("profile: %v", host.Status.HardwareProfile)
-			if host.Status.HardwareProfile != "" {
-				return true
-			}
-			return false
+			return host.Status.HardwareProfile != ""
 		},
 	)
 }
@@ -1179,10 +1131,7 @@ func TestCreateHardwareDetails(t *testing.T) {
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			t.Logf("new host details: %v", host.Status.HardwareDetails)
-			if host.Status.HardwareDetails != nil {
-				return true
-			}
-			return false
+			return host.Status.HardwareDetails != nil
 		},
 	)
 }
@@ -1305,10 +1254,7 @@ func TestProvision(t *testing.T) {
 			t.Logf("image details: %v", host.Spec.Image)
 			t.Logf("provisioning image details: %v", host.Status.Provisioning.Image)
 			t.Logf("provisioning state: %v", host.Status.Provisioning.State)
-			if host.Status.Provisioning.Image.URL != "" {
-				return true
-			}
-			return false
+			return host.Status.Provisioning.Image.URL != ""
 		},
 	)
 }
@@ -1363,7 +1309,6 @@ func TestProvisionCustomDeployWithURL(t *testing.T) {
 // expected states when it looks like it has been provisioned by
 // another tool.
 func TestExternallyProvisionedTransitions(t *testing.T) {
-
 	t.Run("registered to externally provisioned", func(t *testing.T) {
 		host := newDefaultHost(t)
 		host.Spec.Online = true
@@ -1383,7 +1328,7 @@ func TestExternallyProvisionedTransitions(t *testing.T) {
 		waitForProvisioningState(t, r, host, metal3api.StateExternallyProvisioned)
 
 		host.Spec.ExternallyProvisioned = false
-		err := r.Update(goctx.TODO(), host)
+		err := r.Update(context.TODO(), host)
 		if err != nil {
 			t.Fatal(err)
 		}
@@ -1400,7 +1345,7 @@ func TestExternallyProvisionedTransitions(t *testing.T) {
 		waitForProvisioningState(t, r, host, metal3api.StatePreparing)
 
 		host.Spec.ExternallyProvisioned = true
-		err := r.Update(goctx.TODO(), host)
+		err := r.Update(context.TODO(), host)
 		if err != nil {
 			t.Fatal(err)
 		}
@@ -1408,7 +1353,6 @@ func TestExternallyProvisionedTransitions(t *testing.T) {
 
 		waitForProvisioningState(t, r, host, metal3api.StateExternallyProvisioned)
 	})
-
 }
 
 // TestPowerOn verifies that the controller turns the host on when it
@@ -1441,7 +1385,7 @@ func TestPowerOff(t *testing.T) {
 	)
 }
 
-// TestDeleteHost verifies several delete cases
+// TestDeleteHost verifies several delete cases.
 func TestDeleteHost(t *testing.T) {
 	now := metav1.Now()
 
@@ -1449,13 +1393,13 @@ func TestDeleteHost(t *testing.T) {
 
 	testCases := []HostFactory{
 		func() *metal3api.BareMetalHost {
-			host := newDefaultNamedHost("with-finalizer", t)
+			host := newDefaultNamedHost(t, "with-finalizer")
 			host.Finalizers = append(host.Finalizers,
 				metal3api.BareMetalHostFinalizer)
 			return host
 		},
 		func() *metal3api.BareMetalHost {
-			host := newDefaultNamedHost("without-bmc", t)
+			host := newDefaultNamedHost(t, "without-bmc")
 			host.Spec.BMC = metal3api.BMCDetails{}
 			host.Finalizers = append(host.Finalizers,
 				metal3api.BareMetalHostFinalizer)
@@ -1475,14 +1419,14 @@ func TestDeleteHost(t *testing.T) {
 			return host
 		},
 		func() *metal3api.BareMetalHost {
-			host := newDefaultNamedHost("host-with-hw-details", t)
+			host := newDefaultNamedHost(t, "host-with-hw-details")
 			host.Status.HardwareDetails = &metal3api.HardwareDetails{}
 			host.Finalizers = append(host.Finalizers,
 				metal3api.BareMetalHostFinalizer)
 			return host
 		},
 		func() *metal3api.BareMetalHost {
-			host := newDefaultNamedHost("provisioned-host", t)
+			host := newDefaultNamedHost(t, "provisioned-host")
 			host.Status.HardwareDetails = &metal3api.HardwareDetails{}
 			host.Status.Provisioning.Image = metal3api.Image{
 				URL:      "image-url",
@@ -1834,7 +1778,6 @@ func TestUpdateEventHandler(t *testing.T) {
 }
 
 func TestErrorCountIncrementsAlways(t *testing.T) {
-
 	errorTypes := []metal3api.ErrorType{metal3api.RegistrationError, metal3api.InspectionError, metal3api.ProvisioningError, metal3api.PowerManagementError}
 
 	b := &metal3api.BareMetalHost{}
@@ -2294,7 +2237,7 @@ func TestGetPreprovImageNoFormats(t *testing.T) {
 	assert.EqualError(t, err, "no acceptable formats for preprovisioning image")
 	assert.Nil(t, imgData)
 
-	assert.Error(t, r.Client.Get(goctx.TODO(), client.ObjectKey{
+	assert.Error(t, r.Client.Get(context.TODO(), client.ObjectKey{
 		Name:      host.Name,
 		Namespace: host.Namespace,
 	},
@@ -2316,7 +2259,7 @@ func TestGetPreprovImageCreateUpdate(t *testing.T) {
 	assert.Nil(t, imgData)
 
 	img := metal3api.PreprovisioningImage{}
-	assert.NoError(t, r.Client.Get(goctx.TODO(), client.ObjectKey{
+	assert.NoError(t, r.Client.Get(context.TODO(), client.ObjectKey{
 		Name:      host.Name,
 		Namespace: host.Namespace,
 	},
@@ -2333,7 +2276,7 @@ func TestGetPreprovImageCreateUpdate(t *testing.T) {
 	assert.NoError(t, err)
 	assert.Nil(t, imgData)
 
-	assert.NoError(t, r.Client.Get(goctx.TODO(), client.ObjectKey{
+	assert.NoError(t, r.Client.Get(context.TODO(), client.ObjectKey{
 		Name:      host.Name,
 		Namespace: host.Namespace,
 	},
@@ -2700,9 +2643,8 @@ func TestPreprovImageAvailable(t *testing.T) {
 }
 
 // TestHostFirwmareSettings verifies that a change to the HFS
-// can be detected as it will be used to set state to Preparing
+// can be detected as it will be used to set state to Preparing.
 func TestHostFirmwareSettings(t *testing.T) {
-
 	testCases := []struct {
 		Scenario   string
 		Conditions []metav1.Condition
@@ -2741,7 +2683,7 @@ func TestHostFirmwareSettings(t *testing.T) {
 			i.request = newRequest(host)
 
 			hfs := newHostFirmwareSettings(host, tc.Conditions)
-			r.Create(goctx.TODO(), hfs)
+			r.Create(context.TODO(), hfs)
 
 			dirty, _, err := r.getHostFirmwareSettings(i)
 			if err != nil {
@@ -2750,7 +2692,6 @@ func TestHostFirmwareSettings(t *testing.T) {
 			assert.Equal(t, tc.Dirty, dirty, "dirty flag did not match")
 		})
 	}
-
 }
 
 func TestBMHTransitionToPreparing(t *testing.T) {
@@ -2774,7 +2715,7 @@ func TestBMHTransitionToPreparing(t *testing.T) {
 		SimultaneousMultithreadingEnabled: &True,
 	}
 
-	err := r.Update(goctx.TODO(), host)
+	err := r.Update(context.TODO(), host)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -2795,7 +2736,7 @@ func TestHFSTransitionToPreparing(t *testing.T) {
 	hfs := &metal3api.HostFirmwareSettings{}
 	key := client.ObjectKey{
 		Namespace: host.ObjectMeta.Namespace, Name: host.ObjectMeta.Name}
-	if err := r.Get(goctx.TODO(), key, hfs); err != nil {
+	if err := r.Get(context.TODO(), key, hfs); err != nil {
 		t.Fatal(err)
 	}
 
@@ -2810,14 +2751,14 @@ func TestHFSTransitionToPreparing(t *testing.T) {
 		},
 	}
 
-	r.Update(goctx.TODO(), hfs)
+	r.Update(context.TODO(), hfs)
 
 	waitForProvisioningState(t, r, host, metal3api.StatePreparing)
 }
 
 // TestHFSEmptyStatusSettings ensures that BMH does not move to the next state
 // when a user provides the BIOS settings on a hardware server that does not
-// have the required license to configure BIOS
+// have the required license to configure BIOS.
 func TestHFSEmptyStatusSettings(t *testing.T) {
 	host := newDefaultHost(t)
 	host.Spec.Online = true
@@ -2831,7 +2772,7 @@ func TestHFSEmptyStatusSettings(t *testing.T) {
 	hfs := &metal3api.HostFirmwareSettings{}
 	key := client.ObjectKey{
 		Namespace: host.ObjectMeta.Namespace, Name: host.ObjectMeta.Name}
-	if err := r.Get(goctx.TODO(), key, hfs); err != nil {
+	if err := r.Get(context.TODO(), key, hfs); err != nil {
 		t.Fatal(err)
 	}
 
@@ -2842,7 +2783,7 @@ func TestHFSEmptyStatusSettings(t *testing.T) {
 		},
 	}
 
-	r.Update(goctx.TODO(), hfs)
+	r.Update(context.TODO(), hfs)
 
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
@@ -2858,7 +2799,7 @@ func TestHFSEmptyStatusSettings(t *testing.T) {
 		},
 	}
 
-	r.Update(goctx.TODO(), hfs)
+	r.Update(context.TODO(), hfs)
 	tryReconcile(t, r, host,
 		func(host *metal3api.BareMetalHost, result reconcile.Result) bool {
 			return host.Status.Provisioning.State == metal3api.StateAvailable
diff --git a/controllers/metal3.io/demo_test.go b/controllers/metal3.io/demo_test.go
index c45cf025..be47348e 100644
--- a/controllers/metal3.io/demo_test.go
+++ b/controllers/metal3.io/demo_test.go
@@ -17,7 +17,6 @@ import (
 )
 
 func newDemoReconciler(initObjs ...runtime.Object) *BareMetalHostReconciler {
-
 	clientBuilder := fakeclient.NewClientBuilder().WithRuntimeObjects(initObjs...)
 	for _, v := range initObjs {
 		clientBuilder = clientBuilder.WithStatusSubresource(v.(client.Object))
@@ -36,9 +35,9 @@ func newDemoReconciler(initObjs ...runtime.Object) *BareMetalHostReconciler {
 }
 
 // TestDemoRegistrationError tests that a host with the right name reports
-// a registration error
+// a registration error.
 func TestDemoRegistrationError(t *testing.T) {
-	host := newDefaultNamedHost(demo.RegistrationErrorHost, t)
+	host := newDefaultNamedHost(t, demo.RegistrationErrorHost)
 	r := newDemoReconciler(host)
 
 	tryReconcile(t, r, host,
@@ -54,9 +53,9 @@ func TestDemoRegistrationError(t *testing.T) {
 }
 
 // TestDemoRegistering tests that a host with the right name reports
-// that it is being registered
+// that it is being registered.
 func TestDemoRegistering(t *testing.T) {
-	host := newDefaultNamedHost(demo.RegisteringHost, t)
+	host := newDefaultNamedHost(t, demo.RegisteringHost)
 	r := newDemoReconciler(host)
 
 	tryReconcile(t, r, host,
@@ -72,9 +71,9 @@ func TestDemoRegistering(t *testing.T) {
 }
 
 // TestDemoInspecting tests that a host with the right name reports
-// that it is being inspected
+// that it is being inspected.
 func TestDemoInspecting(t *testing.T) {
-	host := newDefaultNamedHost(demo.InspectingHost, t)
+	host := newDefaultNamedHost(t, demo.InspectingHost)
 	r := newDemoReconciler(host)
 
 	tryReconcile(t, r, host,
@@ -90,7 +89,7 @@ func TestDemoInspecting(t *testing.T) {
 }
 
 func TestDemoPreparing(t *testing.T) {
-	host := newDefaultNamedHost(demo.PreparingHost, t)
+	host := newDefaultNamedHost(t, demo.PreparingHost)
 	host.Spec.Image = &metal3api.Image{
 		URL:      "a-url",
 		Checksum: "a-checksum",
@@ -111,7 +110,7 @@ func TestDemoPreparing(t *testing.T) {
 }
 
 func TestDemoPreparingError(t *testing.T) {
-	host := newDefaultNamedHost(demo.PreparingErrorHost, t)
+	host := newDefaultNamedHost(t, demo.PreparingErrorHost)
 	host.Spec.Image = &metal3api.Image{
 		URL:      "a-url",
 		Checksum: "a-checksum",
@@ -132,9 +131,9 @@ func TestDemoPreparingError(t *testing.T) {
 }
 
 // TestDemoAvailable tests that a host with the right name reports
-// that it is available to be provisioned
+// that it is available to be provisioned.
 func TestDemoAvailable(t *testing.T) {
-	host := newDefaultNamedHost(demo.AvailableHost, t)
+	host := newDefaultNamedHost(t, demo.AvailableHost)
 	r := newDemoReconciler(host)
 
 	tryReconcile(t, r, host,
@@ -150,9 +149,9 @@ func TestDemoAvailable(t *testing.T) {
 }
 
 // TestDemoProvisioning tests that a host with the right name reports
-// that it is being provisioned
+// that it is being provisioned.
 func TestDemoProvisioning(t *testing.T) {
-	host := newDefaultNamedHost(demo.ProvisioningHost, t)
+	host := newDefaultNamedHost(t, demo.ProvisioningHost)
 	host.Spec.Image = &metal3api.Image{
 		URL:      "a-url",
 		Checksum: "a-checksum",
@@ -173,9 +172,9 @@ func TestDemoProvisioning(t *testing.T) {
 }
 
 // TestDemoProvisioned tests that a host with the right name reports
-// that it has been provisioned
+// that it has been provisioned.
 func TestDemoProvisioned(t *testing.T) {
-	host := newDefaultNamedHost(demo.ProvisionedHost, t)
+	host := newDefaultNamedHost(t, demo.ProvisionedHost)
 	host.Spec.Image = &metal3api.Image{
 		URL:      "a-url",
 		Checksum: "a-checksum",
@@ -196,9 +195,9 @@ func TestDemoProvisioned(t *testing.T) {
 }
 
 // TestDemoValidationError tests that a host with the right name
-// reports that it had and error while being provisioned
+// reports that it had and error while being provisioned.
 func TestDemoValidationError(t *testing.T) {
-	host := newDefaultNamedHost(demo.ValidationErrorHost, t)
+	host := newDefaultNamedHost(t, demo.ValidationErrorHost)
 	host.Spec.Image = &metal3api.Image{
 		URL:      "a-url",
 		Checksum: "a-checksum",
diff --git a/controllers/metal3.io/host_config_data_test.go b/controllers/metal3.io/host_config_data_test.go
index 2d8fa468..b80d3e1b 100644
--- a/controllers/metal3.io/host_config_data_test.go
+++ b/controllers/metal3.io/host_config_data_test.go
@@ -20,7 +20,6 @@ import (
 )
 
 func TestLabelSecrets(t *testing.T) {
-
 	testCases := []struct {
 		name     string
 		getter   func(hcd *hostConfigData) (string, error)
@@ -85,7 +84,6 @@ func TestLabelSecrets(t *testing.T) {
 			assert.Equal(t, "baremetal", actualSecret.Labels["environment.metal3.io"])
 		})
 	}
-
 }
 
 func TestProvisionWithHostConfig(t *testing.T) {
diff --git a/controllers/metal3.io/host_state_machine_test.go b/controllers/metal3.io/host_state_machine_test.go
index 0d0e94a9..947a4302 100644
--- a/controllers/metal3.io/host_state_machine_test.go
+++ b/controllers/metal3.io/host_state_machine_test.go
@@ -14,7 +14,6 @@ import (
 	fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	"github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/profile"
 	"github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner"
@@ -27,7 +26,7 @@ func testStateMachine(host *metal3api.BareMetalHost) *hostStateMachine {
 	return newHostStateMachine(host, r, p, true)
 }
 
-// Create a reconciler with a fake client to satisfy states that use the client
+// Create a reconciler with a fake client to satisfy states that use the client.
 func testNewReconciler(host *metal3api.BareMetalHost) *BareMetalHostReconciler {
 	reconciler := &BareMetalHostReconciler{
 		Client:             fakeclient.NewClientBuilder().WithObjects(host).Build(),
@@ -465,7 +464,7 @@ func TestDetachError(t *testing.T) {
 			assert.True(t, result.Dirty())
 			assert.Equal(t, 1, tc.Host.Status.ErrorCount)
 			assert.Equal(t, metal3api.OperationalStatusError, info.host.OperationalStatus())
-			assert.Equal(t, v1alpha1.DetachError, info.host.Status.ErrorType)
+			assert.Equal(t, metal3api.DetachError, info.host.Status.ErrorType)
 			assert.Equal(t, tc.ExpectedState, info.host.Status.Provisioning.State)
 
 			if tc.ClearError {
@@ -954,7 +953,6 @@ func TestErrorCountIncreasedOnActionFailure(t *testing.T) {
 }
 
 func TestErrorCountClearedOnStateTransition(t *testing.T) {
-
 	tests := []struct {
 		Scenario                     string
 		Host                         *metal3api.BareMetalHost
@@ -1024,7 +1022,6 @@ func TestErrorCountClearedOnStateTransition(t *testing.T) {
 }
 
 func TestErrorClean(t *testing.T) {
-
 	tests := []struct {
 		Scenario    string
 		Host        *metal3api.BareMetalHost
@@ -1060,10 +1057,10 @@ func TestErrorClean(t *testing.T) {
 			hsm.ReconcileState(info)
 
 			if tt.ExpectError {
-				assert.Equal(t, v1alpha1.ProvisionedRegistrationError, tt.Host.Status.ErrorType)
+				assert.Equal(t, metal3api.ProvisionedRegistrationError, tt.Host.Status.ErrorType)
 				assert.NotEmpty(t, tt.Host.Status.ErrorMessage)
 			} else {
-				assert.Equal(t, v1alpha1.OperationalStatusOK, tt.Host.Status.OperationalStatus)
+				assert.Equal(t, metal3api.OperationalStatusOK, tt.Host.Status.OperationalStatus)
 				assert.Empty(t, tt.Host.Status.ErrorType)
 				assert.Empty(t, tt.Host.Status.ErrorMessage)
 			}
@@ -1147,7 +1144,6 @@ type hostBuilder struct {
 }
 
 func host(state metal3api.ProvisioningState) *hostBuilder {
-
 	creds := metal3api.CredentialsStatus{
 		Reference: &corev1.SecretReference{
 			Name:      "secretRefName",
@@ -1162,21 +1158,21 @@ func host(state metal3api.ProvisioningState) *hostBuilder {
 				Name:      "foo",
 				Namespace: "bar",
 			},
-			Spec: v1alpha1.BareMetalHostSpec{
+			Spec: metal3api.BareMetalHostSpec{
 				Online: true,
-				Image: &v1alpha1.Image{
+				Image: &metal3api.Image{
 					URL: "not-empty",
 				},
-				RootDeviceHints: &v1alpha1.RootDeviceHints{},
+				RootDeviceHints: &metal3api.RootDeviceHints{},
 			},
 			Status: metal3api.BareMetalHostStatus{
 				HardwareProfile: profile.DefaultProfileName,
 				Provisioning: metal3api.ProvisionStatus{
 					State:           state,
-					BootMode:        v1alpha1.DefaultBootMode,
+					BootMode:        metal3api.DefaultBootMode,
 					RootDeviceHints: &metal3api.RootDeviceHints{},
-					Image: v1alpha1.Image{
-						URL: "", //needs provisioning
+					Image: metal3api.Image{
+						URL: "", // needs provisioning
 					},
 					RAID: &metal3api.RAIDConfig{
 						SoftwareRAIDVolumes: []metal3api.SoftwareRAIDVolume{},
diff --git a/controllers/metal3.io/hostfirmwaresettings_test.go b/controllers/metal3.io/hostfirmwaresettings_test.go
index 85f515ed..828df70e 100644
--- a/controllers/metal3.io/hostfirmwaresettings_test.go
+++ b/controllers/metal3.io/hostfirmwaresettings_test.go
@@ -33,9 +33,8 @@ var (
 	upperBound = 20
 )
 
-// Test support for HostFirmwareSettings in the HostFirmwareSettingsReconciler
+// Test support for HostFirmwareSettings in the HostFirmwareSettingsReconciler.
 func getTestHFSReconciler(host *metal3api.HostFirmwareSettings) *HostFirmwareSettingsReconciler {
-
 	c := fakeclient.NewClientBuilder().WithRuntimeObjects(host).WithStatusSubresource(host).
 		Build()
 
@@ -114,7 +113,6 @@ func (m *hsfMockProvisioner) IsReady() (result bool, err error) {
 }
 
 func (m *hsfMockProvisioner) GetFirmwareSettings(_ bool) (settings metal3api.SettingsMap, schema map[string]metal3api.SettingSchema, err error) {
-
 	return m.Settings, m.Schema, m.Error
 }
 
@@ -127,7 +125,6 @@ func (m *hsfMockProvisioner) RemoveBMCEventSubscriptionForNode(_ metal3api.BMCEv
 }
 
 func getSchema() *metal3api.FirmwareSchema {
-
 	schema := &metal3api.FirmwareSchema{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "FirmwareSchema",
@@ -148,9 +145,8 @@ func getSchema() *metal3api.FirmwareSchema {
 	return schema
 }
 
-// Mock settings to return from provisioner
+// Mock settings to return from provisioner.
 func getCurrentSettings() metal3api.SettingsMap {
-
 	return metal3api.SettingsMap{
 		"L2Cache":               "10x512 KB",
 		"NetworkBootRetryCount": "20",
@@ -160,9 +156,8 @@ func getCurrentSettings() metal3api.SettingsMap {
 	}
 }
 
-// Mock schema to return from provisioner
+// Mock schema to return from provisioner.
 func getCurrentSchemaSettings() map[string]metal3api.SettingSchema {
-
 	return map[string]metal3api.SettingSchema{
 		"AssetTag": {
 			AttributeType: "String",
@@ -202,9 +197,8 @@ func getCurrentSchemaSettings() map[string]metal3api.SettingSchema {
 	}
 }
 
-// Create the baremetalhost reconciler and use that to create bmh in same namespace
+// Create the baremetalhost reconciler and use that to create bmh in same namespace.
 func createBaremetalHost() *metal3api.BareMetalHost {
-
 	bmh := &metal3api.BareMetalHost{}
 	bmh.ObjectMeta = metav1.ObjectMeta{Name: hostName, Namespace: hostNamespace}
 	c := fakeclient.NewFakeClient(bmh)
@@ -255,9 +249,8 @@ func getExpectedSchemaTwoOwners() *metal3api.FirmwareSchema {
 	return firmwareSchema
 }
 
-// Create an HFS with input spec settings
+// Create an HFS with input spec settings.
 func getHFS(spec metal3api.HostFirmwareSettingsSpec) *metal3api.HostFirmwareSettings {
-
 	hfs := &metal3api.HostFirmwareSettings{}
 
 	hfs.Status = metal3api.HostFirmwareSettingsStatus{
@@ -282,9 +275,8 @@ func getHFS(spec metal3api.HostFirmwareSettingsSpec) *metal3api.HostFirmwareSett
 	return hfs
 }
 
-// Test the hostfirmwaresettings reconciler functions
+// Test the hostfirmwaresettings reconciler functions.
 func TestStoreHostFirmwareSettings(t *testing.T) {
-
 	testCases := []struct {
 		Scenario string
 		// the resource that the reconciler is managing
@@ -551,7 +543,6 @@ func TestStoreHostFirmwareSettings(t *testing.T) {
 
 	for _, tc := range testCases {
 		t.Run(tc.Scenario, func(t *testing.T) {
-
 			ctx := context.TODO()
 			prov := getMockProvisioner(getCurrentSettings(), getCurrentSchemaSettings())
 
@@ -621,9 +612,8 @@ func TestStoreHostFirmwareSettings(t *testing.T) {
 	}
 }
 
-// Test the function to validate hostFirmwareSettings
+// Test the function to validate hostFirmwareSettings.
 func TestValidateHostFirmwareSettings(t *testing.T) {
-
 	testCases := []struct {
 		Scenario      string
 		SpecSettings  metal3api.HostFirmwareSettingsSpec
@@ -680,7 +670,7 @@ func TestValidateHostFirmwareSettings(t *testing.T) {
 					"SomeNewSetting": intstr.FromString("foo"),
 				},
 			},
-			ExpectedError: "Setting SomeNewSetting is not in the Status field",
+			ExpectedError: "setting SomeNewSetting is not in the Status field",
 		},
 		{
 			Scenario: "invalid password in spec",
@@ -692,7 +682,7 @@ func TestValidateHostFirmwareSettings(t *testing.T) {
 					"SysPassword":           intstr.FromString("Pa%$word"),
 				},
 			},
-			ExpectedError: "Cannot set Password field",
+			ExpectedError: "cannot set Password field",
 		},
 		{
 			Scenario: "string instead of int",
@@ -709,7 +699,6 @@ func TestValidateHostFirmwareSettings(t *testing.T) {
 
 	for _, tc := range testCases {
 		t.Run(tc.Scenario, func(t *testing.T) {
-
 			hfs := getHFS(tc.SpecSettings)
 			r := getTestHFSReconciler(hfs)
 			info := &rInfo{
diff --git a/pkg/provisioner/ironic/adopt_test.go b/pkg/provisioner/ironic/adopt_test.go
index 0fcd5d08..9040cdc5 100644
--- a/pkg/provisioner/ironic/adopt_test.go
+++ b/pkg/provisioner/ironic/adopt_test.go
@@ -14,7 +14,6 @@ import (
 )
 
 func TestAdopt(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 	cases := []struct {
 		name   string
diff --git a/pkg/provisioner/ironic/bios_test.go b/pkg/provisioner/ironic/bios_test.go
index d062eec6..f13ef7f7 100644
--- a/pkg/provisioner/ironic/bios_test.go
+++ b/pkg/provisioner/ironic/bios_test.go
@@ -12,7 +12,6 @@ import (
 )
 
 func TestGetFirmwareSettings(t *testing.T) {
-
 	nodeUUID := "158c5d59-9ace-9631-ed51-d842a45f1c52"
 	iTrue := true
 	iFalse := false
@@ -90,13 +89,12 @@ func TestGetFirmwareSettings(t *testing.T) {
 			expectedSchemaMap:   map[string]metal3api.SettingSchema(nil),
 			ironic:              testserver.NewIronic(t).NoBIOS(nodeUUID),
 			includeSchema:       false,
-			expectedError:       "could not get node for BIOS settings: Host not registered",
+			expectedError:       "could not get node for BIOS settings: host not registered",
 		},
 	}
 
 	for _, tc := range cases {
 		t.Run(tc.name, func(t *testing.T) {
-
 			tc.ironic.Start()
 			defer tc.ironic.Stop()
 
diff --git a/pkg/provisioner/ironic/configdrive_test.go b/pkg/provisioner/ironic/configdrive_test.go
index 9bb8d472..a50f09a8 100644
--- a/pkg/provisioner/ironic/configdrive_test.go
+++ b/pkg/provisioner/ironic/configdrive_test.go
@@ -6,7 +6,7 @@ import (
 	"github.com/gophercloud/gophercloud/openstack/baremetal/v1/nodes"
 	"github.com/stretchr/testify/assert"
 
-	"github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	"github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner/fixture"
@@ -146,8 +146,8 @@ func TestEmpty(t *testing.T) {
 
 			result, err := prov.getConfigDrive(provisioner.ProvisionData{
 				HostConfig: tc.hostData,
-				BootMode:   v1alpha1.DefaultBootMode,
-				Image: v1alpha1.Image{
+				BootMode:   metal3api.DefaultBootMode,
+				Image: metal3api.Image{
 					URL:        "http://image",
 					DiskFormat: diskFormat,
 				},
diff --git a/pkg/provisioner/ironic/delete_test.go b/pkg/provisioner/ironic/delete_test.go
index 82d4c1f0..20345f70 100644
--- a/pkg/provisioner/ironic/delete_test.go
+++ b/pkg/provisioner/ironic/delete_test.go
@@ -25,7 +25,7 @@ func TestDetach(t *testing.T) {
 }
 
 func deleteTest(t *testing.T, detach bool) {
-
+	t.Helper()
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 
 	cases := []struct {
diff --git a/pkg/provisioner/ironic/factory_test.go b/pkg/provisioner/ironic/factory_test.go
index 952b0dd7..b04fa229 100644
--- a/pkg/provisioner/ironic/factory_test.go
+++ b/pkg/provisioner/ironic/factory_test.go
@@ -46,6 +46,7 @@ func (f *EnvFixture) SetUp() {
 }
 
 func (f EnvFixture) VerifyConfig(t *testing.T, c ironicConfig, _ string) {
+	t.Helper()
 	assert.Equal(t, f.kernelURL, c.deployKernelURL)
 	assert.Equal(t, f.ramdiskURL, c.deployRamdiskURL)
 	assert.Equal(t, f.isoURL, c.deployISOURL)
@@ -53,6 +54,7 @@ func (f EnvFixture) VerifyConfig(t *testing.T, c ironicConfig, _ string) {
 }
 
 func (f EnvFixture) VerifyEndpoints(t *testing.T, ironic string) {
+	t.Helper()
 	assert.Equal(t, f.ironicEndpoint, ironic)
 }
 
@@ -88,21 +90,21 @@ func TestLoadConfigFromEnv(t *testing.T) {
 		{
 			name:          "no deploy info",
 			env:           EnvFixture{},
-			expectedError: "Either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
+			expectedError: "either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
 		},
 		{
 			name: "only kernel",
 			env: EnvFixture{
 				kernelURL: "http://kernel",
 			},
-			expectedError: "Either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
+			expectedError: "either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
 		},
 		{
 			name: "only ramdisk",
 			env: EnvFixture{
 				ramdiskURL: "http://ramdisk",
 			},
-			expectedError:         "Either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
+			expectedError:         "either DEPLOY_KERNEL_URL and DEPLOY_RAMDISK_URL or DEPLOY_ISO_URL must be set",
 			expectedImgBuildError: "DEPLOY_RAMDISK_URL requires DEPLOY_KERNEL_URL to be set also",
 		},
 		{
@@ -152,8 +154,8 @@ func TestLoadConfigFromEnv(t *testing.T) {
 				isoURL:                           "http://iso",
 				liveISOForcePersistentBootDevice: "NotAValidOption",
 			},
-			expectedError:         "Invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE",
-			expectedImgBuildError: "Invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE",
+			expectedError:         "invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE",
+			expectedImgBuildError: "invalid value for variable LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE",
 		},
 	}
 
diff --git a/pkg/provisioner/ironic/hardwaredetails/hardwaredetails_test.go b/pkg/provisioner/ironic/hardwaredetails/hardwaredetails_test.go
index c77eb035..cba34fc5 100644
--- a/pkg/provisioner/ironic/hardwaredetails/hardwaredetails_test.go
+++ b/pkg/provisioner/ironic/hardwaredetails/hardwaredetails_test.go
@@ -260,5 +260,4 @@ func TestGetFirmwareDetails(t *testing.T) {
 	if firmware.BIOS.Vendor != "foobar" {
 		t.Errorf("Expected firmware BIOS vendor to be foobar, but got: %s", firmware)
 	}
-
 }
diff --git a/pkg/provisioner/ironic/inspecthardware_test.go b/pkg/provisioner/ironic/inspecthardware_test.go
index f643e057..44f1fb2d 100644
--- a/pkg/provisioner/ironic/inspecthardware_test.go
+++ b/pkg/provisioner/ironic/inspecthardware_test.go
@@ -17,7 +17,6 @@ import (
 )
 
 func TestInspectHardware(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 
 	cases := []struct {
diff --git a/pkg/provisioner/ironic/power_test.go b/pkg/provisioner/ironic/power_test.go
index 98df3ea3..7fd1ccd5 100644
--- a/pkg/provisioner/ironic/power_test.go
+++ b/pkg/provisioner/ironic/power_test.go
@@ -16,7 +16,6 @@ import (
 )
 
 func TestPowerOn(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 	cases := []struct {
 		name   string
diff --git a/pkg/provisioner/ironic/provision_test.go b/pkg/provisioner/ironic/provision_test.go
index a859a222..291e83af 100644
--- a/pkg/provisioner/ironic/provision_test.go
+++ b/pkg/provisioner/ironic/provision_test.go
@@ -9,24 +9,21 @@ import (
 	"github.com/stretchr/testify/assert"
 	"k8s.io/apimachinery/pkg/util/intstr"
 
-	"github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
+	metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
 	"github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner/fixture"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner/ironic/clients"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner/ironic/testbmc"
 	"github.com/metal3-io/baremetal-operator/pkg/provisioner/ironic/testserver"
-
-	_ "github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc"
 )
 
 func TestProvision(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
-	testImage := v1alpha1.Image{
+	testImage := metal3api.Image{
 		URL:          "http://test-image",
 		Checksum:     "abcd",
-		ChecksumType: v1alpha1.SHA256,
+		ChecksumType: metal3api.SHA256,
 	}
 
 	cases := []struct {
@@ -177,7 +174,7 @@ func TestProvision(t *testing.T) {
 			result, err := prov.Provision(provisioner.ProvisionData{
 				Image:      testImage,
 				HostConfig: fixture.NewHostConfigData("testUserData", "test: NetworkData", "test: Meta"),
-				BootMode:   v1alpha1.DefaultBootMode,
+				BootMode:   metal3api.DefaultBootMode,
 			}, tc.forceReboot)
 
 			assert.Equal(t, tc.expectedDirty, result.Dirty)
@@ -196,7 +193,6 @@ func TestProvision(t *testing.T) {
 }
 
 func TestDeprovision(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 	cases := []struct {
 		name                 string
@@ -326,7 +322,7 @@ func TestIronicHasSameImage(t *testing.T) {
 		liveImage        bool
 		hostImage        string
 		hostChecksum     string
-		hostChecksumType v1alpha1.ChecksumType
+		hostChecksumType metal3api.ChecksumType
 	}{
 		{
 			name:      "image same",
@@ -341,7 +337,7 @@ func TestIronicHasSameImage(t *testing.T) {
 			},
 			hostImage:        "theimage",
 			hostChecksum:     "thechecksum",
-			hostChecksumType: v1alpha1.MD5,
+			hostChecksumType: metal3api.MD5,
 		},
 		{
 			name:      "image same - auto checksum",
@@ -370,7 +366,7 @@ func TestIronicHasSameImage(t *testing.T) {
 			},
 			hostImage:        "different",
 			hostChecksum:     "thechecksum",
-			hostChecksumType: v1alpha1.MD5,
+			hostChecksumType: metal3api.MD5,
 		},
 		{
 			name:      "image checksum different",
@@ -385,7 +381,7 @@ func TestIronicHasSameImage(t *testing.T) {
 			},
 			hostImage:        "theimage",
 			hostChecksum:     "different",
-			hostChecksumType: v1alpha1.MD5,
+			hostChecksumType: metal3api.MD5,
 		},
 		{
 			name:      "image checksum changed to auto",
@@ -415,7 +411,7 @@ func TestIronicHasSameImage(t *testing.T) {
 			},
 			hostImage:        "theimage",
 			hostChecksum:     "thechecksum",
-			hostChecksumType: v1alpha1.SHA512,
+			hostChecksumType: metal3api.SHA512,
 		},
 		{
 			name:      "live image same",
@@ -447,7 +443,7 @@ func TestIronicHasSameImage(t *testing.T) {
 			ironic.Start()
 			defer ironic.Stop()
 
-			var host v1alpha1.BareMetalHost
+			var host metal3api.BareMetalHost
 			if tc.liveImage {
 				host = makeHostLiveIso()
 				host.Spec.Image.URL = tc.hostImage
@@ -472,7 +468,6 @@ func TestIronicHasSameImage(t *testing.T) {
 }
 
 func TestBuildCleanSteps(t *testing.T) {
-
 	var True = true
 	var False = false
 
@@ -480,9 +475,9 @@ func TestBuildCleanSteps(t *testing.T) {
 	cases := []struct {
 		name             string
 		ironic           *testserver.IronicMock
-		currentSettings  v1alpha1.SettingsMap
-		desiredSettings  v1alpha1.DesiredSettingsMap
-		firmwareConfig   *v1alpha1.FirmwareConfig
+		currentSettings  metal3api.SettingsMap
+		desiredSettings  metal3api.DesiredSettingsMap
+		firmwareConfig   *metal3api.FirmwareConfig
 		expectedSettings []map[string]interface{}
 	}{
 		{
@@ -493,7 +488,7 @@ func TestBuildCleanSteps(t *testing.T) {
 			}),
 			currentSettings: nil,
 			desiredSettings: nil,
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &True,
 				SimultaneousMultithreadingEnabled: &False,
 			},
@@ -521,7 +516,7 @@ func TestBuildCleanSteps(t *testing.T) {
 				"ProcHyperthreading": "Disabled",
 			},
 			desiredSettings: nil,
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &True,
 				SimultaneousMultithreadingEnabled: &False,
 			},
@@ -533,14 +528,14 @@ func TestBuildCleanSteps(t *testing.T) {
 				ProvisionState: string(nodes.DeployFail),
 				UUID:           nodeUUID,
 			}),
-			currentSettings: v1alpha1.SettingsMap{
+			currentSettings: metal3api.SettingsMap{
 				"L2Cache":            "10x256 KB",
 				"NumCores":           "10",
 				"ProcVirtualization": "Disabled",
 				"ProcHyperthreading": "Enabled",
 			},
 			desiredSettings: nil,
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &True,
 				SimultaneousMultithreadingEnabled: &False,
 			},
@@ -561,19 +556,19 @@ func TestBuildCleanSteps(t *testing.T) {
 				ProvisionState: string(nodes.DeployFail),
 				UUID:           nodeUUID,
 			}),
-			currentSettings: v1alpha1.SettingsMap{
+			currentSettings: metal3api.SettingsMap{
 				"L2Cache":               "10x256 KB",
 				"NumCores":              "10",
 				"NetworkBootRetryCount": "20",
 				"ProcVirtualization":    "Enabled",
 				"ProcHyperthreading":    "Disabled",
 			},
-			desiredSettings: v1alpha1.DesiredSettingsMap{
+			desiredSettings: metal3api.DesiredSettingsMap{
 				"NetworkBootRetryCount": intstr.FromInt(10),
 				"ProcVirtualization":    intstr.FromString("Disabled"),
 				"ProcHyperthreading":    intstr.FromString("Enabled"),
 			},
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &True,
 				SimultaneousMultithreadingEnabled: &False,
 			},
@@ -598,19 +593,19 @@ func TestBuildCleanSteps(t *testing.T) {
 				ProvisionState: string(nodes.DeployFail),
 				UUID:           nodeUUID,
 			}),
-			currentSettings: v1alpha1.SettingsMap{
+			currentSettings: metal3api.SettingsMap{
 				"L2Cache":               "10x256 KB",
 				"NumCores":              "10",
 				"NetworkBootRetryCount": "20",
 				"ProcVirtualization":    "Enabled",
 				"ProcHyperthreading":    "Disabled",
 			},
-			desiredSettings: v1alpha1.DesiredSettingsMap{
+			desiredSettings: metal3api.DesiredSettingsMap{
 				"NetworkBootRetryCount": intstr.FromString("5"),
 				"ProcVirtualization":    intstr.FromString("Enabled"),
 				"ProcHyperthreading":    intstr.FromString("Disabled"),
 			},
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &False,
 				SimultaneousMultithreadingEnabled: &True,
 			},
@@ -635,17 +630,17 @@ func TestBuildCleanSteps(t *testing.T) {
 				ProvisionState: string(nodes.DeployFail),
 				UUID:           nodeUUID,
 			}),
-			currentSettings: v1alpha1.SettingsMap{
+			currentSettings: metal3api.SettingsMap{
 				"L2Cache":            "10x256 KB",
 				"NumCores":           "10",
 				"ProcVirtualization": "Enabled",
 				"ProcHyperthreading": "Disabled",
 			},
-			desiredSettings: v1alpha1.DesiredSettingsMap{
+			desiredSettings: metal3api.DesiredSettingsMap{
 				"ProcVirtualization": intstr.FromString("Disabled"),
 				"ProcHyperthreading": intstr.FromString("Enabled"),
 			},
-			firmwareConfig: &v1alpha1.FirmwareConfig{
+			firmwareConfig: &metal3api.FirmwareConfig{
 				VirtualizationEnabled:             &False,
 				SimultaneousMultithreadingEnabled: &True,
 			},
diff --git a/pkg/provisioner/ironic/provisioncapacity_test.go b/pkg/provisioner/ironic/provisioncapacity_test.go
index ec3ace0f..a571a5ee 100644
--- a/pkg/provisioner/ironic/provisioncapacity_test.go
+++ b/pkg/provisioner/ironic/provisioncapacity_test.go
@@ -13,7 +13,6 @@ import (
 )
 
 func TestHasCapacity(t *testing.T) {
-
 	states := []nodes.ProvisionState{
 		nodes.Cleaning, nodes.CleanWait, nodes.Inspecting, nodes.InspectWait, nodes.Deploying, nodes.DeployWait,
 		nodes.Deleting,
@@ -79,7 +78,6 @@ func TestHasCapacity(t *testing.T) {
 
 	for _, tc := range cases {
 		t.Run(tc.name, func(t *testing.T) {
-
 			allNodes := []nodes.Node{}
 			for n, state := range tc.nodeStates {
 				allNodes = append(allNodes, nodes.Node{
diff --git a/pkg/provisioner/ironic/ready_test.go b/pkg/provisioner/ironic/ready_test.go
index b80b41f8..4ddbc501 100644
--- a/pkg/provisioner/ironic/ready_test.go
+++ b/pkg/provisioner/ironic/ready_test.go
@@ -12,7 +12,6 @@ import (
 )
 
 func TestProvisionerIsReady(t *testing.T) {
-
 	cases := []struct {
 		name   string
 		ironic *testserver.IronicMock
diff --git a/pkg/provisioner/ironic/testbmc/testbmc.go b/pkg/provisioner/ironic/testbmc/testbmc.go
index 500cd97a..ac5449b9 100644
--- a/pkg/provisioner/ironic/testbmc/testbmc.go
+++ b/pkg/provisioner/ironic/testbmc/testbmc.go
@@ -103,8 +103,10 @@ func (a *testAccessDetails) RequiresProvisioningNetwork() bool {
 }
 
 func (a *testAccessDetails) BuildBIOSSettings(firmwareConfig *bmc.FirmwareConfig) (settings []map[string]string, err error) {
-
 	// Return sample BMC data for test purposes
+	const enabled = "Enabled"
+	const disabled = "Disabled"
+
 	if firmwareConfig == nil {
 		return nil, nil
 	}
@@ -112,9 +114,9 @@ func (a *testAccessDetails) BuildBIOSSettings(firmwareConfig *bmc.FirmwareConfig
 	var value string
 
 	if firmwareConfig.VirtualizationEnabled != nil {
-		value = "Disabled"
+		value = disabled
 		if *firmwareConfig.VirtualizationEnabled {
-			value = "Enabled"
+			value = enabled
 		}
 		settings = append(settings,
 			map[string]string{
@@ -125,9 +127,9 @@ func (a *testAccessDetails) BuildBIOSSettings(firmwareConfig *bmc.FirmwareConfig
 	}
 
 	if firmwareConfig.SimultaneousMultithreadingEnabled != nil {
-		value = "Disabled"
+		value = disabled
 		if *firmwareConfig.SimultaneousMultithreadingEnabled {
-			value = "Enabled"
+			value = enabled
 		}
 		settings = append(settings,
 			map[string]string{
@@ -138,9 +140,9 @@ func (a *testAccessDetails) BuildBIOSSettings(firmwareConfig *bmc.FirmwareConfig
 	}
 
 	if firmwareConfig.SriovEnabled != nil {
-		value = "Disabled"
+		value = disabled
 		if *firmwareConfig.SriovEnabled {
-			value = "Enabled"
+			value = enabled
 		}
 		settings = append(settings,
 			map[string]string{
diff --git a/pkg/provisioner/ironic/testserver/ironic.go b/pkg/provisioner/ironic/testserver/ironic.go
index 8cb9b09a..597d7756 100644
--- a/pkg/provisioner/ironic/testserver/ironic.go
+++ b/pkg/provisioner/ironic/testserver/ironic.go
@@ -12,13 +12,13 @@ import (
 	"github.com/gophercloud/gophercloud/openstack/baremetal/v1/ports"
 )
 
-// IronicMock is a test server that implements Ironic's semantics
+// IronicMock is a test server that implements Ironic's semantics.
 type IronicMock struct {
 	*MockServer
 	CreatedNodes int
 }
 
-// NewIronic builds an ironic mock server
+// NewIronic builds an ironic mock server.
 func NewIronic(t *testing.T) *IronicMock {
 	server := New(t, "ironic").AddDefaultResponse("/v1/?", "", http.StatusOK, versionedRootResult)
 	return &IronicMock{
@@ -56,7 +56,7 @@ func (m *IronicMock) WithDefaultResponses() *IronicMock {
 	return m
 }
 
-// Endpoint returns the URL for accessing the server
+// Endpoint returns the URL for accessing the server.
 func (m *IronicMock) Endpoint() string {
 	if m == nil {
 		return "https://ironic.test/v1/"
@@ -70,7 +70,7 @@ func (m *IronicMock) NotReady(errorCode int) *IronicMock {
 	return m
 }
 
-// WithDrivers configures the server so /v1/drivers returns a valid value
+// WithDrivers configures the server so /v1/drivers returns a valid value.
 func (m *IronicMock) WithDrivers() *IronicMock {
 	m.ResponseWithCode("/v1/drivers", `
 	{
@@ -106,19 +106,19 @@ func (m *IronicMock) buildURL(url string, method string) string {
 }
 
 // Delete configures the server with a valid response for [DELETE] /v1/nodes/ on the
-// specific node id
+// specific node id.
 func (m *IronicMock) Delete(id string) *IronicMock {
 	m.ResponseWithCode(m.buildURL("/v1/nodes/"+id, http.MethodDelete), "", http.StatusAccepted)
 	return m
 }
 
-// DeleteError configures the server with an error response for [DELETE] /v1/nodes/
+// DeleteError configures the server with an error response for [DELETE] /v1/nodes/.
 func (m *IronicMock) DeleteError(id string, errorCode int) *IronicMock {
 	m.ResponseWithCode(m.buildURL("/v1/nodes/"+id, http.MethodDelete), "", errorCode)
 	return m
 }
 
-// Node configures the server with a valid response for /v1/nodes/{name,uuid}
+// Node configures the server with a valid response for /v1/nodes/{name,uuid}.
 func (m *IronicMock) Node(node nodes.Node) *IronicMock {
 	if node.UUID != "" {
 		m.ResponseJSON(m.buildURL("/v1/nodes/"+node.UUID, http.MethodGet), node)
@@ -129,14 +129,14 @@ func (m *IronicMock) Node(node nodes.Node) *IronicMock {
 	return m
 }
 
-// NodeUpdateError configures configures the server with an error response for [PATCH] /v1/nodes/{id}
+// NodeUpdateError configures configures the server with an error response for [PATCH] /v1/nodes/{id}.
 func (m *IronicMock) NodeUpdateError(id string, errorCode int) *IronicMock {
 	m.ResponseWithCode(m.buildURL("/v1/nodes/"+id, http.MethodPatch), "", errorCode)
 	return m
 }
 
 // NodeUpdate configures the server with a valid response for PATCH
-// for /v1/nodes/{name,uuid}
+// for /v1/nodes/{name,uuid}.
 func (m *IronicMock) NodeUpdate(node nodes.Node) *IronicMock {
 	if node.UUID != "" {
 		m.ResponseJSON(m.buildURL("/v1/nodes/"+node.UUID, http.MethodPatch), node)
@@ -147,9 +147,8 @@ func (m *IronicMock) NodeUpdate(node nodes.Node) *IronicMock {
 	return m
 }
 
-// GetLastNodeUpdateRequestFor returns the content of the last update request for the specified node
+// GetLastNodeUpdateRequestFor returns the content of the last update request for the specified node.
 func (m *IronicMock) GetLastNodeUpdateRequestFor(id string) (updates []nodes.UpdateOperation) {
-
 	if bodyRaw, ok := m.GetLastRequestFor("/v1/nodes/"+id, http.MethodPatch); ok {
 		json.Unmarshal([]byte(bodyRaw), &updates)
 	}
@@ -157,9 +156,8 @@ func (m *IronicMock) GetLastNodeUpdateRequestFor(id string) (updates []nodes.Upd
 	return
 }
 
-// GetLastNodeStatesProvisionUpdateRequestFor returns the content of the last provisioning request for the specified node
+// GetLastNodeStatesProvisionUpdateRequestFor returns the content of the last provisioning request for the specified node.
 func (m *IronicMock) GetLastNodeStatesProvisionUpdateRequestFor(id string) (update nodes.ProvisionStateOpts) {
-
 	if bodyRaw, ok := m.GetLastRequestFor("/v1/nodes/"+id+"/states/provision", http.MethodPut); ok {
 		json.Unmarshal([]byte(bodyRaw), &update)
 	}
@@ -167,14 +165,14 @@ func (m *IronicMock) GetLastNodeStatesProvisionUpdateRequestFor(id string) (upda
 	return
 }
 
-// NodeMaintenanceError configures configures the server with an error response for [PUT] /v1/nodes/{id}/maintenance
+// NodeMaintenanceError configures configures the server with an error response for [PUT] /v1/nodes/{id}/maintenance.
 func (m *IronicMock) NodeMaintenanceError(id string, errorCode int) *IronicMock {
 	m.ResponseWithCode(m.buildURL("/v1/nodes/"+id+"/maintenance", http.MethodPut), "", errorCode)
 	return m
 }
 
 // NodeUpdate configures the server with a valid response for PATCH
-// for /v1/nodes/{name,uuid}
+// for /v1/nodes/{name,uuid}.
 func (m *IronicMock) NodeMaintenance(node nodes.Node, expected bool) *IronicMock {
 	var url, method string
 
@@ -199,31 +197,31 @@ func (m *IronicMock) withNodeStatesProvision(nodeUUID string, method string) *Ir
 	return m
 }
 
-// WithNodeStatesProvision configures the server with a valid response for [GET] /v1/nodes/<node>/states/provision
+// WithNodeStatesProvision configures the server with a valid response for [GET] /v1/nodes/<node>/states/provision.
 func (m *IronicMock) WithNodeStatesProvision(nodeUUID string) *IronicMock {
 	return m.withNodeStatesProvision(nodeUUID, http.MethodGet)
 }
 
-// WithNodeStatesProvisionUpdate configures the server with a valid response for [PATCH] /v1/nodes/<node>/states/provision
+// WithNodeStatesProvisionUpdate configures the server with a valid response for [PATCH] /v1/nodes/<node>/states/provision.
 func (m *IronicMock) WithNodeStatesProvisionUpdate(nodeUUID string) *IronicMock {
 	return m.withNodeStatesProvision(nodeUUID, http.MethodPut)
 }
 
-// NoNode configures the server so /v1/nodes/name returns a 404
+// NoNode configures the server so /v1/nodes/name returns a 404.
 func (m *IronicMock) NoNode(name string) *IronicMock {
 	return m.NodeError(name, http.StatusNotFound)
 }
 
-// NodeError configures the server to return the specified error code for /v1/nodes/name
+// NodeError configures the server to return the specified error code for /v1/nodes/name.
 func (m *IronicMock) NodeError(name string, errorCode int) *IronicMock {
 	m.ErrorResponse(fmt.Sprintf("/v1/nodes/%s", name), errorCode)
 	return m
 }
 
-// NodeCreateCallback type is the callback mock for CreateNodes
+// NodeCreateCallback type is the callback mock for CreateNodes.
 type NodeCreateCallback func(node nodes.Node)
 
-// CreateNodes configures the server so POSTing to /v1/nodes saves the data
+// CreateNodes configures the server so POSTing to /v1/nodes saves the data.
 func (m *IronicMock) CreateNodes(callback NodeCreateCallback) *IronicMock {
 	m.Handler("/v1/nodes", func(w http.ResponseWriter, r *http.Request) {
 		if r.Method != http.MethodPost {
@@ -271,17 +269,17 @@ func (m *IronicMock) withNodeStatesPower(nodeUUID string, code int, method strin
 	return m
 }
 
-// WithNodeStatesPower configures the server with a valid response for [GET] /v1/nodes/<node>/states/power
+// WithNodeStatesPower configures the server with a valid response for [GET] /v1/nodes/<node>/states/power.
 func (m *IronicMock) WithNodeStatesPower(nodeUUID string, code int) *IronicMock {
 	return m.withNodeStatesPower(nodeUUID, code, http.MethodGet)
 }
 
-// WithNodeStatesPowerUpdate configures the server with a valid response for [PUT] /v1/nodes/<node>/states/power
+// WithNodeStatesPowerUpdate configures the server with a valid response for [PUT] /v1/nodes/<node>/states/power.
 func (m *IronicMock) WithNodeStatesPowerUpdate(nodeUUID string, code int) *IronicMock {
 	return m.withNodeStatesPower(nodeUUID, code, http.MethodPut)
 }
 
-// WithNodeValidate configures the server with a valid response for /v1/nodes/<node>/validate
+// WithNodeValidate configures the server with a valid response for /v1/nodes/<node>/validate.
 func (m *IronicMock) WithNodeValidate(nodeUUID string) *IronicMock {
 	m.ResponseWithCode("/v1/nodes/"+nodeUUID+"/validate", validateResult, http.StatusOK)
 	return m
@@ -312,7 +310,7 @@ func (m *IronicMock) Port(port ports.Port) *IronicMock {
 	return m
 }
 
-// Nodes configure the server with a valid response for /v1/nodes
+// Nodes configure the server with a valid response for /v1/nodes.
 func (m *IronicMock) Nodes(allNodes []nodes.Node) *IronicMock {
 	resp := struct {
 		Nodes []nodes.Node `json:"nodes"`
@@ -345,7 +343,6 @@ func (m *IronicMock) ClearDatabase() {
 
 	// Second, set named handlers to reply with 404
 	for url, methodMap := range m.responsesByMethod {
-
 		for method := range methodMap {
 			// POST requests should still succeed when the database is empty
 			if method == "POST" {
@@ -360,7 +357,7 @@ func (m *IronicMock) ClearDatabase() {
 	}
 }
 
-// BIOSSettings configure the server with a valid response for /v1/nodes/<node>/bios
+// BIOSSettings configure the server with a valid response for /v1/nodes/<node>/bios.
 func (m *IronicMock) BIOSSettings(nodeUUID string) *IronicMock {
 	settings := []nodes.BIOSSetting{
 		{
@@ -390,9 +387,8 @@ func (m *IronicMock) BIOSSettings(nodeUUID string) *IronicMock {
 	return m
 }
 
-// BIOSDetailSettings configure the server with a valid response for /v1/nodes/<node>/bios?detail=True
+// BIOSDetailSettings configure the server with a valid response for /v1/nodes/<node>/bios?detail=True.
 func (m *IronicMock) BIOSDetailSettings(nodeUUID string) *IronicMock {
-
 	iTrue := true
 	iFalse := false
 	minLength := 0
@@ -455,18 +451,18 @@ func (m *IronicMock) BIOSDetailSettings(nodeUUID string) *IronicMock {
 	return m
 }
 
-// NoBIOS configures the server so /v1/node/<node>/bios returns a 404
+// NoBIOS configures the server so /v1/node/<node>/bios returns a 404.
 func (m *IronicMock) NoBIOS(nodeUUID string) *IronicMock {
 	return m.NodeError(nodeUUID, http.StatusNotFound)
 }
 
-// WithInventory configures the server with a valid response for /v1/nodes/<node>/inventory
+// WithInventory configures the server with a valid response for /v1/nodes/<node>/inventory.
 func (m *IronicMock) WithInventory(nodeUUID string, data nodes.InventoryData) *IronicMock {
 	m.ResponseJSON("/v1/nodes/"+nodeUUID+"/inventory", data)
 	return m
 }
 
-// WithInventoryFailed configures the server with an error response for /v1/nodes/<node>/inventory
+// WithInventoryFailed configures the server with an error response for /v1/nodes/<node>/inventory.
 func (m *IronicMock) WithInventoryFailed(nodeUUID string, errorCode int) *IronicMock {
 	m.ErrorResponse("/v1/nodes/"+nodeUUID+"/inventory", errorCode)
 	return m
diff --git a/pkg/provisioner/ironic/testserver/ironic_test.go b/pkg/provisioner/ironic/testserver/ironic_test.go
index eb1110ed..a97728fe 100644
--- a/pkg/provisioner/ironic/testserver/ironic_test.go
+++ b/pkg/provisioner/ironic/testserver/ironic_test.go
@@ -23,6 +23,8 @@ func TestIronicDatabaseClearing(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusOK {
 		t.Fail()
 	}
@@ -35,6 +37,8 @@ func TestIronicDatabaseClearing(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusNotFound {
 		t.Fail()
 	}
@@ -46,6 +50,8 @@ func TestIronicDatabaseClearing(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusCreated {
 		t.Fail()
 	}
@@ -69,6 +75,8 @@ func TestIronicDatabaseClearingNode(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusOK {
 		t.Fail()
 	}
@@ -81,6 +89,8 @@ func TestIronicDatabaseClearingNode(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusNotFound {
 		t.Fail()
 	}
@@ -92,6 +102,8 @@ func TestIronicDatabaseClearingNode(t *testing.T) {
 		t.Error(err)
 	}
 
+	defer resp.Body.Close()
+
 	if resp.StatusCode != http.StatusCreated {
 		t.Fail()
 	}
diff --git a/pkg/provisioner/ironic/testserver/server.go b/pkg/provisioner/ironic/testserver/server.go
index 29843a17..d885281a 100644
--- a/pkg/provisioner/ironic/testserver/server.go
+++ b/pkg/provisioner/ironic/testserver/server.go
@@ -11,8 +11,9 @@ import (
 	"testing"
 )
 
-// New returns a MockServer
+// New returns a MockServer.
 func New(t *testing.T, name string) *MockServer {
+	t.Helper()
 	mux := http.NewServeMux()
 	t.Logf("%s: new server created", name)
 	return &MockServer{
@@ -42,7 +43,7 @@ type simpleRequest struct {
 	body    string
 }
 
-// MockServer is a simple http testing server
+// MockServer is a simple http testing server.
 type MockServer struct {
 	t            *testing.T
 	mux          *http.ServeMux
@@ -56,7 +57,7 @@ type MockServer struct {
 	defaultResponses  []defaultResponse
 }
 
-// Endpoint returns the URL to the server
+// Endpoint returns the URL to the server.
 func (m *MockServer) Endpoint() string {
 	if m == nil || m.server == nil {
 		// The consumer of this method expects something valid, but
@@ -81,7 +82,7 @@ func (m *MockServer) logRequest(r *http.Request, response string) {
 	})
 }
 
-// Handler attaches a generic handler function to a request URL pattern
+// Handler attaches a generic handler function to a request URL pattern.
 func (m *MockServer) Handler(pattern string, handlerFunc http.HandlerFunc) *MockServer {
 	m.t.Logf("%s: adding handler for %s", m.name, pattern)
 	m.mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
@@ -91,7 +92,6 @@ func (m *MockServer) Handler(pattern string, handlerFunc http.HandlerFunc) *Mock
 }
 
 func (m *MockServer) buildHandler(_ string) func(http.ResponseWriter, *http.Request) {
-
 	handler := func(w http.ResponseWriter, r *http.Request) {
 		if response, ok := m.responsesByMethod[r.URL.Path][r.Method]; ok {
 			m.sendData(w, r, response.code, response.payload)
@@ -116,9 +116,8 @@ func (m *MockServer) parsePattern(patternWithMethod string) (pattern string, met
 }
 
 // ResponseWithCode attaches a handler function that returns the given payload
-// from requests to the URL pattern along with the specified code
+// from requests to the URL pattern along with the specified code.
 func (m *MockServer) ResponseWithCode(patternWithMethod string, payload string, code int) *MockServer {
-
 	pattern, method := m.parsePattern(patternWithMethod)
 
 	mh, ok := m.responsesByMethod[pattern]
@@ -140,7 +139,7 @@ func (m *MockServer) ResponseWithCode(patternWithMethod string, payload string,
 }
 
 // ResponseJSON marshals the JSON object as payload returned by the response
-// handler
+// handler.
 func (m *MockServer) ResponseJSON(pattern string, payload interface{}) *MockServer {
 	content, err := json.Marshal(payload)
 	if err != nil {
@@ -151,7 +150,7 @@ func (m *MockServer) ResponseJSON(pattern string, payload interface{}) *MockServ
 }
 
 // ErrorResponse attaches a handler function that returns the given
-// error code from requests to the URL pattern
+// error code from requests to the URL pattern.
 func (m *MockServer) ErrorResponse(pattern string, errorCode int) *MockServer {
 	m.t.Logf("%s: adding error response handler for %s", m.name, pattern)
 	m.mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
@@ -161,20 +160,20 @@ func (m *MockServer) ErrorResponse(pattern string, errorCode int) *MockServer {
 	return m
 }
 
-// Start runs the server
+// Start runs the server.
 func (m *MockServer) Start() *MockServer {
 	m.server = httptest.NewServer(m.mux)
-	//catch all handler
+	// catch all handler
 	m.mux.HandleFunc("/", m.defaultHandler)
 	return m
 }
 
-// Stop closes the server down
+// Stop closes the server down.
 func (m *MockServer) Stop() {
 	m.server.Close()
 }
 
-// AddDefaultResponseJSON adds a default response for the specified pattern
+// AddDefaultResponseJSON adds a default response for the specified pattern.
 func (m *MockServer) AddDefaultResponseJSON(patternWithVars string, httpMethod string, code int, payload interface{}) *MockServer {
 	content, err := json.Marshal(payload)
 	if err != nil {
@@ -184,9 +183,8 @@ func (m *MockServer) AddDefaultResponseJSON(patternWithVars string, httpMethod s
 }
 
 // GetLastRequestFor returns the last request for the specified pattern/method.
-// If method is empty, the response will be applied for any method
+// If method is empty, the response will be applied for any method.
 func (m *MockServer) GetLastRequestFor(pattern string, method string) (string, bool) {
-
 	for i := len(m.FullRequests) - 1; i >= 0; i-- {
 		r := m.FullRequests[i]
 		if r.method == "" || r.method == method {
@@ -202,9 +200,8 @@ func (m *MockServer) GetLastRequestFor(pattern string, method string) (string, b
 // AddDefaultResponse adds a default response for the specified pattern/method.
 // It is possible to use variables in the pattern using curly braces, ie `/v1/nodes/{id}/power`
 // Pattern variables can be reused in the payload, so that they will be substituted with the actual value when sending the response
-// If httpMethod is empty, the response will be applied for any method
+// If httpMethod is empty, the response will be applied for any method.
 func (m *MockServer) AddDefaultResponse(patternWithVars string, httpMethod string, code int, payload string) *MockServer {
-
 	pattern := "^" + regexp.MustCompile("{(.[^}]*)}").ReplaceAllString(patternWithVars, "(?P<$1>.[^/]*)") + "$"
 	m.t.Logf("%s: adding default response for %s (%s) -> {%d, %s}", m.name, patternWithVars, pattern, code, payload)
 
@@ -222,7 +219,6 @@ func (m *MockServer) AddDefaultResponse(patternWithVars string, httpMethod strin
 }
 
 func (m *MockServer) defaultHandler(w http.ResponseWriter, r *http.Request) {
-
 	url := r.URL.Path
 	method := r.Method
 
@@ -251,7 +247,6 @@ func (m *MockServer) defaultHandler(w http.ResponseWriter, r *http.Request) {
 }
 
 func (m *MockServer) sendData(w http.ResponseWriter, r *http.Request, code int, payload string) {
-
 	m.logRequest(r, payload)
 	w.Header().Set("Content-Type", "application/json")
 	w.WriteHeader(code)
@@ -259,7 +254,7 @@ func (m *MockServer) sendData(w http.ResponseWriter, r *http.Request, code int,
 }
 
 // SendJSONResponse marshalls the payload to a JSON object and sends
-// the response using the given writer
+// the response using the given writer.
 func (m *MockServer) SendJSONResponse(payload interface{}, code int, w http.ResponseWriter, r *http.Request) {
 	content, err := json.Marshal(payload)
 	if err != nil {
diff --git a/pkg/provisioner/ironic/updatehardwarestate_test.go b/pkg/provisioner/ironic/updatehardwarestate_test.go
index c7700821..dcab093d 100644
--- a/pkg/provisioner/ironic/updatehardwarestate_test.go
+++ b/pkg/provisioner/ironic/updatehardwarestate_test.go
@@ -13,7 +13,6 @@ import (
 )
 
 func TestUpdateHardwareState(t *testing.T) {
-
 	nodeUUID := "33ce8659-7400-4c68-9535-d10766f07a58"
 
 	cases := []struct {
@@ -91,7 +90,7 @@ func TestUpdateHardwareState(t *testing.T) {
 			hostName: "worker-0",
 			ironic:   testserver.NewIronic(t).NoNode(nodeUUID).NodeError("myns"+nameSeparator+"myhost", http.StatusGatewayTimeout),
 
-			expectedError: "Host not registered",
+			expectedError: "host not registered",
 
 			expectUnreadablePower: true,
 		},
@@ -99,7 +98,7 @@ func TestUpdateHardwareState(t *testing.T) {
 			name:   "not-ironic-node",
 			ironic: testserver.NewIronic(t).NoNode(nodeUUID).NoNode("myns" + nameSeparator + "myhost").NoNode("myhost"),
 
-			expectedError: "Host not registered",
+			expectedError: "host not registered",
 
 			expectUnreadablePower: true,
 		},
@@ -140,7 +139,6 @@ func TestUpdateHardwareState(t *testing.T) {
 				assert.Error(t, err)
 				assert.Regexp(t, tc.expectedError, err.Error())
 			}
-
 		})
 	}
 }
diff --git a/pkg/provisioner/ironic/updateopts_test.go b/pkg/provisioner/ironic/updateopts_test.go
index a66d0e95..96c41720 100644
--- a/pkg/provisioner/ironic/updateopts_test.go
+++ b/pkg/provisioner/ironic/updateopts_test.go
@@ -452,7 +452,6 @@ func TestInstanceInfoUpdateOpts(t *testing.T) {
 }
 
 func TestGetUpdateOptsForNodeWithRootHints(t *testing.T) {
-
 	eventPublisher := func(reason, message string) {}
 	auth := clients.AuthConfig{Type: clients.NoAuth}
 
@@ -632,7 +631,7 @@ func TestGetUpdateOptsForNodeDell(t *testing.T) {
 				URL:          "not-empty",
 				Checksum:     "checksum",
 				ChecksumType: metal3api.MD5,
-				//DiskFormat not given to verify it is not added in instance_info
+				// DiskFormat not given to verify it is not added in instance_info
 			},
 			Online: true,
 		},
diff --git a/pkg/provisioner/ironic/validatemanagementaccess_test.go b/pkg/provisioner/ironic/validatemanagementaccess_test.go
index 072e58b5..8848b144 100644
--- a/pkg/provisioner/ironic/validatemanagementaccess_test.go
+++ b/pkg/provisioner/ironic/validatemanagementaccess_test.go
@@ -785,7 +785,6 @@ func TestValidateManagementAccessExistingPortButHasName(t *testing.T) {
 }
 
 func TestValidateManagementAccessAddTwoHostsWithSameMAC(t *testing.T) {
-
 	existingNode := nodes.Node{
 		UUID: "33ce8659-7400-4c68-9535-d10766f07a58",
 		Name: "myns" + nameSeparator + "myhost",
diff --git a/pkg/utils/stringlist_test.go b/pkg/utils/stringlist_test.go
index 7f2a335c..1d0bac19 100644
--- a/pkg/utils/stringlist_test.go
+++ b/pkg/utils/stringlist_test.go
@@ -28,7 +28,6 @@ func TestStringInList(t *testing.T) {
 		if c.expect != got {
 			t.Errorf("Expected '%t', but got '%t'", c.expect, got)
 		}
-
 	}
 }
 
@@ -55,6 +54,5 @@ func TestFilterStringFromList(t *testing.T) {
 		if !reflect.DeepEqual(newList, c.expectStr) {
 			t.Errorf("Expected '%s', but got '%s'", c.expectStr, newList)
 		}
-
 	}
 }