Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-format:chore - runnning auto format make command to improve code #134

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions api/v2alpha1/component_global.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
11 changes: 4 additions & 7 deletions cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
11 changes: 6 additions & 5 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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() {
Expand Down
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
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions internal/horusec/usecase/database_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions internal/horusec/usecase/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions internal/horusec/usecase/ingress_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions internal/horusec/usecase/service_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions internal/horusec/usecase/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions internal/horusec/usecase/unavailability_reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions internal/inventory/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions internal/resources/autoscaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion internal/tracing/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down