This repository was archived by the owner on Jun 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,26 @@ lint-yaml: ${YAML_FILES}
11
11
$(Q )$(PYTHON_VENV_DIR ) /bin/pip install yamllint==1.23.0
12
12
$(Q )$(PYTHON_VENV_DIR ) /bin/yamllint -c .yamllint $(YAML_FILES )
13
13
14
+ GO_LINT_CMD = $(Q ) GOFLAGS="$(GOFLAGS ) " GOGC=30 GOCACHE=$(GOCACHE ) $(OUTPUT_DIR ) /golangci-lint ${V_FLAG} run --concurrency=1 --verbose --deadline=30m --disable-all --enable
15
+
14
16
.PHONY : lint-go-code
15
17
# # Checks GO code
16
18
lint-go-code : $(GOLANGCI_LINT_BIN ) fmt vet
17
19
# This is required for OpenShift CI enviroment
18
20
# Ref: https://github.com/openshift/release/pull/3438#issuecomment-482053250
19
- $(Q ) GOFLAGS=" $( GOFLAGS) " GOCACHE=" $( GOCACHE) " $(OUTPUT_DIR ) /golangci-lint ${V_FLAG} run --deadline=30m
21
+ $(GO_LINT_CMD ) deadcode
22
+ $(GO_LINT_CMD ) errcheck
23
+ $(GO_LINT_CMD ) govet
24
+ $(GO_LINT_CMD ) ineffassign
25
+ $(GO_LINT_CMD ) staticcheck
26
+ $(GO_LINT_CMD ) structcheck
27
+ $(GO_LINT_CMD ) typecheck
28
+ $(GO_LINT_CMD ) unused
29
+ $(GO_LINT_CMD ) varcheck
30
+ $(GO_LINT_CMD ) gosimple
20
31
21
32
$(GOLANGCI_LINT_BIN ) :
22
- $(Q ) curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./out v1.45.2
33
+ $(Q ) curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./out v1.48.0
23
34
24
35
.PHONY : lint-python-code
25
36
# # Check the python code
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ package kubernetes
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "io/ioutil"
7
6
authenticationapi "k8s.io/api/authentication/v1"
8
7
authorizationv1 "k8s.io/api/authorization/v1"
9
8
k8serrors "k8s.io/apimachinery/pkg/api/errors"
10
9
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
10
"k8s.io/client-go/kubernetes"
12
11
"k8s.io/client-go/rest"
13
12
"net/http"
13
+ "os"
14
14
"regexp"
15
15
"strings"
16
16
)
@@ -55,7 +55,7 @@ func WhoAmI(config *rest.Config) (string, error) {
55
55
// from vendor/k8s.io/client-go/transport/round_trippers.go:HTTPWrappersForConfig function, tokenauth has preference over basicauth
56
56
if transportConfig .HasTokenAuth () {
57
57
if config .BearerTokenFile != "" {
58
- d , err := ioutil .ReadFile (config .BearerTokenFile )
58
+ d , err := os .ReadFile (config .BearerTokenFile )
59
59
if err != nil {
60
60
return "" , err
61
61
}
You can’t perform that action at this time.
0 commit comments