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: The helm command supports runtime selection #1311

Open
wants to merge 1 commit into
base: V5.17
Choose a base branch
from
Open
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
28 changes: 27 additions & 1 deletion src/pages/AddCluster/ACksterList/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable array-callback-return */
/* eslint-disable no-param-reassign */
/* eslint-disable consistent-return */
import { Button, Card, Form, Input, Row, Steps } from 'antd';
import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import Qs from 'qs';
Expand All @@ -20,6 +20,7 @@ const { Step } = Steps;
const dataObj = {
enableHA: false,
gatewayIngressIPs: '',
runtime: 'docker',
imageHub: {
enable: false,
domain: '',
Expand Down Expand Up @@ -141,6 +142,7 @@ export default class ClusterLink extends PureComponent {
if (err) return;
if (values) {
dataObj.gatewayIngressIPs = values.gatewayIngressIPs || '';
dataObj.runtime = values.runtime || '';
dataObj.imageHub.domain = values.domain || '';
dataObj.imageHub.namespace = values.namespace || '';
dataObj.imageHub.username = values.username || '';
Expand Down Expand Up @@ -316,6 +318,30 @@ export default class ClusterLink extends PureComponent {
})(<DAinput />)}
</FormItem>
</Row>
{/* 容器运行时 */}
<Row className={ this.state.language ? styles.antd_row : styles.en_antd_row}>
<div>
<span style={{ fontWeight: 'bold', fontSize: '16px' }}>
容器运行时:
</span>
</div>
<FormItem
{...is_formItemLayout}
className={styles.antd_form}
>
{getFieldDecorator('runtime', {
initialValue: 'docker',
rules: [
{ required: true },
]
})(
<Radio.Group>
<Radio value='docker'>Docker</Radio>
<Radio value='containerd'>Containerd</Radio>
</Radio.Group>
)}
</FormItem>
</Row>
</div>
<Row>
<FormItem className={styles.antd_row_btn}>
Expand Down
3 changes: 3 additions & 0 deletions src/pages/AddCluster/Advanced/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class ClusterLink extends PureComponent {
const routeData = data || {};
const dataObj = {
enableHA: false,
runtime: '',
gatewayIngressIPs: '',
imageHub: {
enable: false,
Expand Down Expand Up @@ -282,6 +283,8 @@ export default class ClusterLink extends PureComponent {
break;
}
// 表单参数
dataObj.runtime =
values.runtime || routeData.runtime || '';
dataObj.gatewayIngressIPs =
values.gatewayIngressIPs || routeData.gatewayIngressIPs || '';
dataObj.nodesForGateway.nodes =
Expand Down
29 changes: 27 additions & 2 deletions src/pages/AddCluster/Aliack/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable array-callback-return */
/* eslint-disable no-param-reassign */
/* eslint-disable consistent-return */
import { Button, Card, Form, Input, Row, Steps } from 'antd';
import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import Qs from 'qs';
Expand All @@ -20,6 +20,7 @@ const FormItem = Form.Item;
const { Step } = Steps;
const dataObj = {
enableHA: true,
runtime: 'docker',
gatewayIngressIPs: '',
imageHub: {
enable: false,
Expand Down Expand Up @@ -149,7 +150,7 @@ export default class ClusterLink extends PureComponent {
}else{
dataObj.imageHub.enable = false;
}

dataObj.runtime = values.runtime || '';
dataObj.imageHub.domain = values.domain || '';
dataObj.imageHub.namespace = values.namespace || '';
dataObj.imageHub.username = values.username || '';
Expand Down Expand Up @@ -372,6 +373,30 @@ handleValidatorsGateway = (_, val, callback) => {
})(<DAinput />)}
</FormItem>
</Row>
{/* 容器运行时 */}
<Row className={ language ? styles.antd_row : styles.en_antd_row}>
<div>
<span style={{ fontWeight: 'bold', fontSize: '16px' }}>
容器运行时:
</span>
</div>
<FormItem
{...formItemLayout}
className={styles.antd_form}
>
{getFieldDecorator('runtime', {
initialValue: 'docker',
rules: [
{ required: true },
]
})(
<Radio.Group>
<Radio value='docker'>Docker</Radio>
<Radio value='containerd'>Containerd</Radio>
</Radio.Group>
)}
</FormItem>
</Row>
<Row className={styles.antd_rows}>
<div className={styles.titleBox}>
<div className={styles.title}>
Expand Down
27 changes: 26 additions & 1 deletion src/pages/AddCluster/HuaweiList/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */
/* eslint-disable consistent-return */
import { Button, Card, Form, Input, Row, Steps } from 'antd';
import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import Qs from 'qs';
Expand All @@ -18,6 +18,7 @@ const FormItem = Form.Item;
const { Step } = Steps;
const dataObj = {
enableHA: true,
runtime: 'docker',
gatewayIngressIPs: '',
imageHub: {
enable: false,
Expand Down Expand Up @@ -153,6 +154,7 @@ export default class ClusterLink extends PureComponent {
if (err) return;

if (values) {
dataObj.runtime = values.runtime || '';
dataObj.gatewayIngressIPs = values.gatewayIngressIPs || '';
dataObj.nodesForGateway.nodes = values.nodesForGateway || [];
// 镜像仓库
Expand Down Expand Up @@ -389,6 +391,29 @@ export default class ClusterLink extends PureComponent {
})(<DAinput />)}
</FormItem>
</Row>
<Row className={ language ? styles.antd_row : styles.en_antd_row}>
<div>
<span style={{ fontWeight: 'bold', fontSize: '16px' }}>
容器运行时:
</span>
</div>
<FormItem
{...formItemLayout}
className={styles.antd_form}
>
{getFieldDecorator('runtime', {
initialValue: 'docker',
rules: [
{ required: true },
]
})(
<Radio.Group>
<Radio value='docker'>Docker</Radio>
<Radio value='containerd'>Containerd</Radio>
</Radio.Group>
)}
</FormItem>
</Row>
<Row className={styles.antd_rows}>
<div className={styles.titleBox}>
<div className={styles.title}>
Expand Down
27 changes: 26 additions & 1 deletion src/pages/AddCluster/TencentList/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */
/* eslint-disable consistent-return */
import { Button, Card, Form, Input, Row, Steps } from 'antd';
import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import Qs from 'qs';
Expand All @@ -18,6 +18,7 @@ const FormItem = Form.Item;
const { Step } = Steps;
const dataObj = {
enableHA: true,
runtime: 'docker',
gatewayIngressIPs: '',
imageHub: {
enable: false,
Expand Down Expand Up @@ -140,6 +141,7 @@ export default class ClusterLink extends PureComponent {
if (err) return;

if (values) {
dataObj.runtime = values.runtime || '';
dataObj.gatewayIngressIPs = values.gatewayIngressIPs || '';
dataObj.nodesForGateway.nodes = values.nodesForGateway || [];
// 镜像仓库
Expand Down Expand Up @@ -362,6 +364,29 @@ export default class ClusterLink extends PureComponent {
})(<DAinput />)}
</FormItem>
</Row>
<Row className={ language ? styles.antd_row : styles.en_antd_row}>
<div>
<span style={{ fontWeight: 'bold', fontSize: '16px' }}>
容器运行时:
</span>
</div>
<FormItem
{...formItemLayout}
className={styles.antd_form}
>
{getFieldDecorator('runtime', {
initialValue: 'docker',
rules: [
{ required: true },
]
})(
<Radio.Group>
<Radio value='docker'>Docker</Radio>
<Radio value='containerd'>Containerd</Radio>
</Radio.Group>
)}
</FormItem>
</Row>
<Row className={styles.antd_rows}>
<div className={styles.titleBox}>
<div className={styles.title}>
Expand Down
1 change: 1 addition & 0 deletions src/services/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export async function fetchHelmCommand(param) {
nodesForChaos: param.data.nodesForChaos,
nodesForGateway: param.data.nodesForGateway,
DockingType:param.data.type,
runtime: param.data.runtime,
appui: false,
cloudserver: param.cloudserver ? param.cloudserver : ''
}
Expand Down
Loading