Skip to content

Commit

Permalink
[IPv6] Fix issues
Browse files Browse the repository at this point in the history
* remove Github Actions integration test, Jenkins: jenkins-integration
-> Integration tests
* remove nodeRouteInfo
* go fmt
* add FlowProtocl() to interface Flow
* remove extra lines when rebasing for an octant commit
* TestIPv6RoutesAndNeighbors: routeClient.Initialize
  • Loading branch information
lzhecheng committed Nov 10, 2020
1 parent a0ce330 commit 289f5ee
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 69 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/integration.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/jenkins/jobs/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
- nobody123_nobody123_
only_trigger_phrase: false
trigger_permit_all: true
status_context: jenkins-integration
status_context: Integration tests
status_url: null
success_status: Build finished.
failure_status: Failed.
Expand Down
7 changes: 0 additions & 7 deletions pkg/agent/controller/noderoute/node_route_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ func NewNodeRouteController(
return controller
}

// nodeRouteInfo is the route related information extracted from corev1.Node.
type nodeRouteInfo struct {
podCIDR *net.IPNet
nodeIP net.IP
gatewayIP net.IP
}

// enqueueNode adds an object to the controller work queue
// obj could be a *corev1.Node, or a DeletionFinalStateUnknown item.
func (c *Controller) enqueueNode(obj interface{}) {
Expand Down
8 changes: 5 additions & 3 deletions pkg/agent/openflow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,12 @@ func (c *client) InstallTraceflowFlows(dataplaneTag uint8) error {
flows = []binding.Flow{}
for _, ctx := range c.globalConjMatchFlowCache {
if ctx.dropFlow != nil {
copyFlowBuilder := ctx.dropFlow.CopyToBuilder(priorityNormal+2, false)
if ctx.dropFlow.FlowProtocol() == "" {
copyFlowBuilder = copyFlowBuilder.MatchProtocol(binding.ProtocolIP)
}
flows = append(
flows,
ctx.dropFlow.CopyToBuilder(priorityNormal+2, false).
MatchIPDscp(dataplaneTag).
flows, copyFlowBuilder.MatchIPDscp(dataplaneTag).
SetHardTimeout(300).
Action().SendToController(uint8(PacketInReasonTF)).
Done())
Expand Down
52 changes: 26 additions & 26 deletions pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,33 @@ import (

const (
// Flow table id index
ClassifierTable binding.TableIDType = 0
uplinkTable binding.TableIDType = 5
spoofGuardTable binding.TableIDType = 10
arpResponderTable binding.TableIDType = 20
ipv6Table binding.TableIDType = 21
serviceHairpinTable binding.TableIDType = 29
conntrackTable binding.TableIDType = 30
conntrackStateTable binding.TableIDType = 31
sessionAffinityTable binding.TableIDType = 40
dnatTable binding.TableIDType = 40
serviceLBTable binding.TableIDType = 41
endpointDNATTable binding.TableIDType = 42
AntreaPolicyEgressRuleTable binding.TableIDType = 45
DefaultTierEgressRuleTable binding.TableIDType = 49
EgressRuleTable binding.TableIDType = 50
EgressDefaultTable binding.TableIDType = 60
EgressMetricTable binding.TableIDType = 61
l3ForwardingTable binding.TableIDType = 70
l2ForwardingCalcTable binding.TableIDType = 80
ClassifierTable binding.TableIDType = 0
uplinkTable binding.TableIDType = 5
spoofGuardTable binding.TableIDType = 10
arpResponderTable binding.TableIDType = 20
ipv6Table binding.TableIDType = 21
serviceHairpinTable binding.TableIDType = 29
conntrackTable binding.TableIDType = 30
conntrackStateTable binding.TableIDType = 31
sessionAffinityTable binding.TableIDType = 40
dnatTable binding.TableIDType = 40
serviceLBTable binding.TableIDType = 41
endpointDNATTable binding.TableIDType = 42
AntreaPolicyEgressRuleTable binding.TableIDType = 45
DefaultTierEgressRuleTable binding.TableIDType = 49
EgressRuleTable binding.TableIDType = 50
EgressDefaultTable binding.TableIDType = 60
EgressMetricTable binding.TableIDType = 61
l3ForwardingTable binding.TableIDType = 70
l2ForwardingCalcTable binding.TableIDType = 80
AntreaPolicyIngressRuleTable binding.TableIDType = 85
DefaultTierIngressRuleTable binding.TableIDType = 89
IngressRuleTable binding.TableIDType = 90
IngressDefaultTable binding.TableIDType = 100
IngressMetricTable binding.TableIDType = 101
conntrackCommitTable binding.TableIDType = 105
hairpinSNATTable binding.TableIDType = 106
L2ForwardingOutTable binding.TableIDType = 110
DefaultTierIngressRuleTable binding.TableIDType = 89
IngressRuleTable binding.TableIDType = 90
IngressDefaultTable binding.TableIDType = 100
IngressMetricTable binding.TableIDType = 101
conntrackCommitTable binding.TableIDType = 105
hairpinSNATTable binding.TableIDType = 106
L2ForwardingOutTable binding.TableIDType = 110

// Flow priority level
priorityHigh = uint16(210)
Expand Down
2 changes: 2 additions & 0 deletions pkg/agent/route/route_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func TestRouteOperation(t *testing.T) {
peerNodeIP1 := net.ParseIP("10.0.0.2")
peerNodeIP2 := net.ParseIP("10.0.0.3")
gwIP1 := net.ParseIP("192.168.2.1")
_, podIPv4CIDR, _ := net.ParseCIDR("192.168.1.0/24")
_, destCIDR1, _ := net.ParseCIDR("192.168.2.0/24")
dest2 := "192.168.3.0/24"
gwIP2 := net.ParseIP("192.168.3.1")
Expand All @@ -56,6 +57,7 @@ func TestRouteOperation(t *testing.T) {
client, err := NewClient(serviceCIDR, &config.NetworkConfig{}, false)
require.Nil(t, err)
nodeConfig := &config.NodeConfig{
PodIPv4CIDR: podIPv4CIDR,
GatewayConfig: &config.GatewayConfig{
Name: hostGateway,
LinkIndex: gwLink,
Expand Down
1 change: 1 addition & 0 deletions pkg/ovs/openflow/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ type Flow interface {
OFEntry
// Returns the flow priority associated with OFEntry
FlowPriority() uint16
FlowProtocol() Protocol
MatchString() string
// CopyToBuilder returns a new FlowBuilder that copies the matches of the Flow.
// It copies the original actions of the Flow only if copyActions is set to true, and
Expand Down
4 changes: 4 additions & 0 deletions pkg/ovs/openflow/ofctrl_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func (f *ofFlow) FlowPriority() uint16 {
return f.Match.Priority
}

func (f *ofFlow) FlowProtocol() Protocol {
return f.protocol
}

func (f *ofFlow) GetBundleMessage(entryOper OFOperation) (ofctrl.OpenFlowModMessage, error) {
var operation int
switch entryOper {
Expand Down
14 changes: 14 additions & 0 deletions pkg/ovs/openflow/testing/mock_openflow.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions plugins/octant/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ require (
)

replace (
<<<<<<< HEAD
github.com/contiv/ofnet => github.com/wenyingd/ofnet v0.0.0-20201109024835-6fd225d8c8d1
=======
github.com/contiv/ofnet => github.com/wenyingd/ofnet v0.0.0-20200728094531-d5b4d75f2cc3
>>>>>>> 964affb ([IPv6] Change openflow pipeline for L2 Pod networking (#1040))
github.com/vmware-tanzu/antrea => ../../
// Octant v0.13.1 and Antrea use different versions of github.com/googleapis/gnostic.
// Octant v0.13.1 uses v0.4.1 and Antrea uses v0.1.0.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/agent/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func TestIPv6RoutesAndNeighbors(t *testing.T) {
NodeIPAddr: nodeIP,
GatewayConfig: dualGWConfig,
}
err = routeClient.Initialize(dualNodeConfig)
err = routeClient.Initialize(dualNodeConfig, func() {})
assert.Nil(t, err)

tcs := []struct {
Expand Down

0 comments on commit 289f5ee

Please sign in to comment.