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
dc873efc
Commit
dc873efc
authored
Jan 30, 2018
by
YuxiJin-tobeyjin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add-ut-for-legacyLogSymlink
parent
2f4cca73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
legacy_test.go
pkg/kubelet/kuberuntime/legacy_test.go
+11
-0
No files found.
pkg/kubelet/kuberuntime/legacy_test.go
View file @
dc873efc
...
...
@@ -45,3 +45,14 @@ func TestLogSymLink(t *testing.T) {
expectedPath
:=
path
.
Join
(
containerLogsDir
,
fmt
.
Sprintf
(
"%s_%s-%s"
,
podFullName
,
containerName
,
dockerId
)[
:
251
]
+
".log"
)
as
.
Equal
(
expectedPath
,
logSymlink
(
containerLogsDir
,
podFullName
,
containerName
,
dockerId
))
}
func
TestLegacyLogSymLink
(
t
*
testing
.
T
)
{
as
:=
assert
.
New
(
t
)
containerID
:=
randStringBytes
(
80
)
containerName
:=
randStringBytes
(
70
)
podName
:=
randStringBytes
(
128
)
podNamespace
:=
randStringBytes
(
10
)
// The file name cannot exceed 255 characters. Since .log suffix is required, the prefix cannot exceed 251 characters.
expectedPath
:=
path
.
Join
(
legacyContainerLogsDir
,
fmt
.
Sprintf
(
"%s_%s_%s-%s"
,
podName
,
podNamespace
,
containerName
,
containerID
)[
:
251
]
+
".log"
)
as
.
Equal
(
expectedPath
,
legacyLogSymlink
(
containerID
,
containerName
,
podName
,
podNamespace
))
}
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