Skip to content

Commit 96cf491

Browse files
authored
Merge branch 'master' into statelessCNI-ACI
2 parents ee27d1a + c053c17 commit 96cf491

16 files changed

+1056
-452
lines changed

.pipelines/templates/cilium-cli.steps.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
steps:
22
- script: |
33
echo "install cilium CLI"
4-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
4+
if [[ ${CILIUM_VERSION_TAG#v} =~ ^1.1[1-3].[0-9]{1,2}|1.1[1-3].[0-9]{1,2}-[0-9]{1,6} ]]; then
55
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
66
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
7-
elif [[ ${CILIUM_VERSION_TAG} =~ ^1.14.[0-9]{1,2} ]]; then
7+
elif [[ ${CILIUM_VERSION_TAG#v} =~ ^1.1[1-4].[0-9]{1,2}|1.1[1-4].[0-9]{1,2}-[0-9]{1,6} ]]; then
88
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
99
CILIUM_CLI_VERSION=v0.15.22
1010
else

.pipelines/templates/cilium-cli.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
steps:
22
- script: |
33
echo "install cilium CLI"
4-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
4+
if [[ ${CILIUM_VERSION_TAG#v} =~ ^1.1[1-3].[0-9]{1,2}|1.1[1-3].[0-9]{1,2}-[0-9]{1,6} ]]; then
55
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
66
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
7-
elif [[ ${CILIUM_VERSION_TAG} =~ ^1.14.[0-9]{1,2} ]]; then
7+
elif [[ ${CILIUM_VERSION_TAG#v} =~ ^1.1[1-4].[0-9]{1,2}|1.1[1-4].[0-9]{1,2}-[0-9]{1,6} ]]; then
88
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
99
CILIUM_CLI_VERSION=v0.15.22
1010
else

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
4141
golang.org/x/sys v0.26.0
4242
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
43-
google.golang.org/grpc v1.67.1
43+
google.golang.org/grpc v1.68.0
4444
google.golang.org/protobuf v1.35.1
4545
gopkg.in/natefinch/lumberjack.v2 v2.2.1
4646
k8s.io/api v0.30.6
@@ -102,7 +102,7 @@ require (
102102
github.com/valyala/bytebufferpool v1.0.0 // indirect
103103
github.com/valyala/fasttemplate v1.2.2 // indirect
104104
github.com/vishvananda/netlink v1.3.0
105-
github.com/vishvananda/netns v0.0.4
105+
github.com/vishvananda/netns v0.0.5
106106
go.opencensus.io v0.24.0 // indirect
107107
go.uber.org/multierr v1.11.0 // indirect
108108
golang.org/x/crypto v0.28.0
@@ -159,3 +159,5 @@ replace (
159159
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.12.0
160160
github.com/onsi/gomega => github.com/onsi/gomega v1.10.0
161161
)
162+
163+
retract v1.16.15 // typo in the version number.

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
291291
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
292292
github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
293293
github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
294-
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
295294
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
295+
github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=
296+
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
296297
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
297298
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
298299
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -401,8 +402,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
401402
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
402403
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
403404
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
404-
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
405-
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
405+
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
406+
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
406407
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
407408
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
408409
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

npm/iptm/iptm_test.go

Lines changed: 178 additions & 170 deletions
Large diffs are not rendered by default.

npm/pkg/dataplane/dataplane_linux.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package dataplane
22

33
import (
44
"github.com/Azure/azure-container-networking/npm/pkg/dataplane/policies"
5-
"github.com/Azure/azure-container-networking/npm/util"
65
npmerrors "github.com/Azure/azure-container-networking/npm/util/errors"
76
)
87

@@ -21,8 +20,6 @@ func (dp *DataPlane) updatePod(pod *updateNPMPod) error {
2120
}
2221

2322
func (dp *DataPlane) bootupDataPlane() error {
24-
util.DetectIptablesVersion(dp.ioShim)
25-
2623
// It is important to keep order to clean-up ACLs before ipsets. Otherwise we won't be able to delete ipsets referenced by ACLs
2724
if err := dp.policyMgr.Bootup(nil); err != nil {
2825
return npmerrors.ErrorWrapper(npmerrors.BootupDataplane, false, "failed to reset policy dataplane", err)

npm/pkg/dataplane/dataplane_linux_test.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dataplane
22

33
import (
4-
"fmt"
54
"testing"
65
"time"
76

@@ -74,9 +73,6 @@ func TestNetPolInBackgroundUpdatePolicy(t *testing.T) {
7473
calls := append(getBootupTestCalls(), getAddPolicyTestCallsForDP(&testPolicyobj)...)
7574
calls = append(calls, getRemovePolicyTestCallsForDP(&testPolicyobj)...)
7675
calls = append(calls, getAddPolicyTestCallsForDP(&updatedTestPolicyobj)...)
77-
for _, call := range calls {
78-
fmt.Println(call)
79-
}
8076
ioshim := common.NewMockIOShim(calls)
8177
defer ioshim.VerifyCalls(t, calls)
8278
dp, err := NewDataPlane("testnode", ioshim, netpolInBackgroundCfg, nil)
@@ -133,31 +129,31 @@ func TestNetPolInBackgroundFailureToAddFirstTime(t *testing.T) {
133129
},
134130
// restore will try twice per pMgr.AddPolicies() call
135131
testutils.TestCmd{
136-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
132+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
137133
ExitCode: 1,
138134
},
139135
testutils.TestCmd{
140-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
136+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
141137
ExitCode: 1,
142138
},
143139
// first policy succeeds
144140
testutils.TestCmd{
145-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
141+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
146142
ExitCode: 0,
147143
},
148144
// second policy succeeds
149145
testutils.TestCmd{
150-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
146+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
151147
ExitCode: 0,
152148
},
153149
// third policy fails
154150
// restore will try twice per pMgr.AddPolicies() call
155151
testutils.TestCmd{
156-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
152+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
157153
ExitCode: 1,
158154
},
159155
testutils.TestCmd{
160-
Cmd: []string{"iptables-restore", "-w", "60", "-T", "filter", "--noflush"},
156+
Cmd: []string{"iptables-nft-restore", "-w", "60", "-T", "filter", "--noflush"},
161157
ExitCode: 1,
162158
},
163159
)

npm/pkg/dataplane/dataplane_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dataplane
22

33
import (
4-
"fmt"
54
"testing"
65

76
"github.com/Azure/azure-container-networking/common"
@@ -262,9 +261,6 @@ func TestUpdatePolicy(t *testing.T) {
262261
calls := append(getBootupTestCalls(), getAddPolicyTestCallsForDP(&testPolicyobj)...)
263262
calls = append(calls, getRemovePolicyTestCallsForDP(&testPolicyobj)...)
264263
calls = append(calls, getAddPolicyTestCallsForDP(&updatedTestPolicyobj)...)
265-
for _, call := range calls {
266-
fmt.Println(call)
267-
}
268264
ioshim := common.NewMockIOShim(calls)
269265
defer ioshim.VerifyCalls(t, calls)
270266
dp, err := NewDataPlane("testnode", ioshim, dpCfg, nil)
@@ -420,7 +416,7 @@ func TestUpdatePodCache(t *testing.T) {
420416
}
421417

422418
func getBootupTestCalls() []testutils.TestCmd {
423-
return append(policies.GetBootupTestCalls(true), ipsets.GetResetTestCalls()...)
419+
return append(policies.GetBootupTestCalls(), ipsets.GetResetTestCalls()...)
424420
}
425421

426422
func getAddPolicyTestCallsForDP(networkPolicy *policies.NPMNetworkPolicy) []testutils.TestCmd {

npm/pkg/dataplane/parse/parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestParseIptablesObjectFileV2(t *testing.T) {
3030

3131
func TestParseIptablesObject(t *testing.T) {
3232
calls := []testutils.TestCmd{
33-
{Cmd: []string{"iptables-save", "-t", "filter"}},
33+
{Cmd: []string{"iptables-nft-save", "-t", "filter"}},
3434
}
3535

3636
parser := IPTablesParser{

0 commit comments

Comments
 (0)