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
429fe2ab
Commit
429fe2ab
authored
Sep 18, 2018
by
Mike Dame
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update custom metrics conversion functions
parent
9d8c9cc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
conversion.go
....io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go
+27
-0
No files found.
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go
View file @
429fe2ab
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
v1beta1
package
v1beta1
import
(
import
(
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/metrics/pkg/apis/custom_metrics"
"k8s.io/metrics/pkg/apis/custom_metrics"
...
@@ -36,12 +37,38 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
...
@@ -36,12 +37,38 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
}
}
func
Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue
(
in
*
MetricValue
,
out
*
custom_metrics
.
MetricValue
,
s
conversion
.
Scope
)
error
{
func
Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue
(
in
*
MetricValue
,
out
*
custom_metrics
.
MetricValue
,
s
conversion
.
Scope
)
error
{
out
.
TypeMeta
=
in
.
TypeMeta
out
.
DescribedObject
=
custom_metrics
.
ObjectReference
{
Kind
:
in
.
DescribedObject
.
Kind
,
Namespace
:
in
.
DescribedObject
.
Namespace
,
Name
:
in
.
DescribedObject
.
Name
,
UID
:
in
.
DescribedObject
.
UID
,
APIVersion
:
in
.
DescribedObject
.
APIVersion
,
ResourceVersion
:
in
.
DescribedObject
.
ResourceVersion
,
FieldPath
:
in
.
DescribedObject
.
FieldPath
,
}
out
.
Timestamp
=
in
.
Timestamp
out
.
WindowSeconds
=
in
.
WindowSeconds
out
.
Value
=
in
.
Value
out
.
Metric
.
Name
=
in
.
MetricName
out
.
Metric
.
Name
=
in
.
MetricName
out
.
Metric
.
Selector
=
in
.
Selector
out
.
Metric
.
Selector
=
in
.
Selector
return
nil
return
nil
}
}
func
Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue
(
in
*
custom_metrics
.
MetricValue
,
out
*
MetricValue
,
s
conversion
.
Scope
)
error
{
func
Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue
(
in
*
custom_metrics
.
MetricValue
,
out
*
MetricValue
,
s
conversion
.
Scope
)
error
{
out
.
TypeMeta
=
in
.
TypeMeta
out
.
DescribedObject
=
v1
.
ObjectReference
{
Kind
:
in
.
DescribedObject
.
Kind
,
Namespace
:
in
.
DescribedObject
.
Namespace
,
Name
:
in
.
DescribedObject
.
Name
,
UID
:
in
.
DescribedObject
.
UID
,
APIVersion
:
in
.
DescribedObject
.
APIVersion
,
ResourceVersion
:
in
.
DescribedObject
.
ResourceVersion
,
FieldPath
:
in
.
DescribedObject
.
FieldPath
,
}
out
.
Timestamp
=
in
.
Timestamp
out
.
WindowSeconds
=
in
.
WindowSeconds
out
.
Value
=
in
.
Value
out
.
MetricName
=
in
.
Metric
.
Name
out
.
MetricName
=
in
.
Metric
.
Name
out
.
Selector
=
in
.
Metric
.
Selector
out
.
Selector
=
in
.
Metric
.
Selector
return
nil
return
nil
...
...
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