Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: No termination seconds in multi project (#1001) #4207

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
],
}
Loading