mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
chore: update golangci-lint to v2.8.0 (#26354)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
4
.github/workflows/ci-build.yaml
vendored
4
.github/workflows/ci-build.yaml
vendored
@@ -110,8 +110,8 @@ jobs:
|
|||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
||||||
with:
|
with:
|
||||||
# renovate: datasource=go packageName=github.com/golangci/golangci-lint versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
|
# renovate: datasource=go packageName=github.com/golangci/golangci-lint/v2 versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
|
||||||
version: v2.5.0
|
version: v2.8.0
|
||||||
args: --verbose
|
args: --verbose
|
||||||
|
|
||||||
test-go:
|
test-go:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ func NewApplicationGetResourceCommand(clientOpts *argocdclient.ClientOptions) *c
|
|||||||
// Get manifests of resources
|
// Get manifests of resources
|
||||||
// If resource name is "" find all resources of that kind
|
// If resource name is "" find all resources of that kind
|
||||||
var resources []unstructured.Unstructured
|
var resources []unstructured.Unstructured
|
||||||
var fetchedStr string
|
var resourceNames []string
|
||||||
for _, r := range tree.Nodes {
|
for _, r := range tree.Nodes {
|
||||||
if (resourceName != "" && r.Name != resourceName) || (group != "" && r.Group != group) || r.Kind != kind {
|
if (resourceName != "" && r.Name != resourceName) || (group != "" && r.Group != group) || r.Kind != kind {
|
||||||
continue
|
continue
|
||||||
@@ -119,14 +119,11 @@ func NewApplicationGetResourceCommand(clientOpts *argocdclient.ClientOptions) *c
|
|||||||
obj = filterFieldsFromObject(obj, filteredFields)
|
obj = filterFieldsFromObject(obj, filteredFields)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchedStr += obj.GetName() + ", "
|
resourceNames = append(resourceNames, obj.GetName())
|
||||||
resources = append(resources, *obj)
|
resources = append(resources, *obj)
|
||||||
}
|
}
|
||||||
|
fetchedStr := strings.Join(resourceNames, ", ")
|
||||||
printManifests(&resources, len(filteredFields) > 0, resourceName == "", output)
|
printManifests(&resources, len(filteredFields) > 0, resourceName == "", output)
|
||||||
|
|
||||||
if fetchedStr != "" {
|
|
||||||
fetchedStr = strings.TrimSuffix(fetchedStr, ", ")
|
|
||||||
}
|
|
||||||
log.Infof("Resources '%s' fetched", fetchedStr)
|
log.Infof("Resources '%s' fetched", fetchedStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux -o pipefail
|
set -eux -o pipefail
|
||||||
|
|
||||||
# renovate: datasource=go packageName=github.com/golangci/golangci-lint
|
# renovate: datasource=go packageName=github.com/golangci/golangci-lint/v2
|
||||||
GOLANGCI_LINT_VERSION=2.5.0
|
GOLANGCI_LINT_VERSION=2.8.0
|
||||||
|
|
||||||
GO111MODULE=on go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}"
|
GO111MODULE=on go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}"
|
||||||
|
|||||||
1
manifests/core-install-with-hydrator.yaml
generated
1
manifests/core-install-with-hydrator.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/core-install.yaml
generated
1
manifests/core-install.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/crds/application-crd.yaml
generated
1
manifests/crds/application-crd.yaml
generated
@@ -3190,6 +3190,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/ha/install-with-hydrator.yaml
generated
1
manifests/ha/install-with-hydrator.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/ha/install.yaml
generated
1
manifests/ha/install.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/install-with-hydrator.yaml
generated
1
manifests/install-with-hydrator.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
1
manifests/install.yaml
generated
1
manifests/install.yaml
generated
@@ -3191,6 +3191,7 @@ spec:
|
|||||||
observedAt:
|
observedAt:
|
||||||
description: |-
|
description: |-
|
||||||
ObservedAt indicates when the application state was updated without querying latest git state
|
ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
|
||||||
Deprecated: controller no longer updates ObservedAt field
|
Deprecated: controller no longer updates ObservedAt field
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -714,6 +714,7 @@ message ApplicationStatus {
|
|||||||
optional OperationState operationState = 7;
|
optional OperationState operationState = 7;
|
||||||
|
|
||||||
// ObservedAt indicates when the application state was updated without querying latest git state
|
// ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
//
|
||||||
// Deprecated: controller no longer updates ObservedAt field
|
// Deprecated: controller no longer updates ObservedAt field
|
||||||
optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time observedAt = 8;
|
optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time observedAt = 8;
|
||||||
|
|
||||||
@@ -2059,6 +2060,7 @@ message ResourceDiff {
|
|||||||
optional string liveState = 6;
|
optional string liveState = 6;
|
||||||
|
|
||||||
// Diff contains the JSON patch representing the difference between the live and target resource.
|
// Diff contains the JSON patch representing the difference between the live and target resource.
|
||||||
|
//
|
||||||
// Deprecated: Use NormalizedLiveState and PredictedLiveState instead to compute differences.
|
// Deprecated: Use NormalizedLiveState and PredictedLiveState instead to compute differences.
|
||||||
optional string diff = 7;
|
optional string diff = 7;
|
||||||
|
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@ type ApplicationStatus struct {
|
|||||||
// OperationState contains information about any ongoing operations, such as a sync
|
// OperationState contains information about any ongoing operations, such as a sync
|
||||||
OperationState *OperationState `json:"operationState,omitempty" protobuf:"bytes,7,opt,name=operationState"`
|
OperationState *OperationState `json:"operationState,omitempty" protobuf:"bytes,7,opt,name=operationState"`
|
||||||
// ObservedAt indicates when the application state was updated without querying latest git state
|
// ObservedAt indicates when the application state was updated without querying latest git state
|
||||||
|
//
|
||||||
// Deprecated: controller no longer updates ObservedAt field
|
// Deprecated: controller no longer updates ObservedAt field
|
||||||
ObservedAt *metav1.Time `json:"observedAt,omitempty" protobuf:"bytes,8,opt,name=observedAt"`
|
ObservedAt *metav1.Time `json:"observedAt,omitempty" protobuf:"bytes,8,opt,name=observedAt"`
|
||||||
// SourceType specifies the type of this application
|
// SourceType specifies the type of this application
|
||||||
@@ -2191,6 +2192,7 @@ type ResourceDiff struct {
|
|||||||
// LiveState contains the JSON-serialized resource manifest of the resource currently running in the cluster.
|
// LiveState contains the JSON-serialized resource manifest of the resource currently running in the cluster.
|
||||||
LiveState string `json:"liveState,omitempty" protobuf:"bytes,6,opt,name=liveState"`
|
LiveState string `json:"liveState,omitempty" protobuf:"bytes,6,opt,name=liveState"`
|
||||||
// Diff contains the JSON patch representing the difference between the live and target resource.
|
// Diff contains the JSON patch representing the difference between the live and target resource.
|
||||||
|
//
|
||||||
// Deprecated: Use NormalizedLiveState and PredictedLiveState instead to compute differences.
|
// Deprecated: Use NormalizedLiveState and PredictedLiveState instead to compute differences.
|
||||||
Diff string `json:"diff,omitempty" protobuf:"bytes,7,opt,name=diff"`
|
Diff string `json:"diff,omitempty" protobuf:"bytes,7,opt,name=diff"`
|
||||||
// Hook indicates whether this resource is a hook resource (e.g., pre-sync or post-sync hooks).
|
// Hook indicates whether this resource is a hook resource (e.g., pre-sync or post-sync hooks).
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
"go"
|
"go"
|
||||||
],
|
],
|
||||||
"matchPackageNames": [
|
"matchPackageNames": [
|
||||||
"github.com/golangci/golangci-lint",
|
"github.com/golangci/golangci-lint/v2",
|
||||||
"github.com/vektra/mockery/v3"
|
"github.com/vektra/mockery/v3"
|
||||||
],
|
],
|
||||||
"enabled": true
|
"enabled": true
|
||||||
|
|||||||
@@ -1004,7 +1004,7 @@ func TestNoAppEnumeration(t *testing.T) {
|
|||||||
assert.EqualError(t, err, "rpc error: code = NotFound desc = applications.argoproj.io \"doest-not-exist\" not found", "when the request specifies a project, we can return the standard k8s error message")
|
assert.EqualError(t, err, "rpc error: code = NotFound desc = applications.argoproj.io \"doest-not-exist\" not found", "when the request specifies a project, we can return the standard k8s error message")
|
||||||
})
|
})
|
||||||
|
|
||||||
//nolint:staticcheck,SA1019 // RunResourceAction is deprecated, but we still need to support it for backward compatibility.
|
//nolint:staticcheck // SA1019: RunResourceAction is deprecated, but we still need to support it for backward compatibility.
|
||||||
t.Run("RunResourceAction", func(t *testing.T) {
|
t.Run("RunResourceAction", func(t *testing.T) {
|
||||||
_, err := appServer.RunResourceAction(adminCtx, &application.ResourceActionRunRequest{Name: ptr.To("test"), ResourceName: ptr.To("test"), Group: ptr.To("apps"), Kind: ptr.To("Deployment"), Namespace: ptr.To("test"), Action: ptr.To("restart")})
|
_, err := appServer.RunResourceAction(adminCtx, &application.ResourceActionRunRequest{Name: ptr.To("test"), ResourceName: ptr.To("test"), Group: ptr.To("apps"), Kind: ptr.To("Deployment"), Namespace: ptr.To("test"), Action: ptr.To("restart")})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ func (s *Server) getConnectionState(ctx context.Context, url string, project str
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List returns list of repositories
|
// List returns list of repositories
|
||||||
|
//
|
||||||
// Deprecated: Use ListRepositories instead
|
// Deprecated: Use ListRepositories instead
|
||||||
func (s *Server) List(ctx context.Context, q *repositorypkg.RepoQuery) (*v1alpha1.RepositoryList, error) {
|
func (s *Server) List(ctx context.Context, q *repositorypkg.RepoQuery) (*v1alpha1.RepositoryList, error) {
|
||||||
return s.ListRepositories(ctx, q)
|
return s.ListRepositories(ctx, q)
|
||||||
@@ -425,6 +426,7 @@ func (s *Server) GetHelmCharts(ctx context.Context, q *repositorypkg.RepoQuery)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a repository or repository credential set
|
// Create creates a repository or repository credential set
|
||||||
|
//
|
||||||
// Deprecated: Use CreateRepository() instead
|
// Deprecated: Use CreateRepository() instead
|
||||||
func (s *Server) Create(ctx context.Context, q *repositorypkg.RepoCreateRequest) (*v1alpha1.Repository, error) {
|
func (s *Server) Create(ctx context.Context, q *repositorypkg.RepoCreateRequest) (*v1alpha1.Repository, error) {
|
||||||
return s.CreateRepository(ctx, q)
|
return s.CreateRepository(ctx, q)
|
||||||
@@ -535,6 +537,7 @@ func (s *Server) CreateWriteRepository(ctx context.Context, q *repositorypkg.Rep
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update updates a repository or credential set
|
// Update updates a repository or credential set
|
||||||
|
//
|
||||||
// Deprecated: Use UpdateRepository() instead
|
// Deprecated: Use UpdateRepository() instead
|
||||||
func (s *Server) Update(ctx context.Context, q *repositorypkg.RepoUpdateRequest) (*v1alpha1.Repository, error) {
|
func (s *Server) Update(ctx context.Context, q *repositorypkg.RepoUpdateRequest) (*v1alpha1.Repository, error) {
|
||||||
return s.UpdateRepository(ctx, q)
|
return s.UpdateRepository(ctx, q)
|
||||||
@@ -591,6 +594,7 @@ func (s *Server) UpdateWriteRepository(ctx context.Context, q *repositorypkg.Rep
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete removes a repository from the configuration
|
// Delete removes a repository from the configuration
|
||||||
|
//
|
||||||
// Deprecated: Use DeleteRepository() instead
|
// Deprecated: Use DeleteRepository() instead
|
||||||
func (s *Server) Delete(ctx context.Context, q *repositorypkg.RepoQuery) (*repositorypkg.RepoResponse, error) {
|
func (s *Server) Delete(ctx context.Context, q *repositorypkg.RepoQuery) (*repositorypkg.RepoResponse, error) {
|
||||||
return s.DeleteRepository(ctx, q)
|
return s.DeleteRepository(ctx, q)
|
||||||
|
|||||||
Reference in New Issue
Block a user