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
0fd410c4
Unverified
Commit
0fd410c4
authored
Mar 25, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75486 from misterikkit/metrics-client
Fix fake clientsets in metrics.k8s.io.
parents
9e1cf75b
ab7e2ff1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
10 deletions
+78
-10
BUILD
staging/src/k8s.io/metrics/BUILD
+1
-0
doc.go
staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go
+1
-0
doc.go
staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1/doc.go
+1
-0
fake_nodemetrics.go
...versioned/typed/metrics/v1alpha1/fake/fake_nodemetrics.go
+2
-2
fake_podmetrics.go
.../versioned/typed/metrics/v1alpha1/fake/fake_podmetrics.go
+2
-2
metrics_client.go
...entset/versioned/typed/metrics/v1alpha1/metrics_client.go
+1
-1
fake_nodemetrics.go
.../versioned/typed/metrics/v1beta1/fake/fake_nodemetrics.go
+2
-2
fake_podmetrics.go
...t/versioned/typed/metrics/v1beta1/fake/fake_podmetrics.go
+2
-2
metrics_client.go
...ientset/versioned/typed/metrics/v1beta1/metrics_client.go
+1
-1
BUILD
staging/src/k8s.io/metrics/pkg/client/clientset_test/BUILD
+24
-0
clientset_test.go
...8s.io/metrics/pkg/client/clientset_test/clientset_test.go
+41
-0
No files found.
staging/src/k8s.io/metrics/BUILD
View file @
0fd410c4
...
@@ -13,6 +13,7 @@ filegroup(
...
@@ -13,6 +13,7 @@ filegroup(
"//staging/src/k8s.io/metrics/pkg/apis/external_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/external_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/clientset/versioned:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/clientset/versioned:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/clientset_test:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/custom_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/custom_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/external_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/external_metrics:all-srcs",
],
],
...
...
staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go
View file @
0fd410c4
...
@@ -18,5 +18,6 @@ limitations under the License.
...
@@ -18,5 +18,6 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +k8s:protobuf-gen=package
// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/metrics
// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/metrics
// +k8s:openapi-gen=true
// +k8s:openapi-gen=true
// +groupName=metrics.k8s.io
package
v1alpha1
package
v1alpha1
staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1/doc.go
View file @
0fd410c4
...
@@ -18,5 +18,6 @@ limitations under the License.
...
@@ -18,5 +18,6 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +k8s:protobuf-gen=package
// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/metrics
// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/metrics
// +k8s:openapi-gen=true
// +k8s:openapi-gen=true
// +groupName=metrics.k8s.io
package
v1beta1
package
v1beta1
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1alpha1/fake/fake_nodemetrics.go
View file @
0fd410c4
...
@@ -32,9 +32,9 @@ type FakeNodeMetricses struct {
...
@@ -32,9 +32,9 @@ type FakeNodeMetricses struct {
Fake
*
FakeMetricsV1alpha1
Fake
*
FakeMetricsV1alpha1
}
}
var
nodemetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics"
,
Version
:
"v1alpha1"
,
Resource
:
"nodes"
}
var
nodemetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1alpha1"
,
Resource
:
"nodes"
}
var
nodemetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics"
,
Version
:
"v1alpha1"
,
Kind
:
"NodeMetrics"
}
var
nodemetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1alpha1"
,
Kind
:
"NodeMetrics"
}
// Get takes name of the nodeMetrics, and returns the corresponding nodeMetrics object, and an error if there is any.
// Get takes name of the nodeMetrics, and returns the corresponding nodeMetrics object, and an error if there is any.
func
(
c
*
FakeNodeMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1alpha1
.
NodeMetrics
,
err
error
)
{
func
(
c
*
FakeNodeMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1alpha1
.
NodeMetrics
,
err
error
)
{
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1alpha1/fake/fake_podmetrics.go
View file @
0fd410c4
...
@@ -33,9 +33,9 @@ type FakePodMetricses struct {
...
@@ -33,9 +33,9 @@ type FakePodMetricses struct {
ns
string
ns
string
}
}
var
podmetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics"
,
Version
:
"v1alpha1"
,
Resource
:
"pods"
}
var
podmetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1alpha1"
,
Resource
:
"pods"
}
var
podmetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics"
,
Version
:
"v1alpha1"
,
Kind
:
"PodMetrics"
}
var
podmetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1alpha1"
,
Kind
:
"PodMetrics"
}
// Get takes name of the podMetrics, and returns the corresponding podMetrics object, and an error if there is any.
// Get takes name of the podMetrics, and returns the corresponding podMetrics object, and an error if there is any.
func
(
c
*
FakePodMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1alpha1
.
PodMetrics
,
err
error
)
{
func
(
c
*
FakePodMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1alpha1
.
PodMetrics
,
err
error
)
{
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1alpha1/metrics_client.go
View file @
0fd410c4
...
@@ -31,7 +31,7 @@ type MetricsV1alpha1Interface interface {
...
@@ -31,7 +31,7 @@ type MetricsV1alpha1Interface interface {
PodMetricsesGetter
PodMetricsesGetter
}
}
// MetricsV1alpha1Client is used to interact with features provided by the metrics group.
// MetricsV1alpha1Client is used to interact with features provided by the metrics
.k8s.io
group.
type
MetricsV1alpha1Client
struct
{
type
MetricsV1alpha1Client
struct
{
restClient
rest
.
Interface
restClient
rest
.
Interface
}
}
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1/fake/fake_nodemetrics.go
View file @
0fd410c4
...
@@ -32,9 +32,9 @@ type FakeNodeMetricses struct {
...
@@ -32,9 +32,9 @@ type FakeNodeMetricses struct {
Fake
*
FakeMetricsV1beta1
Fake
*
FakeMetricsV1beta1
}
}
var
nodemetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics"
,
Version
:
"v1beta1"
,
Resource
:
"nodes"
}
var
nodemetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1beta1"
,
Resource
:
"nodes"
}
var
nodemetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics"
,
Version
:
"v1beta1"
,
Kind
:
"NodeMetrics"
}
var
nodemetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1beta1"
,
Kind
:
"NodeMetrics"
}
// Get takes name of the nodeMetrics, and returns the corresponding nodeMetrics object, and an error if there is any.
// Get takes name of the nodeMetrics, and returns the corresponding nodeMetrics object, and an error if there is any.
func
(
c
*
FakeNodeMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1beta1
.
NodeMetrics
,
err
error
)
{
func
(
c
*
FakeNodeMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1beta1
.
NodeMetrics
,
err
error
)
{
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1/fake/fake_podmetrics.go
View file @
0fd410c4
...
@@ -33,9 +33,9 @@ type FakePodMetricses struct {
...
@@ -33,9 +33,9 @@ type FakePodMetricses struct {
ns
string
ns
string
}
}
var
podmetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics"
,
Version
:
"v1beta1"
,
Resource
:
"pods"
}
var
podmetricsesResource
=
schema
.
GroupVersionResource
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1beta1"
,
Resource
:
"pods"
}
var
podmetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics"
,
Version
:
"v1beta1"
,
Kind
:
"PodMetrics"
}
var
podmetricsesKind
=
schema
.
GroupVersionKind
{
Group
:
"metrics
.k8s.io
"
,
Version
:
"v1beta1"
,
Kind
:
"PodMetrics"
}
// Get takes name of the podMetrics, and returns the corresponding podMetrics object, and an error if there is any.
// Get takes name of the podMetrics, and returns the corresponding podMetrics object, and an error if there is any.
func
(
c
*
FakePodMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1beta1
.
PodMetrics
,
err
error
)
{
func
(
c
*
FakePodMetricses
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
v1beta1
.
PodMetrics
,
err
error
)
{
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1/metrics_client.go
View file @
0fd410c4
...
@@ -31,7 +31,7 @@ type MetricsV1beta1Interface interface {
...
@@ -31,7 +31,7 @@ type MetricsV1beta1Interface interface {
PodMetricsesGetter
PodMetricsesGetter
}
}
// MetricsV1beta1Client is used to interact with features provided by the metrics group.
// MetricsV1beta1Client is used to interact with features provided by the metrics
.k8s.io
group.
type
MetricsV1beta1Client
struct
{
type
MetricsV1beta1Client
struct
{
restClient
rest
.
Interface
restClient
rest
.
Interface
}
}
...
...
staging/src/k8s.io/metrics/pkg/client/clientset_test/BUILD
0 → 100644
View file @
0fd410c4
load("@io_bazel_rules_go//go:def.bzl", "go_test")
go_test(
name = "go_default_test",
srcs = ["clientset_test.go"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/client/clientset/versioned/fake:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
staging/src/k8s.io/metrics/pkg/client/clientset_test/clientset_test.go
0 → 100644
View file @
0fd410c4
/*
Copyright 2019 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
clientset_test
import
(
"testing"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/metrics/pkg/client/clientset/versioned/fake"
)
// TestFakeList is a basic sanity check that makes sure the fake Clientset is working properly.
func
TestFakeList
(
t
*
testing
.
T
)
{
client
:=
fake
.
NewSimpleClientset
()
if
_
,
err
:=
client
.
MetricsV1alpha1
()
.
PodMetricses
(
""
)
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
if
_
,
err
:=
client
.
MetricsV1alpha1
()
.
NodeMetricses
()
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
if
_
,
err
:=
client
.
MetricsV1beta1
()
.
PodMetricses
(
""
)
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
if
_
,
err
:=
client
.
MetricsV1beta1
()
.
NodeMetricses
()
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
}
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