Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3921ac9d
Commit
3921ac9d
authored
Nov 01, 2017
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Describe PolicyTypes for Network Policy.
parent
1aaac98e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
describe.go
pkg/printers/internalversion/describe.go
+1
-0
describe_test.go
pkg/printers/internalversion/describe_test.go
+2
-0
No files found.
pkg/printers/internalversion/describe.go
View file @
3921ac9d
...
@@ -3116,6 +3116,7 @@ func describeNetworkPolicySpec(nps networking.NetworkPolicySpec, w PrefixWriter)
...
@@ -3116,6 +3116,7 @@ func describeNetworkPolicySpec(nps networking.NetworkPolicySpec, w PrefixWriter)
printNetworkPolicySpecIngressFrom
(
nps
.
Ingress
,
" "
,
w
)
printNetworkPolicySpecIngressFrom
(
nps
.
Ingress
,
" "
,
w
)
w
.
Write
(
LEVEL_1
,
"Allowing egress traffic:
\n
"
)
w
.
Write
(
LEVEL_1
,
"Allowing egress traffic:
\n
"
)
printNetworkPolicySpecEgressTo
(
nps
.
Egress
,
" "
,
w
)
printNetworkPolicySpecEgressTo
(
nps
.
Egress
,
" "
,
w
)
w
.
Write
(
LEVEL_1
,
"Policy Types: %v
\n
"
,
nps
.
PolicyTypes
)
}
}
func
printNetworkPolicySpecIngressFrom
(
npirs
[]
networking
.
NetworkPolicyIngressRule
,
initialIndent
string
,
w
PrefixWriter
)
{
func
printNetworkPolicySpecIngressFrom
(
npirs
[]
networking
.
NetworkPolicyIngressRule
,
initialIndent
string
,
w
PrefixWriter
)
{
...
...
pkg/printers/internalversion/describe_test.go
View file @
3921ac9d
...
@@ -1682,6 +1682,7 @@ Spec:
...
@@ -1682,6 +1682,7 @@ Spec:
----------
----------
From Port: <any> (traffic allowed to all ports)
From Port: <any> (traffic allowed to all ports)
To: <any> (traffic not restricted by source)
To: <any> (traffic not restricted by source)
Policy Types: [Ingress Egress]
`
`
port80
:=
intstr
.
FromInt
(
80
)
port80
:=
intstr
.
FromInt
(
80
)
...
@@ -1793,6 +1794,7 @@ Spec:
...
@@ -1793,6 +1794,7 @@ Spec:
},
},
{},
{},
},
},
PolicyTypes
:
[]
networking
.
PolicyType
{
networking
.
PolicyTypeIngress
,
networking
.
PolicyTypeEgress
},
},
},
})
})
d
:=
NetworkPolicyDescriber
{
versionedFake
}
d
:=
NetworkPolicyDescriber
{
versionedFake
}
...
...
Write
Preview
Markdown
is supported
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