Skip to content

Commit

Permalink
fix linting errors and add linter as CI check
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
JorTurFer committed Aug 23, 2023
1 parent ad619e1 commit 9206376
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
run: |
go version
pwd && ls -l
go install go.k6.io/xk6/cmd/xk6@latest
MODULE_NAME=$(go list -m)
xk6 build \
--output ./k6ext \
--with $MODULE_NAME="."
Expand Down Expand Up @@ -72,3 +72,23 @@ jobs:
which go
go version
go test -race -timeout 60s ./...
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Retrieve golangci-lint version
run: |
echo "Version=$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')" >> $GITHUB_OUTPUT
id: version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ steps.version.outputs.Version }}
only-new-issues: true
3 changes: 1 addition & 2 deletions kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth" // Required for access to GKE and AKS
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
)
Expand Down Expand Up @@ -149,7 +148,7 @@ func getClientConfig(options KubeConfig) (*rest.Config, error) {
kubeconfig := options.ConfigPath
if kubeconfig == "" {
// are we in-cluster?
config, err := restclient.InClusterConfig()
config, err := rest.InClusterConfig()
if err == nil {
return config, nil
}
Expand Down

0 comments on commit 9206376

Please sign in to comment.