[deps] Update Go version, Golang CI, Cluster API, Kubernetes, and related dependencies#742
[deps] Update Go version, Golang CI, Cluster API, Kubernetes, and related dependencies#742
Conversation
Bumps golang from 1.23 to 1.24. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the kubernetes group with 4 updates: [k8s.io/api](https://github.com/kubernetes/api), [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery), [k8s.io/client-go](https://github.com/kubernetes/client-go) and [sigs.k8s.io/cluster-api](https://github.com/kubernetes-sigs/cluster-api). Updates `k8s.io/api` from 0.32.3 to 0.33.0 - [Commits](kubernetes/api@v0.32.3...v0.33.0) Updates `k8s.io/apimachinery` from 0.32.3 to 0.33.0 - [Commits](kubernetes/apimachinery@v0.32.3...v0.33.0) Updates `k8s.io/client-go` from 0.32.3 to 0.33.0 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.32.3...v0.33.0) Updates `sigs.k8s.io/cluster-api` from 1.9.6 to 1.10.0 - [Release notes](https://github.com/kubernetes-sigs/cluster-api/releases) - [Commits](kubernetes-sigs/cluster-api@v1.9.6...v1.10.0) --- updated-dependencies: - dependency-name: k8s.io/api dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kubernetes - dependency-name: k8s.io/apimachinery dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kubernetes - dependency-name: k8s.io/client-go dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kubernetes - dependency-name: sigs.k8s.io/cluster-api dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kubernetes ... Signed-off-by: dependabot[bot] <support@github.com>
…-0b7b5b66ae' into update-deps
- Updated Go version from 1.23.0 to 1.24.0 in go.mod and devbox files. - Removed kubernetes-controller-tools dependency from devbox.json and devbox.lock. Devbox was using older version causing issues. We can just use the binary we download using makefile target - Updated references to cluster-api addons API from experimental to stable in multiple files. This commit ensures compatibility with the latest Go version and cleans up unused dependencies, improving overall project maintainability.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #742 +/- ##
==========================================
- Coverage 65.22% 62.97% -2.26%
==========================================
Files 69 69
Lines 6597 6598 +1
==========================================
- Hits 4303 4155 -148
- Misses 2041 2214 +173
+ Partials 253 229 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Replaced instances of `context.Background()` with `t.Context()` in various test files to ensure proper context propagation during testing. This was an issue thrown by golangci. - Updated `.golangci.yml` to version 2 and modified the configuration, including exclusions for generated files and specific paths. - Changed the golangci-lint Docker image version in the Makefile to v2.1.5 for consistency with the updated configuration. These changes enhance test reliability and maintainability while aligning with the latest linting standards.
There was a problem hiding this comment.
Pull Request Overview
This PR updates a number of dependencies and development tools, including upgrading Go to 1.24, Cluster API to v1.10.1, Kubernetes client libraries to v0.33.0, and golangci-lint to v2/v7. The changes include replacing usages of context.Background() with t.Context() in tests, updating dot-imports to explicit package imports, and modifying field accesses in secret generation for object storage keys to match the updated API.
Reviewed Changes
Copilot reviewed 61 out of 63 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cloud/scope/vpc_test.go | Replaced context.Background() with t.Context() in VPC scope tests. |
| cloud/scope/vpc.go | Updated explicit package references for client types. |
| cloud/scope/placement_group_test.go | Replaced context.Background() with t.Context() in placement group tests. |
| cloud/scope/placement_group.go | Updated explicit import and client type usage. |
| cloud/scope/object_storage_key_test.go | Modified context usage to t.Context() in secret key tests. |
| cloud/scope/object_storage_key.go | Adjusted secret generation fields to match new API structure. |
| cloud/scope/object_storage_bucket_test.go | Replaced context.Background() with t.Context() in bucket scope tests. |
| cloud/scope/object_storage_bucket.go | Updated explicit client references for bucket scope. |
| cloud/scope/machine_test.go | Replaced context.Background() with t.Context() in machine scope tests. |
| cloud/scope/machine.go | Updated explicit client references for machine scope. |
| cloud/scope/firewall_test.go | Replaced context.Background() with t.Context() in firewall tests. |
| cloud/scope/firewall.go | Updated explicit client references for firewall scope. |
| cloud/scope/common_test.go | Replaced context.Background() with t.Context() in common tests. |
| cloud/scope/common.go | Updated explicit client references for common functions. |
| cloud/scope/cluster_test.go | Replaced context.Background() with t.Context() in cluster scope tests. |
| cloud/scope/cluster.go | Updated explicit client references and DNS client creation. |
| .golangci.yml | Updated configuration to schema version 2 and removed deprecated options. |
| .github/workflows/go-analyze.yml | Updated golangci-lint action from v6 to v7. |
Files not reviewed (2)
- Dockerfile: Language not supported
- Makefile: Language not supported
| // Set an owner reference on a Secret if it will exist in the same namespace as the Key resource. | ||
| // Kubernetes does not allow cross-namespace ownership so modifications to a Secret in another namespace won't trigger reconciliation. | ||
| if s.Key.Spec.GeneratedSecret.Namespace == s.Key.Namespace { | ||
| if s.Key.Spec.Namespace == s.Key.Namespace { |
There was a problem hiding this comment.
The condition 'if s.Key.Spec.Namespace == s.Key.Namespace' always evaluates to true. Likely, it should compare the secret's namespace with the key object's namespace (for example, 'if s.Key.Spec.Namespace == s.Key.GetNamespace()') to correctly set the owner reference.
| if s.Key.Spec.Namespace == s.Key.Namespace { | |
| if s.Key.Spec.Namespace == s.Key.GetNamespace() { |
rosskirkpat
left a comment
There was a problem hiding this comment.
one small request, otherwise LGTM!
- Changed the golangci-lint Docker image version in the Makefile to utilize the GOLANGCI_LINT_VERSION variable, ensuring easier updates and consistency across the project. - Added GOLANGCI_LINT_VERSION variable with a default value of v2.1.5 for better maintainability.
What this PR does / why we need it:
This PR updates several core dependencies and development tools to their newer versions:
sigs.k8s.io/cluster-api/exp/addons/api/v1beta1tosigs.k8s.io/cluster-api/api/addons/v1beta1.maxLength,minLength,enumconstraints) inconfig/crd/bases/..golangci.yml,Makefile)..golangci.yml) to schema version "2", and adjusted enabled linters.context.Background()usage tot.Context()within test files.clientspackage.go.modwere updated as a result of the primary dependency bumps.The goal of these updates is to stay current with upstream releases, benefiting from the latest features, security patches, and bug fixes provided by Go, Kubernetes, Cluster API, and
golangci-lint. Corresponding changes were made to configuration, build files, CRDs, and source code to ensure compatibility and adherence to updated standards.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
TODOs: