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
b7bf26ab
Unverified
Commit
b7bf26ab
authored
Mar 06, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74713 from WanLinghao/duplicate_package
Remove duplicate package import
parents
a8492d74
cb9da96c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
conversion.go
pkg/apis/autoscaling/v1/conversion.go
+7
-8
No files found.
pkg/apis/autoscaling/v1/conversion.go
View file @
b7bf26ab
...
@@ -25,8 +25,7 @@ import (
...
@@ -25,8 +25,7 @@ import (
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/autoscaling"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core"
core
"k8s.io/kubernetes/pkg/apis/core"
)
)
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
error
{
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
error
{
...
@@ -298,7 +297,7 @@ func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(i
...
@@ -298,7 +297,7 @@ func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(i
otherMetrics
:=
make
([]
autoscalingv1
.
MetricSpec
,
0
,
len
(
in
.
Spec
.
Metrics
))
otherMetrics
:=
make
([]
autoscalingv1
.
MetricSpec
,
0
,
len
(
in
.
Spec
.
Metrics
))
for
_
,
metric
:=
range
in
.
Spec
.
Metrics
{
for
_
,
metric
:=
range
in
.
Spec
.
Metrics
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
api
.
ResourceCPU
&&
metric
.
Resource
.
Target
.
AverageUtilization
!=
nil
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
core
.
ResourceCPU
&&
metric
.
Resource
.
Target
.
AverageUtilization
!=
nil
{
continue
continue
}
}
...
@@ -411,7 +410,7 @@ func Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(i
...
@@ -411,7 +410,7 @@ func Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(i
{
{
Type
:
autoscaling
.
ResourceMetricSourceType
,
Type
:
autoscaling
.
ResourceMetricSourceType
,
Resource
:
&
autoscaling
.
ResourceMetricSource
{
Resource
:
&
autoscaling
.
ResourceMetricSource
{
Name
:
api
.
ResourceCPU
,
Name
:
core
.
ResourceCPU
,
Target
:
autoscaling
.
MetricTarget
{
Target
:
autoscaling
.
MetricTarget
{
Type
:
autoscaling
.
UtilizationMetricType
,
Type
:
autoscaling
.
UtilizationMetricType
,
},
},
...
@@ -449,7 +448,7 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscal
...
@@ -449,7 +448,7 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscal
out
.
MaxReplicas
=
in
.
MaxReplicas
out
.
MaxReplicas
=
in
.
MaxReplicas
for
_
,
metric
:=
range
in
.
Metrics
{
for
_
,
metric
:=
range
in
.
Metrics
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
api
.
ResourceCPU
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
core
.
ResourceCPU
{
if
metric
.
Resource
.
Target
.
AverageUtilization
!=
nil
{
if
metric
.
Resource
.
Target
.
AverageUtilization
!=
nil
{
out
.
TargetCPUUtilizationPercentage
=
new
(
int32
)
out
.
TargetCPUUtilizationPercentage
=
new
(
int32
)
*
out
.
TargetCPUUtilizationPercentage
=
*
metric
.
Resource
.
Target
.
AverageUtilization
*
out
.
TargetCPUUtilizationPercentage
=
*
metric
.
Resource
.
Target
.
AverageUtilization
...
@@ -474,7 +473,7 @@ func Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscal
...
@@ -474,7 +473,7 @@ func Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscal
{
{
Type
:
autoscaling
.
ResourceMetricSourceType
,
Type
:
autoscaling
.
ResourceMetricSourceType
,
Resource
:
&
autoscaling
.
ResourceMetricSource
{
Resource
:
&
autoscaling
.
ResourceMetricSource
{
Name
:
api
.
ResourceCPU
,
Name
:
core
.
ResourceCPU
,
Target
:
autoscaling
.
MetricTarget
{
Target
:
autoscaling
.
MetricTarget
{
Type
:
autoscaling
.
UtilizationMetricType
,
Type
:
autoscaling
.
UtilizationMetricType
,
},
},
...
@@ -496,7 +495,7 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutosc
...
@@ -496,7 +495,7 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutosc
out
.
DesiredReplicas
=
in
.
DesiredReplicas
out
.
DesiredReplicas
=
in
.
DesiredReplicas
for
_
,
metric
:=
range
in
.
CurrentMetrics
{
for
_
,
metric
:=
range
in
.
CurrentMetrics
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
api
.
ResourceCPU
{
if
metric
.
Type
==
autoscaling
.
ResourceMetricSourceType
&&
metric
.
Resource
!=
nil
&&
metric
.
Resource
.
Name
==
core
.
ResourceCPU
{
if
metric
.
Resource
.
Current
.
AverageUtilization
!=
nil
{
if
metric
.
Resource
.
Current
.
AverageUtilization
!=
nil
{
out
.
CurrentCPUUtilizationPercentage
=
new
(
int32
)
out
.
CurrentCPUUtilizationPercentage
=
new
(
int32
)
...
@@ -519,7 +518,7 @@ func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutosc
...
@@ -519,7 +518,7 @@ func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutosc
{
{
Type
:
autoscaling
.
ResourceMetricSourceType
,
Type
:
autoscaling
.
ResourceMetricSourceType
,
Resource
:
&
autoscaling
.
ResourceMetricStatus
{
Resource
:
&
autoscaling
.
ResourceMetricStatus
{
Name
:
api
.
ResourceCPU
,
Name
:
core
.
ResourceCPU
,
},
},
},
},
}
}
...
...
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