Upgrade to golangci-lint v1.32.2
This commit is contained in:
@@ -18,7 +18,7 @@ jobs:
|
||||
command: V=1 CI=1 make vet
|
||||
- run:
|
||||
name: Install linters
|
||||
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.17.1 && mv ./bin/* /go/bin/
|
||||
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.32.2 && mv ./bin/* /go/bin/
|
||||
- run:
|
||||
name: Lint
|
||||
command: golangci-lint run ./...
|
||||
|
||||
@@ -24,13 +24,16 @@ func ClientsetFromEnv(kubeConfigPath string) (*kubernetes.Clientset, error) {
|
||||
)
|
||||
|
||||
if kubeConfigPath != "" {
|
||||
if _, err := os.Stat(kubeConfigPath); err != nil {
|
||||
config, err = rest.InClusterConfig()
|
||||
} else {
|
||||
_, err = os.Stat(kubeConfigPath)
|
||||
if err == nil {
|
||||
config, err = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
|
||||
&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigPath},
|
||||
&clientcmd.ConfigOverrides{},
|
||||
).ClientConfig()
|
||||
} else if os.IsNotExist(err) {
|
||||
config, err = rest.InClusterConfig()
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
config, err = rest.InClusterConfig()
|
||||
|
||||
Reference in New Issue
Block a user