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

Test netlink 2 #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ require (
sigs.k8s.io/yaml v1.3.0
)

replace github.com/vishvananda/netlink v1.2.1-beta.2 => github.com/vishvananda/netlink v1.2.1-beta.2.0.20240301210615-7f562ed5761f

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/ClickHouse/ch-go v0.51.2 // indirect
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
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/netlink v1.2.1-beta.2.0.20240301210615-7f562ed5761f h1:S+KKqGer+XvUIyY8FNjsWQ6x1SENDSMjDPnGq/dReMs=
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240301210615-7f562ed5761f/go.mod h1:whJevzBpTrid75eZy99s3DqCmy05NfibNaF2Ol5Ox5A=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
Expand Down Expand Up @@ -933,6 +933,7 @@ 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.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ if [ "$MODE" == "dev" ]; then
fi

if $VERBOSE_LOG; then
HELM_VALUES+=("logVerbosity=4")
HELM_VALUES+=("logVerbosity=5")
fi

if $ON_DELETE; then
Expand Down
14 changes: 14 additions & 0 deletions pkg/controller/networkpolicy/networkpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,20 @@ func NewNetworkPolicyController(kubeClient clientset.Interface,
n.grpInformer = grpInformer
n.grpLister = grpInformer.Lister()
n.grpListerSynced = grpInformer.Informer().HasSynced
n.tierInformer.Informer().AddEventHandlerWithResyncPeriod(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
klog.InfoS("Processing Tier ADD event", "tier", obj)
},
UpdateFunc: func(_, obj interface{}) {
klog.InfoS("Processing Tier UPDATE event", "tier", obj)
},
DeleteFunc: func(obj interface{}) {
klog.InfoS("Processing Tier DELETE event", "tier", obj)
},
},
resyncPeriod,
)
// Add handlers for Namespace events.
n.namespaceInformer.Informer().AddEventHandlerWithResyncPeriod(
cache.ResourceEventHandlerFuncs{
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4487,7 +4487,10 @@ func TestAntreaPolicy(t *testing.T) {
// For creation.
t.Run("Case=CreateInvalidACNP", func(t *testing.T) { testCreateValidationInvalidACNP(t) })
t.Run("Case=CreateInvalidANNP", func(t *testing.T) { testCreateValidationInvalidANNP(t) })
t.Run("Case=CreateInvalidTier", func(t *testing.T) { testCreateValidationInvalidTier(t) })
t.Run("Case=CreateInvalidTier", func(t *testing.T) {
defer exportLogs(t, data, "afterCreateInvalidTier", true)
testCreateValidationInvalidTier(t)
})
t.Run("Case=CreateInvalidClusterGroup", func(t *testing.T) { testCreateValidationInvalidCG(t) })
t.Run("Case=CreateInvalidGroup", func(t *testing.T) { testCreateValidationInvalidGroup(t) })

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func exportLogs(tb testing.TB, data *TestData, logsSubDir string, writeNodeLogs
}
// if test was successful and --logs-export-on-success was not provided, we do not export
// any logs.
if !tb.Failed() && !testOptions.logsExportOnSuccess {
if !tb.Failed() && !testOptions.logsExportOnSuccess && logsSubDir != "afterCreateInvalidTier" {
return
}
const timeFormat = "Jan02-15-04-05"
Expand Down
Loading