Skip to content

Commit

Permalink
Update golang Docker tag to v1.23.0 (#255)
Browse files Browse the repository at this point in the history
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Thibault Richard <[email protected]>
  • Loading branch information
elastic-renovate-prod[bot] and thbkrkr authored Aug 28, 2024
1 parent c87f0f2 commit 77ec3e7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ steps:
- label: ":go: lint"
command: make lint
agents:
image: "golang:1.22.5"
image: "golang:1.23.0"
cpu: "4"
memory: "8G"

- label: ":go: tests"
command: make unit-tests
agents:
image: "golang:1.22.5"
image: "golang:1.23.0"
cpu: "4"
memory: "4G"

Expand Down
11 changes: 2 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ linters:
- cyclop
- depguard
- dupl
- exhaustivestruct
- forbidigo
- funlen
- gci
Expand All @@ -32,14 +31,11 @@ linters:
- gocyclo
- godot
- godox
- goerr113
- err113
- gofmt
- gofumpt
- golint
- gomnd
- gomodguard
- interfacer
- maligned
- nlreturn
- paralleltest
- rowserrcheck
Expand All @@ -52,13 +48,12 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- dogsled
- durationcheck
- errcheck
- errorlint
- exhaustive
- exportloopref
- copyloopvar
- forcetypeassert
- gocritic
- goheader
Expand All @@ -80,14 +75,12 @@ linters:
- predeclared
- revive
- staticcheck
- structcheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- whitespace

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ $(GOBIN)/go-licence-detector:
@ go install go.elastic.co/[email protected]

$(GOBIN)/golangci-lint:
@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
Long: "Dump ECK and Kubernetes data for support and troubleshooting purposes.",
PreRunE: preRunOperations,
Version: internal.Version(),
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
return internal.Run(diagParams)
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/diag.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func Run(params Params) error {
operatorVersions = append(operatorVersions, detectECKVersion(clientSet, ns, params.ECKVersion))
}

maxOperatorVersion := max(operatorVersions)
maxOperatorVersion := maxVersion(operatorVersions)
logVersion(maxOperatorVersion)

allNamespaces := sets.New(params.ResourcesNamespaces...)
Expand Down
6 changes: 3 additions & 3 deletions internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func extractVersionFromContainers(containers []corev1.Container) *version.Versio
if strings.Contains(container.Image, "eck-operator") {
parsed, err := extractVersionFromDockerImage(container.Image)
if err != nil {
logger.Printf(err.Error())
logger.Print(err.Error())
return fallbackMaxVersion
}
return parsed
Expand Down Expand Up @@ -142,8 +142,8 @@ func extractVersionFromDockerImage(image string) (*version.Version, error) {
return fallbackMaxVersion, nil
}

// max returns the maximum of the given versions.
func max(versions []*version.Version) *version.Version {
// maxVersion returns the maximum of the given versions.
func maxVersion(versions []*version.Version) *version.Version {
if len(versions) == 0 {
return fallbackMaxVersion
}
Expand Down
2 changes: 1 addition & 1 deletion internal/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Test_min(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := max(tt.args.versions); !reflect.DeepEqual(got, tt.want) {
if got := maxVersion(tt.args.versions); !reflect.DeepEqual(got, tt.want) {
t.Errorf("max() = %v, want %v", got, tt.want)
}
})
Expand Down

0 comments on commit 77ec3e7

Please sign in to comment.