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

[chore] lint fixes #1599

Merged
merged 11 commits into from
Jul 28, 2021
5 changes: 0 additions & 5 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ run:
skip-dirs:
- pkg/client
- pkg/apis
- internal/ # TODO: https://github.com/Kong/kubernetes-ingress-controller/issues/1597
- hack/ # TODO: https://github.com/Kong/kubernetes-ingress-controller/issues/1597
linters:
enable:
- asciicheck
Expand All @@ -16,11 +14,8 @@ linters:
- errcheck
- exhaustive
- exportloopref
- gci
- gochecknoinits
- gofmt
- goimports
- gomnd
- gosec
- gosimple
- govet
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
TAG?=2.0.0-alpha.3
REGISTRY?=kong
REPO_INFO=$(shell git config --get remote.origin.url)
REPO_URL=github.com/kong/kubernetes-ingress-controller
IMGNAME?=kubernetes-ingress-controller
IMAGE = $(REGISTRY)/$(IMGNAME)
IMG ?= controller:latest
Expand Down Expand Up @@ -69,6 +70,10 @@ build: generate fmt vet lint
-X github.com/kong/kubernetes-ingress-controller/internal/manager.Commit=$(COMMIT) \
-X github.com/kong/kubernetes-ingress-controller/internal/manager.Repo=$(REPO_INFO)" internal/cmd/main.go

.PHONY: imports
imports:
@find ./ -type f -name '*.go' -exec goimports -local $(REPO_URL) -w {} \;

.PHONY: fmt
fmt:
go fmt ./...
Expand Down
4 changes: 3 additions & 1 deletion internal/admission/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"io/ioutil"
"net/http"

configuration "github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1"
"github.com/sirupsen/logrus"
admission "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"

configuration "github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1"
)

var (
Expand Down Expand Up @@ -173,6 +174,7 @@ func (a RequestHandler) handleValidation(ctx context.Context, request admission.
var message string
var err error

//nolint:exhaustive
switch request.Resource {
case consumerGVResource:
consumer := configuration.KongConsumer{}
Expand Down
3 changes: 2 additions & 1 deletion internal/admission/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import (
"net/http/httptest"
"testing"

configuration "github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1"
"github.com/lithammer/dedent"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
admission "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

configuration "github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1"
)

var decoder = codecs.UniversalDeserializer()
Expand Down
3 changes: 2 additions & 1 deletion internal/annotations/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ func TestIngressClassValidatorFunc(t *testing.T) {

data := map[string]string{}
ing.SetAnnotations(data)
for _, test := range tests {
for i := 0; i < len(tests); i++ {
test := tests[i]
ing.Annotations[IngressClassKey] = test.ingress
ingv1.Spec.IngressClassName = &test.ingress
// TODO: unclear if we truly use IngressClassValidatorFunc anymore
Expand Down
111 changes: 0 additions & 111 deletions internal/client/configuration/clientset/versioned/clientset.go

This file was deleted.

20 changes: 0 additions & 20 deletions internal/client/configuration/clientset/versioned/doc.go

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions internal/client/configuration/clientset/versioned/fake/doc.go

This file was deleted.

58 changes: 0 additions & 58 deletions internal/client/configuration/clientset/versioned/fake/register.go

This file was deleted.

Loading