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
7de2d51f
Commit
7de2d51f
authored
Feb 21, 2017
by
JulienBalestra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt rkt.go, rkt_test.go
parent
89e1382d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
rkt.go
pkg/kubelet/rkt/rkt.go
+3
-3
rkt_test.go
pkg/kubelet/rkt/rkt_test.go
+4
-5
No files found.
pkg/kubelet/rkt/rkt.go
View file @
7de2d51f
...
...
@@ -1111,10 +1111,10 @@ func (r *Runtime) getSelinuxContext(opt *v1.SELinuxOptions) (string, error) {
// From the generateName or the podName return a basename for improving the logging with the Journal
// journalctl -t podBaseName
func
constructSyslogIdentifier
(
generateName
string
,
podName
string
)
string
{
if
(
len
(
generateName
)
>
1
&&
generateName
[
len
(
generateName
)
-
1
]
==
'-'
)
{
return
generateName
[
0
:
len
(
generateName
)
-
1
]
if
len
(
generateName
)
>
1
&&
generateName
[
len
(
generateName
)
-
1
]
==
'-'
{
return
generateName
[
0
:
len
(
generateName
)
-
1
]
}
if
(
len
(
generateName
)
>
0
)
{
if
len
(
generateName
)
>
0
{
return
generateName
}
return
podName
...
...
pkg/kubelet/rkt/rkt_test.go
View file @
7de2d51f
...
...
@@ -1955,9 +1955,9 @@ func TestPreparePodArgs(t *testing.T) {
func
TestConstructSyslogIdentifier
(
t
*
testing
.
T
)
{
testCases
:=
[]
struct
{
podName
string
podGenerateName
string
identifier
string
podName
string
podGenerateName
string
identifier
string
}{
{
"prometheus-node-exporter-rv90m"
,
...
...
@@ -1979,4 +1979,4 @@ func TestConstructSyslogIdentifier(t *testing.T) {
identifier
:=
constructSyslogIdentifier
(
testCase
.
podGenerateName
,
testCase
.
podName
)
assert
.
Equal
(
t
,
testCase
.
identifier
,
identifier
,
fmt
.
Sprintf
(
"Test case #%d"
,
i
))
}
}
\ No newline at end of file
}
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