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
d003550b
Commit
d003550b
authored
Feb 26, 2018
by
Beata Skiba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Differentiate between target and target average value
parent
afe17246
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
describe.go
pkg/printers/internalversion/describe.go
+2
-2
printers.go
pkg/printers/internalversion/printers.go
+1
-1
printers_test.go
pkg/printers/internalversion/printers_test.go
+2
-2
No files found.
pkg/printers/internalversion/describe.go
View file @
d003550b
...
@@ -2830,13 +2830,13 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
...
@@ -2830,13 +2830,13 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentAverageValue
!=
nil
{
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentAverageValue
!=
nil
{
current
=
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentAverageValue
.
String
()
current
=
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentAverageValue
.
String
()
}
}
w
.
Write
(
LEVEL_1
,
"%q:
\t
%s / %s
\n
"
,
metric
.
External
.
MetricName
,
current
,
metric
.
External
.
TargetAverageValue
.
String
())
w
.
Write
(
LEVEL_1
,
"%q
(target average value)
:
\t
%s / %s
\n
"
,
metric
.
External
.
MetricName
,
current
,
metric
.
External
.
TargetAverageValue
.
String
())
}
else
{
}
else
{
current
:=
"<unknown>"
current
:=
"<unknown>"
if
len
(
hpa
.
Status
.
CurrentMetrics
)
>
i
&&
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
!=
nil
{
if
len
(
hpa
.
Status
.
CurrentMetrics
)
>
i
&&
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
!=
nil
{
current
=
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentValue
.
String
()
current
=
hpa
.
Status
.
CurrentMetrics
[
i
]
.
External
.
CurrentValue
.
String
()
}
}
w
.
Write
(
LEVEL_1
,
"%q:
\t
%s / %s
\n
"
,
metric
.
External
.
MetricName
,
current
,
metric
.
External
.
TargetValue
.
String
())
w
.
Write
(
LEVEL_1
,
"%q
(target value)
:
\t
%s / %s
\n
"
,
metric
.
External
.
MetricName
,
current
,
metric
.
External
.
TargetValue
.
String
())
}
}
case
autoscaling
.
PodsMetricSourceType
:
case
autoscaling
.
PodsMetricSourceType
:
...
...
pkg/printers/internalversion/printers.go
View file @
d003550b
...
@@ -1497,7 +1497,7 @@ func formatHPAMetrics(specs []autoscaling.MetricSpec, statuses []autoscaling.Met
...
@@ -1497,7 +1497,7 @@ func formatHPAMetrics(specs []autoscaling.MetricSpec, statuses []autoscaling.Met
if
len
(
statuses
)
>
i
&&
statuses
[
i
]
.
External
!=
nil
&&
statuses
[
i
]
.
External
.
CurrentAverageValue
!=
nil
{
if
len
(
statuses
)
>
i
&&
statuses
[
i
]
.
External
!=
nil
&&
statuses
[
i
]
.
External
.
CurrentAverageValue
!=
nil
{
current
=
statuses
[
i
]
.
External
.
CurrentAverageValue
.
String
()
current
=
statuses
[
i
]
.
External
.
CurrentAverageValue
.
String
()
}
}
list
=
append
(
list
,
fmt
.
Sprintf
(
"%s/%s"
,
current
,
spec
.
External
.
TargetAverageValue
.
String
()))
list
=
append
(
list
,
fmt
.
Sprintf
(
"%s/%s
(avg)
"
,
current
,
spec
.
External
.
TargetAverageValue
.
String
()))
}
else
{
}
else
{
current
:=
"<unknown>"
current
:=
"<unknown>"
if
len
(
statuses
)
>
i
&&
statuses
[
i
]
.
External
!=
nil
{
if
len
(
statuses
)
>
i
&&
statuses
[
i
]
.
External
!=
nil
{
...
...
pkg/printers/internalversion/printers_test.go
View file @
d003550b
...
@@ -2200,7 +2200,7 @@ func TestPrintHPA(t *testing.T) {
...
@@ -2200,7 +2200,7 @@ func TestPrintHPA(t *testing.T) {
DesiredReplicas
:
5
,
DesiredReplicas
:
5
,
},
},
},
},
"some-hpa
\t
ReplicationController/some-rc
\t
<unknown>/100m
\t
2
\t
10
\t
4
\t
<unknown>
\n
"
,
"some-hpa
\t
ReplicationController/some-rc
\t
<unknown>/100m
(avg)
\t
2
\t
10
\t
4
\t
<unknown>
\n
"
,
},
},
// external source type, target average value
// external source type, target average value
{
{
...
@@ -2247,7 +2247,7 @@ func TestPrintHPA(t *testing.T) {
...
@@ -2247,7 +2247,7 @@ func TestPrintHPA(t *testing.T) {
},
},
},
},
},
},
"some-hpa
\t
ReplicationController/some-rc
\t
50m/100m
\t
2
\t
10
\t
4
\t
<unknown>
\n
"
,
"some-hpa
\t
ReplicationController/some-rc
\t
50m/100m
(avg)
\t
2
\t
10
\t
4
\t
<unknown>
\n
"
,
},
},
// external source type, target value (no current)
// external source type, target value (no current)
{
{
...
...
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