Skip to content

Commit

Permalink
upgrade golangci-lint to v1.61.0
Browse files Browse the repository at this point in the history
Signed-off-by: rambohe-ch <rambohe.ch@gmail.com>
  • Loading branch information
rambohe-ch committed Jan 12, 2025
1 parent 4d28495 commit cf65215
Show file tree
Hide file tree
Showing 62 changed files with 239 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
packages: write

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

jobs:
create-release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-preset-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
description: "Test on VLLM runtime"

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"
BRANCH_NAME: ${{ github.head_ref || github.ref_name}}
FORCE_RUN_ALL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.force-run-all == 'true' }}
FORCE_RUN_ALL_PHI: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.force-run-all-phi-models== 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-preset-tuning-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch: {}

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"

permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
id-token: write # This is required for requesting the JWT
environment: e2e-test
env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"
KARPENTER_NAMESPACE: "karpenter"
GPU_PROVISIONER_NAMESPACE: "gpu-provisioner"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kaito-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths-ignore: ['docs/**', '**.md', '**.mdx', '**.png', '**.jpg']

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"

permissions:
id-token: write # This is required for requesting the JWT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- main

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preset-image-build-1ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
description: "Run all Phi models for build"

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
WEIGHTS_DIR: "/mnt/storage"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preset-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
default: false
description: "Run all public models for build"
env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
WEIGHTS_DIR: "/datadrive"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-rag-controller-gh-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
packages: write

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'
IMAGE_NAME: 'kaito-rag-engine'
REGISTRY: ghcr.io

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-rag-service-gh-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
packages: write

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'
IMAGE_NAME: 'kaito-rag-service'
REGISTRY: ghcr.io

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-workspace-gh-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
packages: write

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'
IMAGE_NAME: 'workspace'
REGISTRY: ghcr.io

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-workspace-mcr-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
packages: write

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'
IMAGE_NAME: 'workspace'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests-ragengine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
packages: write

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"

jobs:
unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
packages: write

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"

jobs:
unit-tests:
Expand Down
17 changes: 13 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
run:
deadline: 10m
timeout: 15m

linters-settings:
gci:
skip-generated: true
sections:
- standard
- prefix(github.com/kaito-project)
- default

linters:
disable-all: true
enable:
- deadcode
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nilerr
- prealloc
- structcheck
- typecheck
- unused
- varcheck
- gci
- gofmt
- goimports
- staticcheck
# Run with --fast=false for more extensive checks
fast: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BIN_DIR := $(abspath $(ROOT_DIR)/bin)
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin)

GOLANGCI_LINT_VER := v1.57.2
GOLANGCI_LINT_VER := v1.61.0
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER))

Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha1/params_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
"reflect"
"strings"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/utils"
"gopkg.in/yaml.v2"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/pkg/apis"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/utils"
)

type Config struct {
Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha1/ragengine_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (
"regexp"
"strings"

"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/consts"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"knative.dev/pkg/apis"

"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/consts"
)

func (w *RAGEngine) SupportedVerbs() []admissionregistrationv1.OperationType {
Expand Down
13 changes: 6 additions & 7 deletions api/v1alpha1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ import (
"strconv"
"strings"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/utils/consts"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/plugin"

admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -27,6 +20,12 @@ import (
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/klog/v2"
"knative.dev/pkg/apis"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/consts"
"github.com/kaito-project/kaito/pkg/utils/plugin"
)

const (
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha1/workspace_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"strings"
"testing"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/utils/consts"
"github.com/kaito-project/kaito/pkg/utils/plugin"
"k8s.io/apimachinery/pkg/runtime"

"github.com/kaito-project/kaito/pkg/model"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/model"
"github.com/kaito-project/kaito/pkg/utils/consts"
"github.com/kaito-project/kaito/pkg/utils/plugin"
)

const DefaultReleaseNamespace = "kaito-workspace"
Expand Down
26 changes: 13 additions & 13 deletions cmd/ragengine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ import (
"syscall"
"time"

//+kubebuilder:scaffold:imports
azurev1alpha2 "github.com/Azure/karpenter-provider-azure/pkg/apis/v1alpha2"
"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/ragengine/controllers"
"github.com/kaito-project/kaito/pkg/ragengine/webhooks"
kaitoutils "github.com/kaito-project/kaito/pkg/utils"
"k8s.io/klog/v2"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/webhook"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/klog/v2"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/webhook"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
//+kubebuilder:scaffold:imports
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/k8sclient"
"github.com/kaito-project/kaito/pkg/ragengine/controllers"
"github.com/kaito-project/kaito/pkg/ragengine/webhooks"
kaitoutils "github.com/kaito-project/kaito/pkg/utils"
)

const (
Expand Down
28 changes: 13 additions & 15 deletions cmd/workspace/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,28 @@ import (
"syscall"
"time"

//+kubebuilder:scaffold:imports
azurev1alpha2 "github.com/Azure/karpenter-provider-azure/pkg/apis/v1alpha2"
"github.com/kaito-project/kaito/pkg/featuregates"
"github.com/kaito-project/kaito/pkg/k8sclient"
kaitoutils "github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/nodeclaim"
"github.com/kaito-project/kaito/pkg/workspace/controllers"
"github.com/kaito-project/kaito/pkg/workspace/webhooks"
"k8s.io/klog/v2"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/webhook"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/klog/v2"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/webhook"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
//+kubebuilder:scaffold:imports
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/featuregates"
"github.com/kaito-project/kaito/pkg/k8sclient"
kaitoutils "github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/nodeclaim"
"github.com/kaito-project/kaito/pkg/workspace/controllers"
"github.com/kaito-project/kaito/pkg/workspace/webhooks"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/featuregates/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"errors"
"fmt"

"github.com/kaito-project/kaito/pkg/utils/consts"
cliflag "k8s.io/component-base/cli/flag"

"github.com/kaito-project/kaito/pkg/utils/consts"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/model/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"path"
"time"

"github.com/kaito-project/kaito/pkg/utils"
corev1 "k8s.io/api/core/v1"

"github.com/kaito-project/kaito/pkg/utils"
)

type Model interface {
Expand Down
14 changes: 7 additions & 7 deletions pkg/ragengine/controllers/preset-rag.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import (
"context"
"fmt"

"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/consts"

kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/ragengine/manifests"
"github.com/kaito-project/kaito/pkg/utils/resources"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/ragengine/manifests"
"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/consts"
"github.com/kaito-project/kaito/pkg/utils/resources"
)

const (
Expand Down Expand Up @@ -66,7 +66,7 @@ var (
}
)

func CreatePresetRAG(ctx context.Context, ragEngineObj *kaitov1alpha1.RAGEngine, revisionNum string, kubeClient client.Client) (client.Object, error) {
func CreatePresetRAG(ctx context.Context, ragEngineObj *v1alpha1.RAGEngine, revisionNum string, kubeClient client.Client) (client.Object, error) {
var volumes []corev1.Volume
var volumeMounts []corev1.VolumeMount

Expand Down
Loading

0 comments on commit cf65215

Please sign in to comment.