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
524e70d5
Commit
524e70d5
authored
Jul 08, 2015
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make "age" of pod print example static
parent
56da0be8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
cmd_test.go
pkg/kubectl/cmd/cmd_test.go
+9
-4
No files found.
pkg/kubectl/cmd/cmd_test.go
View file @
524e70d5
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
"os"
"os"
"reflect"
"reflect"
"testing"
"testing"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
...
@@ -35,6 +36,7 @@ import (
...
@@ -35,6 +36,7 @@ import (
cmdutil
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"
cmdutil
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/resource"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/resource"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
type
internalType
struct
{
type
internalType
struct
{
...
@@ -291,8 +293,11 @@ func ExamplePrintPodWithWideFormat() {
...
@@ -291,8 +293,11 @@ func ExamplePrintPodWithWideFormat() {
}
}
nodeName
:=
"kubernetes-minion-abcd"
nodeName
:=
"kubernetes-minion-abcd"
cmd
:=
NewCmdRun
(
f
,
os
.
Stdout
)
cmd
:=
NewCmdRun
(
f
,
os
.
Stdout
)
ctrl
:=
&
api
.
Pod
{
pod
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"test1"
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"test1"
,
CreationTimestamp
:
util
.
Time
{
time
.
Now
()
.
AddDate
(
-
10
,
0
,
0
)},
},
Spec
:
api
.
PodSpec
{
Spec
:
api
.
PodSpec
{
Containers
:
make
([]
api
.
Container
,
2
),
Containers
:
make
([]
api
.
Container
,
2
),
NodeName
:
nodeName
,
NodeName
:
nodeName
,
...
@@ -305,13 +310,13 @@ func ExamplePrintPodWithWideFormat() {
...
@@ -305,13 +310,13 @@ func ExamplePrintPodWithWideFormat() {
},
},
},
},
}
}
err
:=
f
.
PrintObject
(
cmd
,
ctrl
,
os
.
Stdout
)
err
:=
f
.
PrintObject
(
cmd
,
pod
,
os
.
Stdout
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"Unexpected error: %v"
,
err
)
fmt
.
Printf
(
"Unexpected error: %v"
,
err
)
}
}
// Output:
// Output:
// NAME READY STATUS RESTARTS AGE NODE
// NAME READY STATUS RESTARTS AGE NODE
// test1 1/2 podPhase 6
292y
kubernetes-minion-abcd
// test1 1/2 podPhase 6
10y
kubernetes-minion-abcd
}
}
func
TestNormalizationFuncGlobalExistance
(
t
*
testing
.
T
)
{
func
TestNormalizationFuncGlobalExistance
(
t
*
testing
.
T
)
{
...
...
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