Skip to content

Commit

Permalink
fix: No termination seconds in multi project (#1001)
Browse files Browse the repository at this point in the history
Signed-off-by: TheYoungManLi <[email protected]>
  • Loading branch information
weili520 authored and yazhouio committed Oct 18, 2023
1 parent 26f69cc commit 40ff9ec
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import TerminationSecondsForm from 'components/Forms/Workload/ContainerSettings/

class TerminationSeconds extends React.Component {
render() {
const { formTemplate, formRef, formProps } = this.props
const { formTemplate, formRef, formProps, isFederated } = this.props

return (
<div className="margin-t12">
Expand All @@ -34,7 +34,7 @@ class TerminationSeconds extends React.Component {
keepDataWhenUnCheck
checkable
>
<TerminationSecondsForm />
<TerminationSecondsForm isFederated={isFederated} />
</Form.Group>
</Form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ import { NumberInput } from 'components/Inputs'

export default class TerminationSeconds extends React.Component {
get prefix() {
return this.props.prefix || 'spec.template.'
const { isFederated, prefix } = this.props

return (
prefix ||
(isFederated ? 'spec.template.spec.template.' : 'spec.template.')
)
}

render() {
Expand Down
13 changes: 13 additions & 0 deletions src/pages/fedprojects/components/ConfigTemplate/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import VolumeSettings from 'components/EditForms/Workload/VolumeSettings'
import Affinity from 'components/EditForms/Workload/Affinity'
import ServiceSetting from 'fedprojects/components/ServiceSetting'
import ClusterDiffSettings from 'fedprojects/components/ClusterDiffSettings'
import TerminationSeconds from 'components/EditForms/Workload/TerminationSeconds'

export default {
deployments: [
Expand Down Expand Up @@ -49,6 +50,12 @@ export default {
title: 'POD_SCHEDULING_RULES',
component: Affinity,
},
{
icon: 'forbid-right-duotone',
name: 'podMode',
title: 'POD_GRACE_PERIOD',
component: TerminationSeconds,
},
{
title: 'CLUSTER_DIFF',
icon: 'blue-green-deployment',
Expand All @@ -69,6 +76,12 @@ export default {
title: 'CONTAINER_PL',
component: PodTemplate,
},
{
icon: 'forbid-right-duotone',
name: 'podMode',
title: 'POD_GRACE_PERIOD',
component: TerminationSeconds,
},
{
icon: 'storage',
name: 'volumeSettings',
Expand Down
12 changes: 12 additions & 0 deletions src/pages/projects/components/Modals/ConfigTemplate/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export default {
title: 'CONTAINER_PL',
component: PodTemplate,
},
{
icon: 'forbid-right-duotone',
name: 'podMode',
title: 'POD_GRACE_PERIOD',
component: TerminationSeconds,
},
{
icon: 'storage',
name: 'volumeSettings',
Expand All @@ -101,5 +107,11 @@ export default {
title: 'STORAGE',
component: VolumeSettings,
},
{
icon: 'forbid-right-duotone',
name: 'podMode',
title: 'POD_GRACE_PERIOD',
component: TerminationSeconds,
},
],
}

0 comments on commit 40ff9ec

Please sign in to comment.