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
fda73c04
Commit
fda73c04
authored
Dec 07, 2015
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change to include UID by default in formatting
parent
33eda2ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
pod.go
pkg/kubelet/util/format/pod.go
+4
-12
No files found.
pkg/kubelet/util/format/pod.go
View file @
fda73c04
...
...
@@ -25,26 +25,18 @@ import (
type
podHandler
func
(
*
api
.
Pod
)
string
// Pod returns a string representating a pod in a human readable
// format. This function currently is the same as GetPodFullName in
// kubelet/containers, but may differ in the future. As opposed to
// GetPodFullName, this function is mainly used for logging.
// Pod returns a string reprenetating a pod in a human readable format,
// with pod UID as part of the string.
func
Pod
(
pod
*
api
.
Pod
)
string
{
// Use underscore as the delimiter because it is not allowed in pod name
// (DNS subdomain format), while allowed in the container name format.
return
fmt
.
Sprintf
(
"%s_%s"
,
pod
.
Name
,
pod
.
Namespace
)
}
// PodWithUID returns a string reprenetating a pod in a human readable format,
// with pod UID as part of the string.
func
PodWithUID
(
pod
*
api
.
Pod
)
string
{
return
fmt
.
Sprintf
(
"%s(%s)"
,
Pod
(
pod
),
pod
.
UID
)
return
fmt
.
Sprintf
(
"%s_%s(%s)"
,
pod
.
Name
,
pod
.
Namespace
,
pod
.
UID
)
}
// Pods returns a string representating a list of pods in a human
// readable format.
func
Pods
(
pods
[]
*
api
.
Pod
)
string
{
return
aggregatePods
(
pods
,
Pod
WithUID
)
return
aggregatePods
(
pods
,
Pod
)
}
func
aggregatePods
(
pods
[]
*
api
.
Pod
,
handler
podHandler
)
string
{
...
...
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