Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Kube OVN
Commits
e1038d22
Commit
e1038d22
authored
5 years ago
by
MengxinLiu
Committed by
oilbeater
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: acl and qos issues
parent
79525912
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/daemon/controller.go
+1
-1
pkg/daemon/controller.go
pkg/ovs/ovn-nbctl.go
+3
-1
pkg/ovs/ovn-nbctl.go
with
4 additions
and
2 deletions
+4
-2
pkg/daemon/controller.go
+
1
-
1
View file @
e1038d22
...
...
@@ -337,7 +337,7 @@ func (c *Controller) handlePod(key string) error {
c
.
recorder
.
Eventf
(
pod
,
v1
.
EventTypeWarning
,
"ValidatePodNetworkFailed"
,
err
.
Error
())
return
err
}
return
ovs
.
SetPodBandwidth
(
pod
.
Name
,
pod
.
Namespace
,
pod
.
Annotations
[
util
.
In
gressRateAnnotation
],
pod
.
Annotations
[
util
.
E
gressRateAnnotation
])
return
ovs
.
SetPodBandwidth
(
pod
.
Name
,
pod
.
Namespace
,
pod
.
Annotations
[
util
.
E
gressRateAnnotation
],
pod
.
Annotations
[
util
.
In
gressRateAnnotation
])
}
// Run starts controller
...
...
This diff is collapsed.
Click to expand it.
pkg/ovs/ovn-nbctl.go
+
3
-
1
View file @
e1038d22
...
...
@@ -349,15 +349,17 @@ func (c Client) ResetLogicalSwitchAcl(ls, protocol string) error {
// SetPrivateLogicalSwitch will drop all ingress traffic except allow subnets
func
(
c
Client
)
SetPrivateLogicalSwitch
(
ls
,
protocol
,
cidr
string
,
allow
[]
string
)
error
{
delArgs
:=
[]
string
{
"acl-del"
,
ls
}
allowArgs
:=
[]
string
{}
var
dropArgs
[]
string
if
protocol
==
kubeovnv1
.
ProtocolIPv4
{
dropArgs
=
[]
string
{
"--"
,
"acl-add"
,
ls
,
"to-lport"
,
util
.
DefaultDropPriority
,
fmt
.
Sprintf
(
`ip4.src!=%s || ip4.dst!=%s`
,
cidr
,
cidr
),
"drop"
}
allowArgs
=
append
(
allowArgs
,
"--"
,
"acl-add"
,
ls
,
"to-lport"
,
util
.
NodeAllowPriority
,
fmt
.
Sprintf
(
"ip4.src==%s"
,
c
.
NodeSwitchCIDR
),
"allow-related"
)
}
else
{
dropArgs
=
[]
string
{
"--"
,
"acl-add"
,
ls
,
"to-lport"
,
util
.
DefaultDropPriority
,
fmt
.
Sprintf
(
`ip6.src!=%s || ip6.dst!=%s`
,
cidr
,
cidr
),
"drop"
}
allowArgs
=
append
(
allowArgs
,
"--"
,
"acl-add"
,
ls
,
"to-lport"
,
util
.
NodeAllowPriority
,
fmt
.
Sprintf
(
"ip6.src==%s"
,
c
.
NodeSwitchCIDR
),
"allow-related"
)
}
ovnArgs
:=
append
(
delArgs
,
dropArgs
...
)
allowArgs
:=
[]
string
{}
for
_
,
subnet
:=
range
allow
{
if
strings
.
TrimSpace
(
subnet
)
!=
""
{
var
match
string
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help