Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Headlamp
Commits
b421d261
Commit
b421d261
authored
3 years ago
by
Joaquim Rocha
Browse files
Options
Download
Email Patches
Plain Diff
frontend: Add more info for the Deployments' update strategy
parent
86869775
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/components/workload/Details.tsx
+18
-2
frontend/src/components/workload/Details.tsx
with
18 additions
and
2 deletions
+18
-2
frontend/src/components/workload/Details.tsx
+
18
-
2
View file @
b421d261
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
useTranslation
}
from
'
react-i18next
'
;
import
{
NavLinkProps
,
useLocation
,
useParams
}
from
'
react-router-dom
'
;
import
DetailsViewPluginRenderer
from
'
../../helpers/renderHelpers
'
;
import
{
KubeObject
}
from
'
../../lib/k8s/cluster
'
;
import
{
KubeObject
,
Workload
}
from
'
../../lib/k8s/cluster
'
;
import
{
ConditionsSection
,
ContainersSection
,
...
...
@@ -21,6 +21,22 @@ export default function WorkloadDetails(props: WorkloadDetailsProps) {
const
{
workloadKind
}
=
props
;
const
{
t
}
=
useTranslation
(
'
glossary
'
);
function
renderUpdateStrategy
(
item
:
Workload
)
{
if
(
!
item
?.
spec
?.
strategy
)
{
return
null
;
}
if
(
item
.
spec
.
strategy
.
type
===
'
RollingUpdate
'
)
{
const
rollingUpdate
=
item
.
spec
.
strategy
.
rollingUpdate
;
return
t
(
'
RollingUpdate. Max unavailable: {{ maxUnavailable }}, max surge: {{ maxSurge }}
'
,
{
maxUnavailable
:
rollingUpdate
.
maxUnavailable
,
maxSurge
:
rollingUpdate
.
maxSurge
,
});
}
return
item
.
spec
.
strategy
.
type
;
}
return
(
<
DetailsGrid
resourceType
=
{
workloadKind
}
...
...
@@ -31,7 +47,7 @@ export default function WorkloadDetails(props: WorkloadDetailsProps) {
item
&&
[
{
name
:
t
(
'
Strategy Type
'
),
value
:
item
.
spec
.
strategy
&&
item
.
spec
.
s
trategy
.
type
,
value
:
renderUpdateS
trategy
(
item
)
,
hide
:
!
item
.
spec
.
strategy
,
},
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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