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
411128f2
Commit
411128f2
authored
Dec 13, 2016
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove wrongly committed files
parent
d5055d49
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
266 deletions
+0
-266
horizontal_test.go.orig
pkg/controller/podautoscaler/horizontal_test.go.orig
+0
-0
horizontal_test.go.rej
pkg/controller/podautoscaler/horizontal_test.go.rej
+0
-11
replica_calculator_test.go.orig
pkg/controller/podautoscaler/replica_calculator_test.go.orig
+0
-0
replica_calculator_test.go.rej
pkg/controller/podautoscaler/replica_calculator_test.go.rej
+0
-11
top_test.go.orig
pkg/kubectl/cmd/top_test.go.orig
+0
-192
top_test.go.rej
pkg/kubectl/cmd/top_test.go.rej
+0
-52
No files found.
pkg/controller/podautoscaler/horizontal_test.go.orig
deleted
100644 → 0
View file @
d5055d49
This diff is collapsed.
Click to expand it.
pkg/controller/podautoscaler/horizontal_test.go.rej
deleted
100644 → 0
View file @
d5055d49
--- pkg/controller/podautoscaler/horizontal_test.go
+++ pkg/controller/podautoscaler/horizontal_test.go
@@ -306,7 +307,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
Namespace: namespace,
},
- Timestamp: metav1.Time{Time: time.Now()},
+ Timestamp: unversioned.Time{Time: time.Now()},
Containers: []metrics_api.ContainerMetrics{
{
Name: "container",
pkg/controller/podautoscaler/replica_calculator_test.go.orig
deleted
100644 → 0
View file @
d5055d49
This diff is collapsed.
Click to expand it.
pkg/controller/podautoscaler/replica_calculator_test.go.rej
deleted
100644 → 0
View file @
d5055d49
--- pkg/controller/podautoscaler/replica_calculator_test.go
+++ pkg/controller/podautoscaler/replica_calculator_test.go
@@ -139,7 +140,7 @@ func (tc *replicaCalcTestCase) prepareTestClient(t *testing.T) *fake.Clientset {
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
Namespace: testNamespace,
},
- Timestamp: metav1.Time{Time: tc.timestamp},
+ Timestamp: unversioned.Time{Time: tc.timestamp},
Containers: []metrics_api.ContainerMetrics{
{
Name: "container1",
pkg/kubectl/cmd/top_test.go.orig
deleted
100644 → 0
View file @
d5055d49
/*
Copyright
2016
The
Kubernetes
Authors
.
Licensed
under
the
Apache
License
,
Version
2.0
(
the
"License"
);
you
may
not
use
this
file
except
in
compliance
with
the
License
.
You
may
obtain
a
copy
of
the
License
at
http
://
www
.
apache
.
org
/
licenses
/
LICENSE
-
2.0
Unless
required
by
applicable
law
or
agreed
to
in
writing
,
software
distributed
under
the
License
is
distributed
on
an
"AS IS"
BASIS
,
WITHOUT
WARRANTIES
OR
CONDITIONS
OF
ANY
KIND
,
either
express
or
implied
.
See
the
License
for
the
specific
language
governing
permissions
and
limitations
under
the
License
.
*/
package
cmd
import
(
"bytes"
"encoding/json"
"io"
"io/ioutil"
"time"
"testing"
metricsapi
"k8s.io/heapster/metrics/apis/metrics/v1alpha1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
metav1
"k8s.io/kubernetes/pkg/apis/meta/v1"
v1
"k8s.io/kubernetes/pkg/api/v1"
cmdtesting
"k8s.io/kubernetes/pkg/kubectl/cmd/testing"
)
const
(
baseHeapsterServiceAddress
=
"/api/v1/proxy/namespaces/kube-system/services/http:heapster:"
baseMetricsAddress
=
baseHeapsterServiceAddress
+
"/apis/metrics"
metricsApiVersion
=
"v1alpha1"
)
func
TestTopSubcommandsExist
(
t
*
testing
.
T
)
{
initTestErrorHandler
(
t
)
f
,
_
,
_
,
_
:=
cmdtesting
.
NewAPIFactory
()
buf
:=
bytes
.
NewBuffer
([]
byte
{})
cmd
:=
NewCmdTop
(
f
,
buf
,
buf
)
if
!cmd.HasSubCommands() {
t
.
Error
(
"top command should have subcommands"
)
}
}
func
marshallBody
(
metrics
interface
{})
(
io
.
ReadCloser
,
error
)
{
result
,
err
:=
json
.
Marshal
(
metrics
)
if
err
!= nil {
return
nil
,
err
}
return
ioutil
.
NopCloser
(
bytes
.
NewReader
(
result
)),
nil
}
func
testNodeMetricsData
()
(*
metricsapi
.
NodeMetricsList
,
*
api
.
NodeList
)
{
metrics
:=
&
metricsapi
.
NodeMetricsList
{
ListMeta
:
metav1
.
ListMeta
{
ResourceVersion
:
"1"
,
},
Items
:
[]
metricsapi
.
NodeMetrics
{
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"node1"
,
ResourceVersion
:
"10"
},
Window
:
metav1
.
Duration
{
Duration
:
time
.
Minute
},
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
1
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
2
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
3
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"node2"
,
ResourceVersion
:
"11"
},
Window
:
metav1
.
Duration
{
Duration
:
time
.
Minute
},
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
5
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
6
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
7
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
}
nodes
:=
&
api
.
NodeList
{
ListMeta
:
metav1
.
ListMeta
{
ResourceVersion
:
"15"
,
},
Items
:
[]
api
.
Node
{
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"node1"
,
ResourceVersion
:
"10"
},
Status
:
api
.
NodeStatus
{
Allocatable
:
api
.
ResourceList
{
api
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
10
,
resource
.
DecimalSI
),
api
.
ResourceMemory
:
*
resource
.
NewQuantity
(
20
*(
1024
*
1024
),
resource
.
DecimalSI
),
api
.
ResourceStorage
:
*
resource
.
NewQuantity
(
30
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"node2"
,
ResourceVersion
:
"11"
},
Status
:
api
.
NodeStatus
{
Allocatable
:
api
.
ResourceList
{
api
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
50
,
resource
.
DecimalSI
),
api
.
ResourceMemory
:
*
resource
.
NewQuantity
(
60
*(
1024
*
1024
),
resource
.
DecimalSI
),
api
.
ResourceStorage
:
*
resource
.
NewQuantity
(
70
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
},
}
return
metrics
,
nodes
}
func
testPodMetricsData
()
*
metricsapi
.
PodMetricsList
{
return
&
metricsapi
.
PodMetricsList
{
ListMeta
:
metav1
.
ListMeta
{
ResourceVersion
:
"2"
,
},
Items
:
[]
metricsapi
.
PodMetrics
{
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod1"
,
Namespace
:
"test"
,
ResourceVersion
:
"10"
},
Window
:
metav1
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
Name
:
"container1-1"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
1
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
2
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
3
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
{
Name
:
"container1-2"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
4
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
5
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
6
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod2"
,
Namespace
:
"test"
,
ResourceVersion
:
"11"
},
Window
:
metav1
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
Name
:
"container2-1"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
7
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
8
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
9
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
{
Name
:
"container2-2"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
10
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
11
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
12
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
{
Name
:
"container2-3"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
13
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
14
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
15
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
},
{
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
"pod3"
,
Namespace
:
"test"
,
ResourceVersion
:
"12"
},
Window
:
metav1
.
Duration
{
Duration
:
time
.
Minute
},
Containers
:
[]
metricsapi
.
ContainerMetrics
{
{
Name
:
"container3-1"
,
Usage
:
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
7
,
resource
.
DecimalSI
),
v1
.
ResourceMemory
:
*
resource
.
NewQuantity
(
8
*(
1024
*
1024
),
resource
.
DecimalSI
),
v1
.
ResourceStorage
:
*
resource
.
NewQuantity
(
9
*(
1024
*
1024
),
resource
.
DecimalSI
),
},
},
},
},
},
}
}
pkg/kubectl/cmd/top_test.go.rej
deleted
100644 → 0
View file @
d5055d49
--- pkg/kubectl/cmd/top_test.go
+++ pkg/kubectl/cmd/top_test.go
@@ -62,13 +63,13 @@ func marshallBody(metrics interface{}) (io.ReadCloser, error) {
func testNodeMetricsData() (*metrics_api.NodeMetricsList, *api.NodeList) {
metrics := &metrics_api.NodeMetricsList{
- ListMeta: metav1.ListMeta{
+ ListMeta: unversioned.ListMeta{
ResourceVersion: "1",
},
Items: []metrics_api.NodeMetrics{
{
ObjectMeta: v1.ObjectMeta{Name: "node1", ResourceVersion: "10"},
- Window: metav1.Duration{Duration: time.Minute},
+ Window: unversioned.Duration{Duration: time.Minute},
Usage: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(1, resource.DecimalSI),
v1.ResourceMemory: *resource.NewQuantity(2*(1024*1024), resource.DecimalSI),
@@ -118,13 +119,13 @@ func testNodeMetricsData() (*metrics_api.NodeMetricsList, *api.NodeList) {
func testPodMetricsData() *metrics_api.PodMetricsList {
return &metrics_api.PodMetricsList{
- ListMeta: metav1.ListMeta{
+ ListMeta: unversioned.ListMeta{
ResourceVersion: "2",
},
Items: []metrics_api.PodMetrics{
{
ObjectMeta: v1.ObjectMeta{Name: "pod1", Namespace: "test", ResourceVersion: "10"},
- Window: metav1.Duration{Duration: time.Minute},
+ Window: unversioned.Duration{Duration: time.Minute},
Containers: []metrics_api.ContainerMetrics{
{
Name: "container1-1",
@@ -146,7 +147,7 @@ func testPodMetricsData() *metrics_api.PodMetricsList {
},
{
ObjectMeta: v1.ObjectMeta{Name: "pod2", Namespace: "test", ResourceVersion: "11"},
- Window: metav1.Duration{Duration: time.Minute},
+ Window: unversioned.Duration{Duration: time.Minute},
Containers: []metrics_api.ContainerMetrics{
{
Name: "container2-1",
@@ -176,7 +177,7 @@ func testPodMetricsData() *metrics_api.PodMetricsList {
},
{
ObjectMeta: v1.ObjectMeta{Name: "pod3", Namespace: "test", ResourceVersion: "12"},
- Window: metav1.Duration{Duration: time.Minute},
+ Window: unversioned.Duration{Duration: time.Minute},
Containers: []metrics_api.ContainerMetrics{
{
Name: "container3-1",
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