Skip to content

Commit

Permalink
auto-format:chore - runnning auto format make command to improve code
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
  • Loading branch information
nathanmartinszup committed Dec 17, 2021
1 parent 1bfb570 commit 5e47693
Showing 15 changed files with 28 additions and 146 deletions.
8 changes: 5 additions & 3 deletions api/v2alpha1/component_global.go
Original file line number Diff line number Diff line change
@@ -21,9 +21,11 @@ import (
corev1 "k8s.io/api/core/v1"
)

var LatestVersion = "latest"
var Commit = ""
var Date = ""
var (
LatestVersion = "latest"
Commit = ""
Date = ""
)

func (h *HorusecPlatform) NewEnvFromSecret(variableName string, secretKeyRef *corev1.SecretKeySelector) corev1.EnvVar {
return corev1.EnvVar{
11 changes: 4 additions & 7 deletions cmd/app/main.go
Original file line number Diff line number Diff line change
@@ -21,22 +21,19 @@ import (
"os"

"go.uber.org/zap/zapcore"

"github.com/ZupIT/horusec-operator/internal/tracing"

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"

installv2 "github.com/ZupIT/horusec-operator/api/v2alpha1"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

//+kubebuilder:scaffold:imports
installv2 "github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

var (
11 changes: 6 additions & 5 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
@@ -27,16 +27,18 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

installv2 "github.com/ZupIT/horusec-operator/api/v2alpha1"
//+kubebuilder:scaffold:imports
installv2 "github.com/ZupIT/horusec-operator/api/v2alpha1"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.

var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
var (
cfg *rest.Config
k8sClient client.Client
testEnv *envtest.Environment
)

func TestAPIs(t *testing.T) {
//RegisterFailHandler(Fail)
@@ -67,7 +69,6 @@ var _ = BeforeSuite(func() {
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())

}, 60)

var _ = AfterSuite(func() {
110 changes: 0 additions & 110 deletions deployments/scripts/update-image.sh

This file was deleted.

3 changes: 1 addition & 2 deletions internal/horusec/usecase/autoscaling.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type Autoscaling struct {
3 changes: 1 addition & 2 deletions internal/horusec/usecase/database_migrations.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type DatabaseMigrations struct {
3 changes: 1 addition & 2 deletions internal/horusec/usecase/deployments.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type Deployments struct {
3 changes: 1 addition & 2 deletions internal/horusec/usecase/ingress_rules.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type IngressRules struct {
3 changes: 1 addition & 2 deletions internal/horusec/usecase/service_accounts.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type ServiceAccounts struct {
3 changes: 1 addition & 2 deletions internal/horusec/usecase/services.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ package usecase
import (
"context"

"github.com/ZupIT/horusec-operator/internal/tracing"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/inventory"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"
)

type Services struct {
6 changes: 3 additions & 3 deletions internal/horusec/usecase/unavailability_reason.go
Original file line number Diff line number Diff line change
@@ -23,13 +23,13 @@ import (
"strings"
"time"

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/api/v2alpha1/condition"
"github.com/ZupIT/horusec-operator/internal/operation"
"github.com/ZupIT/horusec-operator/internal/tracing"

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
)

type UnavailabilityReason struct {
4 changes: 2 additions & 2 deletions internal/inventory/job.go
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@ package inventory
import (
"fmt"

"github.com/ZupIT/horusec-operator/internal/k8s"

"github.com/google/go-cmp/cmp"
batchv1 "k8s.io/api/batch/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/ZupIT/horusec-operator/internal/k8s"
)

//nolint:gocritic, funlen // improve in the future
3 changes: 1 addition & 2 deletions internal/resources/autoscaling.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ import (
"reflect"

autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

"github.com/ZupIT/horusec-operator/api/v2alpha1"
"github.com/ZupIT/horusec-operator/internal/resources/analytic"
@@ -29,8 +30,6 @@ import (
"github.com/ZupIT/horusec-operator/internal/resources/messages"
"github.com/ZupIT/horusec-operator/internal/resources/vulnerability"
"github.com/ZupIT/horusec-operator/internal/resources/webhook"

"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
)

func (b *Builder) AutoscalingFor(resource *v2alpha1.HorusecPlatform) ([]autoscalingv2beta2.HorizontalPodAutoscaler, error) {
1 change: 0 additions & 1 deletion internal/tracing/span.go
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ import (
"github.com/opentracing/opentracing-go/log"
"github.com/uber/jaeger-client-go"
kerrors "k8s.io/apimachinery/pkg/api/errors"

ctrl "sigs.k8s.io/controller-runtime"
)

2 changes: 1 addition & 1 deletion magefile.go
Original file line number Diff line number Diff line change
@@ -20,9 +20,9 @@ import (
"fmt"
"os"

"github.com/magefile/mage/sh"
// mage:import
_ "github.com/ZupIT/horusec-devkit/pkg/utils/mageutils"
"github.com/magefile/mage/sh"
)

const (

0 comments on commit 5e47693

Please sign in to comment.