Skip to content

Commit

Permalink
Fix go lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ansd committed Mar 22, 2021
1 parent b6d9557 commit 73a11e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions controllers/reconcile_persistence.go
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"errors"
"fmt"
"time"

"github.com/go-logr/logr"
rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -14,7 +16,6 @@ import (
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"time"
)

func (r *RabbitmqClusterReconciler) reconcilePVC(ctx context.Context, cluster *rabbitmqv1beta1.RabbitmqCluster, current, sts *appsv1.StatefulSet) error {
Expand Down Expand Up @@ -130,10 +131,7 @@ func (r *RabbitmqClusterReconciler) deleteSts(ctx context.Context, rmq *rabbitmq

if err := retryWithInterval(logger, "delete statefulSet", 10, 3*time.Second, func() bool {
_, getErr := r.statefulSet(ctx, rmq)
if k8serrors.IsNotFound(getErr) {
return true
}
return false
return k8serrors.IsNotFound(getErr)
}); err != nil {
msg := "statefulSet not deleting after 30 seconds"
logger.Error(err, msg, "statefulSet", currentSts.Name)
Expand Down
2 changes: 1 addition & 1 deletion controllers/reconcile_status_test.go
Expand Up @@ -77,7 +77,7 @@ var _ = Describe("Reconcile status", func() {
rmq = &rabbitmqv1beta1.RabbitmqCluster{}
binding := &corev1.LocalObjectReference{}
Eventually(func() *corev1.LocalObjectReference {
client.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: cluster.Namespace}, rmq)
Expect(client.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: cluster.Namespace}, rmq)).To(Succeed())
if rmq.Status.Binding != nil {
binding = rmq.Status.Binding
return binding
Expand Down

0 comments on commit 73a11e4

Please sign in to comment.