Skip to content

Commit

Permalink
Merge pull request #406 from gibizer/full-golangci-lint
Browse files Browse the repository at this point in the history
Ensure golangci-lint runs on all files
  • Loading branch information
openshift-merge-bot[bot] committed Apr 22, 2024
2 parents 6e12eff + f9b2abc commit d4f7fd0
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.55.2
hooks:
- id: golangci-lint
- id: golangci-lint-full
args: ["-v"]
15 changes: 7 additions & 8 deletions controllers/keystoneapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
labels "github.com/openstack-k8s-operators/lib-common/modules/common/labels"
nad "github.com/openstack-k8s-operators/lib-common/modules/common/networkattachment"
common_rbac "github.com/openstack-k8s-operators/lib-common/modules/common/rbac"
"github.com/openstack-k8s-operators/lib-common/modules/common/secret"
oko_secret "github.com/openstack-k8s-operators/lib-common/modules/common/secret"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
Expand Down Expand Up @@ -672,7 +671,7 @@ func (r *KeystoneAPIReconciler) reconcileInit(
return ctrl.Result{}, nil
}

func (r *KeystoneAPIReconciler) reconcileUpdate(ctx context.Context, instance *keystonev1.KeystoneAPI, helper *helper.Helper) (ctrl.Result, error) {
func (r *KeystoneAPIReconciler) reconcileUpdate(ctx context.Context) (ctrl.Result, error) {
l := GetLog(ctx)
l.Info("Reconciling Service update")

Expand All @@ -683,7 +682,7 @@ func (r *KeystoneAPIReconciler) reconcileUpdate(ctx context.Context, instance *k
return ctrl.Result{}, nil
}

func (r *KeystoneAPIReconciler) reconcileUpgrade(ctx context.Context, instance *keystonev1.KeystoneAPI, helper *helper.Helper) (ctrl.Result, error) {
func (r *KeystoneAPIReconciler) reconcileUpgrade(ctx context.Context) (ctrl.Result, error) {
l := GetLog(ctx)
l.Info("Reconciling Service upgrade")

Expand Down Expand Up @@ -969,15 +968,15 @@ func (r *KeystoneAPIReconciler) reconcileNormal(
}

// Handle service update
ctrlResult, err = r.reconcileUpdate(ctx, instance, helper)
ctrlResult, err = r.reconcileUpdate(ctx)
if err != nil {
return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
return ctrlResult, nil
}

// Handle service upgrade
ctrlResult, err = r.reconcileUpgrade(ctx, instance, helper)
ctrlResult, err = r.reconcileUpgrade(ctx)
if err != nil {
return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
Expand All @@ -989,7 +988,7 @@ func (r *KeystoneAPIReconciler) reconcileNormal(
//

// Define a new Deployment object
deplDef, err := keystone.Deployment(ctx, helper, instance, inputHash, serviceLabels, serviceAnnotations)
deplDef, err := keystone.Deployment(instance, inputHash, serviceLabels, serviceAnnotations)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.DeploymentReadyCondition,
Expand Down Expand Up @@ -1153,7 +1152,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
customData[key] = data
}

transportURLSecret, _, err := secret.GetSecret(ctx, h, instance.Status.TransportURLSecret, instance.Namespace)
transportURLSecret, _, err := oko_secret.GetSecret(ctx, h, instance.Status.TransportURLSecret, instance.Namespace)
if err != nil {
return err
}
Expand Down Expand Up @@ -1210,7 +1209,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
Labels: cmLabels,
},
}
return secret.EnsureSecrets(ctx, h, instance, tmpl, envVars)
return oko_secret.EnsureSecrets(ctx, h, instance, tmpl, envVars)
}

// reconcileConfigMap - creates clouds.yaml
Expand Down
2 changes: 0 additions & 2 deletions controllers/keystoneendpoint_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ func (r *KeystoneEndpointReconciler) reconcileNormal(
err = r.reconcileEndpoints(
ctx,
instance,
helper,
os)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand All @@ -433,7 +432,6 @@ func (r *KeystoneEndpointReconciler) reconcileNormal(
func (r *KeystoneEndpointReconciler) reconcileEndpoints(
ctx context.Context,
instance *keystonev1.KeystoneEndpoint,
helper *helper.Helper,
os *openstack.OpenStack,
) error {
l := GetLog(ctx)
Expand Down
5 changes: 0 additions & 5 deletions pkg/keystone/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ limitations under the License.
package keystone

import (
"context"

keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
common "github.com/openstack-k8s-operators/lib-common/modules/common"
"github.com/openstack-k8s-operators/lib-common/modules/common/affinity"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"

Expand All @@ -39,8 +36,6 @@ const (

// Deployment func
func Deployment(
ctx context.Context,
helper *helper.Helper,
instance *keystonev1.KeystoneAPI,
configHash string,
labels map[string]string,
Expand Down
2 changes: 0 additions & 2 deletions pkg/keystone/fernet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import (
"encoding/base64"

"math/rand"
"time"
)

// GenerateFernetKey -
func GenerateFernetKey() string {
rand.Seed(time.Now().UnixNano())
data := make([]byte, 32)
for i := 0; i < 32; i++ {
data[i] = byte(rand.Intn(10))
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package functional_test
import (
"fmt"

. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //revive:disable:dot-imports

batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
Loading

0 comments on commit d4f7fd0

Please sign in to comment.