Skip to content

Commit 2703ec3

Browse files
authored
CLOUDP-309672: bump to go1.24 (#66)
* bump to go1.24 * bump golangci-lint * fix linter errors
1 parent b4bb684 commit 2703ec3

File tree

10 files changed

+14
-12
lines changed

10 files changed

+14
-12
lines changed

.github/workflows/code-health.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
2323
go-version-file: 'go.mod'
2424
cache: false # see https://github.com/golangci/golangci-lint-action/issues/807
2525
- name: golangci-lint
26-
uses: golangci/golangci-lint-action@v6.1.1
26+
uses: golangci/golangci-lint-action@v7.0.0
2727
with:
28-
version: v1.61.0
2928
args: --timeout 3m0s
3029
licensecheck:
3130
name: licensecheck

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To make the contribution process as seamless as possible, we ask for the followi
4747
#### Prerequisite Tools
4848

4949
- [Git](https://git-scm.com/)
50-
- [Go (at least Go 1.23.1)](https://golang.org/dl/)
50+
- [Go (at least Go 1.24)](https://golang.org/dl/)
5151

5252
#### Environment
5353

build/ci/evergreen.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ include:
2121

2222
variables:
2323
- &go_linux_version
24-
go_root: "/opt/golang/go1.23"
25-
go_bin: "/opt/golang/go1.23/bin"
24+
go_root: "/opt/golang/go1.24"
25+
go_bin: "/opt/golang/go1.24/bin"
2626
go_base_path: ""
2727
- &go_env
2828
XDG_CONFIG_HOME: ${go_base_path}${workdir}

build/ci/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
variables:
1616
- &go_linux_version
17-
go_root: "/opt/golang/go1.23"
18-
go_bin: "/opt/golang/go1.23/bin"
17+
go_root: "/opt/golang/go1.24"
18+
go_bin: "/opt/golang/go1.24/bin"
1919
go_base_path: ""
2020
- &go_env
2121
XDG_CONFIG_HOME: ${go_base_path}${workdir}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/mongodb/atlas-cli-plugin-kubernetes
22

3-
go 1.23.6
3+
go 1.24
44

55
require (
66
cloud.google.com/go/compute v1.34.1

internal/cli/kubernetes/dryrun/dryrun.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func Builder() *cobra.Command {
112112
Short: "Deploy and run Atlas Kubernetes Operator in dry-run mode",
113113
Long: `This command deploys the Atlas Kubernetes operator with the DryRun mode.`,
114114
PreRunE: func(_ *cobra.Command, _ []string) error {
115-
return opts.OrgOpts.PreRunE(
115+
return opts.PreRunE(
116116
opts.ValidateTargetNamespace,
117117
opts.ValidateOperatorVersion,
118118
)

internal/cli/kubernetes/kubernetes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func Builder() *cobra.Command {
5252
return fmt.Errorf("failed to load Atlas CLI configuration: %v", err)
5353
}
5454
if err := coreConfig.InitProfile(profile); err != nil {
55-
return fmt.Errorf("Failed to initialise Atlas CLI profile: %v", err)
55+
return fmt.Errorf("failed to initialise Atlas CLI profile: %w", err)
5656
}
5757

5858
telemetry.TrackPluginCommand(cmd, args)

internal/kubernetes/operator/crds/provider.go

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func (p EmbeddedAtlasCRDProvider) GetAtlasOperatorResource(resourceName, version
4343
if err != nil {
4444
return nil, fmt.Errorf("failed to open embeddedPath path %q: %w", embeddedPath, err)
4545
}
46+
//nolint:errcheck
4647
defer f.Close()
4748

4849
data, err := io.ReadAll(f)

internal/kubernetes/operator/features/embeded_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"github.com/stretchr/testify/assert"
2929
"github.com/stretchr/testify/require"
3030
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
31-
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
3231
"sigs.k8s.io/yaml"
3332
)
3433

@@ -61,7 +60,7 @@ func diffResource(t *testing.T, httpClient *http.Client, provider crds.AtlasOper
6160
return !reflect.DeepEqual(localCRD, remoteCRD)
6261
}
6362

64-
func getGitHubCRD(httpClient *http.Client, resource, version string) (*v1.CustomResourceDefinition, error) {
63+
func getGitHubCRD(httpClient *http.Client, resource, version string) (*apiextensionsv1.CustomResourceDefinition, error) {
6564
ctx, cancelF := context.WithTimeout(context.Background(), requestTimeout)
6665
defer cancelF()
6766

@@ -75,6 +74,7 @@ func getGitHubCRD(httpClient *http.Client, resource, version string) (*v1.Custom
7574
if err != nil {
7675
return nil, fmt.Errorf("failed to GET %s: %w", url, err)
7776
}
77+
//nolint:errcheck
7878
defer resp.Body.Close()
7979

8080
data, err := io.ReadAll(resp.Body)

internal/telemetry/tracker.go

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (t *pluginTracker) read() ([]Event, error) {
9797
if err != nil {
9898
return events, err
9999
}
100+
//nolint:errcheck
100101
defer file.Close()
101102
decoder := json.NewDecoder(file)
102103
for decoder.More() {
@@ -117,6 +118,7 @@ func (t *pluginTracker) save(event Event) error {
117118
return err
118119
}
119120

121+
//nolint:errcheck
120122
defer file.Close()
121123
data, err := json.Marshal(event)
122124
if err != nil {

0 commit comments

Comments
 (0)