-
Notifications
You must be signed in to change notification settings - Fork 387
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
Update Go version to 1.17 #2606
Comments
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes antrea-io#2606 Signed-off-by: Antonin Bas <abas@vmware.com>
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes antrea-io#2606 Signed-off-by: Antonin Bas <abas@vmware.com>
One notable change in Go 1.17 is in the
This change addresses this CVE: https://nvd.nist.gov/vuln/detail/CVE-2021-29923. It is not deemed a serious security risk and not backported to earlier Go versions. See golang/go#30999 Here is how it affects Antrea: K8s is taking some extra steps as they upgrade to Go 1.17 to ensure backwards-compatibility of API resources which include IP fields and for which the contents of the field are validated using the Here is what will happen in Antrea if we upgrade to Go 1.17 without following the same steps as K8s:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
app: nginx
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: "010.0.0.1/32"
ports:
- protocol: TCP
port: 80
$ antctl get networkpolicy c80a27c4-e855-4a17-acc5-85bde5742719 -o yaml
apiVersion: controlplane.antrea.io/v1beta2
appliedToGroups:
- 79422d97-26a2-5ff8-aac0-721a7b767d20
kind: NetworkPolicy
metadata:
creationTimestamp: null
generation: 1
name: c80a27c4-e855-4a17-acc5-85bde5742719
uid: c80a27c4-e855-4a17-acc5-85bde5742719
rules:
- action: Allow
direction: Out
enableLogging: false
from: {}
priority: -1
services:
- port: 80
protocol: TCP
to:
ipBlocks:
- cidr:
ip: AAAAAAAAAAAAAP//CgAAAQ==
prefixLength: 32
sourceRef:
name: test-network-policy
namespace: default
type: K8sNetworkPolicy
uid: c80a27c4-e855-4a17-acc5-85bde5742719
$ antctl get networkpolicy c80a27c4-e855-4a17-acc5-85bde5742719 -o yaml
apiVersion: controlplane.antrea.io/v1beta2
appliedToGroups:
- 79422d97-26a2-5ff8-aac0-721a7b767d20
kind: NetworkPolicy
metadata:
creationTimestamp: null
generation: 1
name: c80a27c4-e855-4a17-acc5-85bde5742719
uid: c80a27c4-e855-4a17-acc5-85bde5742719
rules:
- action: Allow
direction: Out
enableLogging: false
from: {}
priority: -1
services:
- port: 80
protocol: TCP
to:
ipBlocks:
- cidr:
prefixLength: 32
sourceRef:
name: test-network-policy
namespace: default
type: K8sNetworkPolicy
uid: c80a27c4-e855-4a17-acc5-85bde5742719 Note the missing IP address
We have 2 choices to move forward (not updating Go is not an option):
My vote goes to the second option for simplicity's sake. But I would like to hear an opinion from others. @jianjuns @tnqn @salv-orlando |
+1 for option 2 |
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin Another notable change is in the implementation of ParseIP and ParseCIDR from the net package. These functions now reject IPv4 addresses which contain decimal components with leading zeros. K8s is taking some extra steps as they upgrade to Go 1.17 to ensure backwards-compatibility of API resources which include IP fields and for which the contents of the field are validated using the net stdlib functions. They are defining their own versions of these functions, using code from the old version of the standard library. In our case, we have decided not to follow in K8s steps and we are sticking to the Go 1.17 standard library. Our analysis has concluded that there is no reason to preserve past behavior for network policies which use such IPv4 addresses. Note that these policies will still be "valid" resources that users can delete / update. But the Agent will reject the internal version of the policies distributed by the Controller. As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes antrea-io#2606 Signed-off-by: Antonin Bas <abas@vmware.com>
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin Another notable change is in the implementation of ParseIP and ParseCIDR from the net package. These functions now reject IPv4 addresses which contain decimal components with leading zeros. K8s is taking some extra steps as they upgrade to Go 1.17 to ensure backwards-compatibility of API resources which include IP fields and for which the contents of the field are validated using the net stdlib functions. They are defining their own versions of these functions, using code from the old version of the standard library. In our case, we have decided not to follow in K8s steps and we are sticking to the Go 1.17 standard library. Our analysis has concluded that there is no reason to preserve past behavior for network policies which use such IPv4 addresses. Note that these policies will still be "valid" resources that users can delete / update. But the Agent will reject the internal version of the policies distributed by the Controller. As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes antrea-io#2606 Signed-off-by: Antonin Bas <abas@vmware.com>
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin Another notable change is in the implementation of ParseIP and ParseCIDR from the net package. These functions now reject IPv4 addresses which contain decimal components with leading zeros. K8s is taking some extra steps as they upgrade to Go 1.17 to ensure backwards-compatibility of API resources which include IP fields and for which the contents of the field are validated using the net stdlib functions. They are defining their own versions of these functions, using code from the old version of the standard library. In our case, we have decided not to follow in K8s steps and we are sticking to the Go 1.17 standard library. Our analysis has concluded that there is no reason to preserve past behavior for network policies which use such IPv4 addresses. Note that these policies will still be "valid" resources that users can delete / update. But the Agent will reject the internal version of the policies distributed by the Controller. As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes antrea-io#2606 Signed-off-by: Antonin Bas <abas@vmware.com>
Go 1.17 has just been released, which means that Go 1.15 will not be actively maintained any more. One notable change in Go 1.17 is that "pruned module graphs" are used: https://golang.org/doc/go1.17#go-command. In Go 1.17, for the go command to correctly resolve transitive imports using the pruned module graph, the go.mod file for each module needs to include more detail about the transitive dependencies relevant to that module. This leads to a second require directive for modules that provide a transitively-imported package. In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages. The following command was used to update the go.mod (as suggested): go-1.17 mod tidy -go=1.16 && go-1.17 mod tidy -go=1.17 I checked that the project could still be built using older Go versions: GO=go-1.15 make bin GO=go-1.16 make bin GO=go-1.17 make bin Another notable change is in the implementation of ParseIP and ParseCIDR from the net package. These functions now reject IPv4 addresses which contain decimal components with leading zeros. K8s is taking some extra steps as they upgrade to Go 1.17 to ensure backwards-compatibility of API resources which include IP fields and for which the contents of the field are validated using the net stdlib functions. They are defining their own versions of these functions, using code from the old version of the standard library. In our case, we have decided not to follow in K8s steps and we are sticking to the Go 1.17 standard library. Our analysis has concluded that there is no reason to preserve past behavior for network policies which use such IPv4 addresses. Note that these policies will still be "valid" resources that users can delete / update. But the Agent will reject the internal version of the policies distributed by the Controller. As part of this change, I also tried to have the current Go version be defined in a "central" location to facilitate future updates. Unfortunately this doesn't apply to Github actions yet, for which the Go version is still hardcoded in multiple places. Fixes #2606 Signed-off-by: Antonin Bas <abas@vmware.com>
Go 1.17 has been released: https://golang.org/doc/go1.17
This means that Go 1.15 will not be actively maintained any more
The text was updated successfully, but these errors were encountered: