Skip to content

Commit

Permalink
fix build error from netlink upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtty committed Sep 12, 2024
1 parent c0f0afe commit 93a5cbc
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 87 deletions.
7 changes: 0 additions & 7 deletions config/cnimanager/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ rules:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.1
name: gatewaylbconfigurations.egressgateway.kubernetes.azure.com
spec:
group: egressgateway.kubernetes.azure.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.1
name: gatewaystatuses.egressgateway.kubernetes.azure.com
spec:
group: egressgateway.kubernetes.azure.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.1
name: gatewayvmconfigurations.egressgateway.kubernetes.azure.com
spec:
group: egressgateway.kubernetes.azure.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.1
name: podendpoints.egressgateway.kubernetes.azure.com
spec:
group: egressgateway.kubernetes.azure.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.1
name: staticgatewayconfigurations.egressgateway.kubernetes.azure.com
spec:
group: egressgateway.kubernetes.azure.com
Expand Down Expand Up @@ -117,7 +117,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down
25 changes: 2 additions & 23 deletions config/daemon/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ rules:
- egressgateway.kubernetes.azure.com
resources:
- gatewayvmconfigurations
- podendpoints
- staticgatewayconfigurations
verbs:
- get
- list
Expand All @@ -37,33 +39,10 @@ rules:
- gatewayvmconfigurations/status
verbs:
- get
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- podendpoints
verbs:
- get
- list
- watch
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- podendpoints/status
verbs:
- get
- patch
- update
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- staticgatewayconfigurations
verbs:
- get
- list
- watch
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- staticgatewayconfigurations/status
verbs:
- get
Expand Down
47 changes: 3 additions & 44 deletions config/manager/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,8 @@ rules:
- egressgateway.kubernetes.azure.com
resources:
- gatewaylbconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- gatewaylbconfigurations/finalizers
verbs:
- update
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- gatewaylbconfigurations/status
verbs:
- get
- patch
- update
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- gatewayvmconfigurations
- staticgatewayconfigurations
verbs:
- create
- delete
Expand All @@ -72,32 +48,15 @@ rules:
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- gatewaylbconfigurations/finalizers
- gatewayvmconfigurations/finalizers
verbs:
- update
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- gatewaylbconfigurations/status
- gatewayvmconfigurations/status
verbs:
- get
- patch
- update
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- staticgatewayconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- egressgateway.kubernetes.azure.com
resources:
- staticgatewayconfigurations/status
verbs:
- get
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/vishvananda/netlink v1.2.1-beta.2
github.com/vishvananda/netlink v1.3.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0
go.uber.org/mock v0.4.0
go.uber.org/multierr v1.11.0
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down Expand Up @@ -307,8 +306,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -318,6 +315,8 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cni/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func addRoutingForIngress(eth0Link netlink.Link, defaultRoute netlink.Route, sys

// add ip rule: lookup separate routing table if packet is marked
rule := netlink.NewRule()
rule.Mark = consts.Eth0Mark
rule.Mark = uint32(consts.Eth0Mark)
rule.Table = consts.Eth0Mark
if err := routesRunner.netlink.RuleAdd(rule); err != nil {
return fmt.Errorf("failed to add routing rule: %w", err)
Expand Down

0 comments on commit 93a5cbc

Please sign in to comment.