Skip to content

Commit 40d1ed0

Browse files
feat: update argocd to v3 , update go to 1.25, fix "output" flag typo (#803)
## What <!-- What is changing in this PR? --> ## Why <!-- Why are these changes being made? --> ## Notes <!-- Add any additional notes here -->
1 parent 78f4993 commit 40d1ed0

58 files changed

Lines changed: 562 additions & 563 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yaml

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,50 @@
1-
# This file contains all available configuration options
2-
# with their default values.
3-
4-
# options for analysis running
1+
version: "2"
52
run:
6-
# https://github.com/golangci/golangci-lint/issues/2649
7-
# enable go 1.17 linting, will not allow generics
8-
go: "1.17"
9-
10-
# default concurrency is a available CPU number
113
concurrency: 4
12-
13-
# timeout for analysis, e.g. 30s, 5m, default is 1m
14-
timeout: 1m
15-
16-
# exit code when at least one issue was found, default is 1
4+
go: "1.25"
175
issues-exit-code: 1
18-
196
linters:
7+
default: none
208
enable:
9+
- goconst
2110
- gocyclo
22-
- errcheck
23-
- godox
24-
# all available settings of specific linters
25-
linters-settings:
26-
errcheck:
27-
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
28-
# default is false: such cases aren't reported by default.
29-
check-type-assertions: false
30-
31-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
32-
# default is false: such cases aren't reported by default.
33-
check-blank: false
34-
35-
gocyclo:
36-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
37-
min-complexity: 20
11+
- goprintffuncname
12+
- misspell
13+
- nakedret
14+
- unconvert
15+
- whitespace
16+
settings:
17+
errcheck:
18+
check-type-assertions: false
19+
check-blank: false
20+
gocyclo:
21+
min-complexity: 20
22+
nakedret:
23+
max-func-lines: 0
24+
nonamedreturns:
25+
report-error-in-defer: true
26+
exclusions:
27+
generated: lax
28+
presets:
29+
- comments
30+
- common-false-positives
31+
- legacy
32+
- std-error-handling
33+
rules:
34+
- linters:
35+
- goconst
36+
path: _test\.go
37+
paths:
38+
- third_party$
39+
- builtin$
40+
- examples$
41+
formatters:
42+
enable:
43+
- gofmt
44+
- goimports
45+
exclusions:
46+
generated: lax
47+
paths:
48+
- third_party$
49+
- builtin$
50+
- examples$

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VERSION=v0.2.17
1+
VERSION=v1.0.0
2+
3+
GOLANGCI_LINT_VERSION?= v2.8.0
24

35
OUT_DIR=dist
46
YEAR?=$(shell date +"%Y")
@@ -124,9 +126,9 @@ $(OUT_DIR)/$(CLI_NAME).image: $(CLI_SRCS)
124126
@touch $(OUT_DIR)/$(CLI_NAME).image
125127

126128
.PHONY: lint
127-
lint: $(GOBIN)/golangci-lint tidy
129+
lint: build-lint tidy
128130
@echo linting go code...
129-
@golangci-lint run --fix --timeout 10m
131+
@$(GOBIN)/golangci-lint run --fix --timeout 10m
130132

131133
.PHONY: test
132134
test:
@@ -135,7 +137,7 @@ test:
135137
.PHONY: codegen
136138
codegen: $(GOBIN)/mockgen
137139
rm -f ./docs/commands/*
138-
go generate ./...
140+
PATH="$(GOBIN):$$PATH" go generate ./...
139141
go run ./hack/license.go --license ./hack/boilerplate.txt --year $(YEAR) .
140142

141143
.PHONY: pre-commit
@@ -171,9 +173,9 @@ check-worktree:
171173

172174
$(GOBIN)/mockgen:
173175
@go install github.com/golang/mock/mockgen@v1.6.0
174-
@mockgen -version
176+
@$(GOBIN)/mockgen -version
175177

176-
$(GOBIN)/golangci-lint:
177-
@mkdir dist || true
178+
.PHONY: build-lint
179+
build-lint:
178180
@echo installing: golangci-lint
179-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.64.8
181+
@GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

cmd/commands/account.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@ package commands
1717
import (
1818
"context"
1919
"fmt"
20+
"strings"
21+
2022
"github.com/codefresh-io/cli-v2/internal/kube"
2123
"github.com/codefresh-io/cli-v2/internal/log"
2224
"github.com/codefresh-io/cli-v2/internal/store"
@@ -27,7 +29,6 @@ import (
2729
"github.com/codefresh-io/go-sdk/pkg/graphql"
2830
platmodel "github.com/codefresh-io/go-sdk/pkg/model/platform"
2931
"github.com/spf13/cobra"
30-
"strings"
3132
)
3233

3334
type (

cmd/commands/account_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

cmd/commands/cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -396,7 +396,7 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
396396
return nil, "", fmt.Errorf("failed encoding annotations: %w", err)
397397
}
398398

399-
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprint("annotations="+annotationsStr))
399+
k.ConfigMapGenerator[0].LiteralSources = append(k.ConfigMapGenerator[0].LiteralSources, fmt.Sprint("annotations="+annotationsStr))
400400
}
401401

402402
if len(opts.labels) > 0 {
@@ -405,7 +405,7 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
405405
return nil, "", fmt.Errorf("failed encoding labels: %w", err)
406406
}
407407

408-
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprint("labels="+labelsStr))
408+
k.ConfigMapGenerator[0].LiteralSources = append(k.ConfigMapGenerator[0].LiteralSources, fmt.Sprint("labels="+labelsStr))
409409
}
410410

411411
if opts.tag != "" {

cmd/commands/cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

cmd/commands/common.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,13 +19,14 @@ import (
1919
_ "embed"
2020
"errors"
2121
"fmt"
22-
"github.com/codefresh-io/cli-v2/internal/util/helm"
23-
kubeutil "github.com/codefresh-io/cli-v2/internal/util/kube"
24-
"github.com/codefresh-io/go-sdk/pkg/codefresh"
2522
"os"
2623
"regexp"
2724
"strings"
2825

26+
"github.com/codefresh-io/cli-v2/internal/util/helm"
27+
kubeutil "github.com/codefresh-io/cli-v2/internal/util/kube"
28+
"github.com/codefresh-io/go-sdk/pkg/codefresh"
29+
2930
"github.com/codefresh-io/cli-v2/internal/config"
3031
"github.com/codefresh-io/cli-v2/internal/log"
3132
"github.com/codefresh-io/cli-v2/internal/store"
@@ -38,6 +39,10 @@ import (
3839
"github.com/spf13/viper"
3940
)
4041

42+
const (
43+
notAvailable = "N/A"
44+
)
45+
4146
var (
4247
die = util.Die
4348
exit = os.Exit

cmd/commands/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

cmd/commands/component.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -28,8 +28,6 @@ import (
2828
"github.com/spf13/cobra"
2929
)
3030

31-
type ()
32-
3331
func newComponentCommand() *cobra.Command {
3432
cmd := &cobra.Command{
3533
Use: "component",
@@ -112,8 +110,8 @@ func printComponents(w io.Writer, components []platmodel.Component) error {
112110

113111
func printComponent(w io.Writer, c platmodel.Component) error {
114112
name := c.Metadata.Name
115-
healthStatus := "N/A"
116-
syncStatus := "N/A"
113+
healthStatus := notAvailable
114+
syncStatus := notAvailable
117115
version := c.Version
118116

119117
if c.Self != nil {

cmd/commands/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 The Codefresh Authors.
1+
// Copyright 2026 The Codefresh Authors.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)