Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP]Bump Golang to 1.23.1 #892

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

yuntanghsu
Copy link
Contributor

In order to ensure TLS 1.3 is supportted. We bump Golang version to 1.23.1

In this patch, we do:

  1. Bump golangci to v1.61.0 in order to support golang v1.23.1
  2. To increase flexibility for downstream consumers, we set a lower Go version in go.mod for API module (nsx-operator/pkg/apis), allowing them to choose their preferred Go version. However, we will keep the main module (nsx-operator) on the latest Go version. Currently, we set Go 1.21 for the API module.
  3. Update controller-runtime to v0.19.0 for this issue: Controller-runtime does not compile with client-go 1.31 with version v0.18.5 kubernetes-sigs/controller-runtime#2925
  4. Update controller-gen to v16.5 to resolve the error below.
/Users/hsuy/Desktop/nsx-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/legacy/v1alpha1" output:crd:artifacts:config=build/yaml/crd/legacy/
/Users/hsuy/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
/Users/hsuy/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
github.com/vmware-tanzu/nsx-operator/pkg/apis/legacy/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".ConditionStatus

In order to ensure TLS 1.3 is supportted. We bump Golang version to 1.23.1

In this patch, we do:
1. Bump golangci to v1.61.0 in order to support golang v1.23.1
2. To increase flexibility for downstream consumers, we set a lower Go version in `go.mod` for API module (nsx-operator/pkg/apis), allowing them to choose their preferred Go version. However, we will keep the main module (nsx-operator) on the latest Go version. Currently, we set Go 1.21 for the API module.
3. Update controller-runtime to v0.19.0 for this issue:
kubernetes-sigs/controller-runtime#2925
4. Update controller-gen to v16.5 to resolve the error below.
```
/Users/hsuy/Desktop/nsx-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/legacy/v1alpha1" output:crd:artifacts:config=build/yaml/crd/legacy/
/Users/hsuy/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
/Users/hsuy/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
github.com/vmware-tanzu/nsx-operator/pkg/apis/legacy/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".ConditionStatus
```

Signed-off-by: Yun-Tang Hsu <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.99%. Comparing base (1460f6f) to head (ba4de31).

Files with missing lines Patch % Lines
.../controllers/networkinfo/networkinfo_controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           v4.2.0     #892      +/-   ##
==========================================
- Coverage   70.25%   69.99%   -0.26%     
==========================================
  Files          95       95              
  Lines       15096    15096              
==========================================
- Hits        10606    10567      -39     
- Misses       3760     3803      +43     
+ Partials      730      726       -4     
Flag Coverage Δ
unit-tests 69.99% <94.11%> (-0.26%) ⬇️
Files with missing lines Coverage Δ
...ontrollers/networkinfo/vpcnetworkconfig_handler.go 83.33% <100.00%> (+0.98%) ⬆️
...kg/controllers/securitypolicy/namespace_handler.go 63.26% <100.00%> (ø)
pkg/controllers/securitypolicy/pod_handler.go 72.85% <100.00%> (ø)
...ollers/securitypolicy/securitypolicy_controller.go 79.61% <100.00%> (-7.34%) ⬇️
pkg/controllers/subnet/namespace_handler.go 100.00% <100.00%> (ø)
pkg/controllers/subnetset/namespace_handler.go 100.00% <100.00%> (ø)
pkg/util/utils.go 54.46% <ø> (+0.98%) ⬆️
.../controllers/networkinfo/networkinfo_controller.go 66.03% <0.00%> (ø)

... and 2 files with indirect coverage changes

@yuntanghsu yuntanghsu changed the title Bump Golang to 1.23.1 [CP]Bump Golang to 1.23.1 Nov 14, 2024
Copy link
Contributor

@zhengxiexie zhengxiexie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhengxiexie zhengxiexie merged commit ba9da31 into vmware-tanzu:v4.2.0 Nov 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants