Skip to content

Commit

Permalink
Fix order of import
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 15, 2024
1 parent ee701cd commit 3e860f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 4 additions & 3 deletions controllers/skeleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
"sort"

"github.com/sirupsen/logrus"
"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/nginx"
"github.com/tsuru/rpaas-operator/pkg/util"
corev1 "k8s.io/api/core/v1"
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/nginx"
"github.com/tsuru/rpaas-operator/pkg/util"
)

func listDefaultFlavors(ctx context.Context, c client.Client, namespace string) ([]v1alpha1.RpaasFlavor, error) {
Expand Down
11 changes: 6 additions & 5 deletions controllers/validation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"path/filepath"

"github.com/go-logr/logr"
"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/nginx"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -18,6 +16,9 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/nginx"
)

// RpaasValidationReconciler reconciles a RpaasValidation object
Expand Down Expand Up @@ -98,10 +99,10 @@ func (r *RpaasValidationReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}

if existingPod != nil {
finished, err := r.finishValidation(ctx, existingPod, validation, validationHash)
finished, finishErr := r.finishValidation(ctx, existingPod, validation, validationHash)

if err != nil {
return ctrl.Result{}, err
if finishErr != nil {
return ctrl.Result{}, finishErr
}

if finished {
Expand Down
5 changes: 3 additions & 2 deletions controllers/validation_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
nginxv1alpha1 "github.com/tsuru/nginx-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/api/v1alpha1"
extensionsruntime "github.com/tsuru/rpaas-operator/pkg/runtime"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -22,6 +20,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
extensionsruntime "github.com/tsuru/rpaas-operator/pkg/runtime"
)

func TestNewValidationPod(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions internal/pkg/rpaas/validation/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"fmt"
"time"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas"
corev1 "k8s.io/api/core/v1"
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas"
)

var _ rpaas.RpaasManager = &validationManager{}
Expand Down
7 changes: 4 additions & 3 deletions internal/pkg/rpaas/validation/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
nginxv1alpha1 "github.com/tsuru/nginx-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/fake"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -21,6 +18,10 @@ import (
metricsv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
clientFake "sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/tsuru/rpaas-operator/api/v1alpha1"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas"
"github.com/tsuru/rpaas-operator/internal/pkg/rpaas/fake"
)

func newScheme() *runtime.Scheme {
Expand Down

0 comments on commit 3e860f8

Please sign in to comment.