From 2268b4e3e7debbfdff556d7ab2fe1d4d583d341b Mon Sep 17 00:00:00 2001 From: Cesar Celis Hernandez Date: Tue, 6 Sep 2022 12:26:51 -0400 Subject: [PATCH] Updating golangci-lint (#1277) --- .github/workflows/kubernetes-tests.yml | 2 +- .golangci.yml | 2 +- Makefile | 2 +- logsearchapi/server/server.go | 4 ++-- pkg/apis/minio.min.io/v2/doc.go | 1 - pkg/apis/minio.min.io/v2/types.go | 5 ----- pkg/client/clientset/versioned/fake/register.go | 14 +++++++------- pkg/client/clientset/versioned/scheme/register.go | 14 +++++++------- 8 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/workflows/kubernetes-tests.yml b/.github/workflows/kubernetes-tests.yml index 354f3ee9418..38d41ccaed9 100644 --- a/.github/workflows/kubernetes-tests.yml +++ b/.github/workflows/kubernetes-tests.yml @@ -112,7 +112,7 @@ jobs: - operator strategy: matrix: - go-version: [ 1.18.x ] + go-version: [ 1.18.x, 1.19.x ] os: [ ubuntu-latest ] steps: diff --git a/.golangci.yml b/.golangci.yml index e9023974c0e..f7108f757d1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,4 +37,4 @@ issues: - deadcode service: - golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly + golangci-lint-version: 1.49.0 # use the fixed version to not introduce new linters unexpectedly diff --git a/Makefile b/Makefile index 43083215a7f..84d4ab474b9 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: build getdeps: @echo "Checking dependencies" @mkdir -p ${GOPATH}/bin - @echo "Installing golangci-lint" && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2 + @echo "Installing golangci-lint" && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0 verify: getdeps govet gotest lint diff --git a/logsearchapi/server/server.go b/logsearchapi/server/server.go index 37c8479139c..c5c4f12fd08 100644 --- a/logsearchapi/server/server.go +++ b/logsearchapi/server/server.go @@ -141,7 +141,7 @@ func (ls *LogSearch) writeErrorResponse(w http.ResponseWriter, status int, msg s // ingestHandler handles: // -// POST /api/ingest?token=xxx +// POST /api/ingest?token=xxx // // The json body represents the Audit log data. If it is an empty object the // request is ignored but returns success. @@ -167,7 +167,7 @@ func (ls *LogSearch) ingestHandler(w http.ResponseWriter, r *http.Request) { // queryHandler handles: // -// GET /api/query?token=xxx&q=(raw|reqinfo)&pageNo=0&pageSize=50&timeAsc|timeDesc&timeStart=? +// GET /api/query?token=xxx&q=(raw|reqinfo)&pageNo=0&pageSize=50&timeAsc|timeDesc&timeStart=? func (ls *LogSearch) queryHandler(w http.ResponseWriter, r *http.Request) { // Request is assumed to be authenticated at this point. diff --git a/pkg/apis/minio.min.io/v2/doc.go b/pkg/apis/minio.min.io/v2/doc.go index 562270943d8..eb42a5bab5b 100644 --- a/pkg/apis/minio.min.io/v2/doc.go +++ b/pkg/apis/minio.min.io/v2/doc.go @@ -19,7 +19,6 @@ // // The `minio.min.io/v2` API was released with the v4.0.0 MinIO Operator. The MinIO Operator automatically converts existing tenants using the `/v1` API to `/v2`. + // -// // +groupName=minio.min.io // +versionName=v2 package v2 diff --git a/pkg/apis/minio.min.io/v2/types.go b/pkg/apis/minio.min.io/v2/types.go index c50a52645ac..ddf397c06db 100644 --- a/pkg/apis/minio.min.io/v2/types.go +++ b/pkg/apis/minio.min.io/v2/types.go @@ -30,7 +30,6 @@ import ( // +kubebuilder:storageversion // Tenant is a https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/[Kubernetes object] describing a MinIO Tenant. + -// type Tenant struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -74,7 +73,6 @@ type TenantDomains struct { // S3Features (`s3`) - Object describing which MinIO features to enable/disable in the MinIO Tenant. + // *Deprecated in Operator v4.3.2* + -// type S3Features struct { // *Optional* + // @@ -84,7 +82,6 @@ type S3Features struct { } // Features (`features`) - Object describing which MinIO features to enable/disable in the MinIO Tenant. + -// type Features struct { // *Optional* + // @@ -103,8 +100,6 @@ type Features struct { // The following parameters are specific to the `minio.min.io/v2` MinIO CRD API `spec` definition added as part of the MinIO Operator v4.0.0. + // // For more complete documentation on this object, see the https://docs.min.io/minio/k8s/reference/minio-operator-reference.html#minio-operator-yaml-reference[MinIO Kubernetes Documentation]. + -// -// type TenantSpec struct { // *Required* + // diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 1c92464ddfc..6859abbe1a1 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -39,14 +39,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index db055f8fafb..9d955deab02 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -39,14 +39,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly.