Skip to content

Commit

Permalink
Merge branch 'kubesphere:master' into imagebuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganbingkun authored Oct 18, 2023
2 parents 30cb2e4 + 970fd81 commit f2bd058
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 20 deletions.
7 changes: 4 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# that can be found in the LICENSE file.

# Prepare the build environment
FROM node:12-alpine3.14 as builder
FROM node:14-alpine as builder

ARG YARN_VERSION=1.22.4

WORKDIR /kubesphere
ADD . /kubesphere/

RUN apk add --no-cache --virtual .build-deps ca-certificates python2 python3 py3-pip make openssl g++ bash
RUN apk add --no-cache --virtual python2
RUN apk add --no-cache --virtual .build-deps ca-certificates python3 py3-pip make openssl g++ bash
RUN npm install yarn@${YARN_VERSION}

# If you have trouble downloading the yarn binary, try the following:
Expand All @@ -32,7 +33,7 @@ RUN mv /kubesphere/package.json /out/
##############
# Final Image
##############
FROM node:12-alpine3.14 as base_os_context
FROM node:14-alpine as base_os_context

RUN adduser -D -g kubesphere -u 1002 kubesphere && \
mkdir -p /opt/kubesphere/console && \
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by an Apache license
# that can be found in the LICENSE file.

FROM node:12-alpine3.14
FROM node:14-alpine

RUN adduser -D -g kubesphere -u 1002 kubesphere && \
mkdir -p /opt/kubesphere/console && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ module.exports = {
// Monitoring
USAGE: '用量',
OUT: '出',
IN: '属于'
IN: ''
};
3 changes: 1 addition & 2 deletions src/components/Base/CodeEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ class CodeEditor extends PureComponent {
}

static defaultProps = {
value: {},
value: '',
mode: 'yaml',
options: {},
onChange() {},
}

render() {
const { className, mode, options, value, onChange } = this.props

return (
<Suspense fallback={<Loading className="ks-page-loading" />}>
<AceEditor
Expand Down
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 @@ -19,7 +19,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { map, get, set, every, has, debounce, isEmpty, isNaN } from 'lodash'
import { Form, Input, Slider, TextArea, Toggle } from '@kube-design/components'
import { Form, Input, Slider, TextArea, Toggle, Select } from '@kube-design/components'
import { Text } from 'components/Base'
import { NumberInput } from 'components/Inputs'

Expand Down Expand Up @@ -89,6 +89,13 @@ export default class SchemaForm extends React.Component {
)
} else if (propObj.render === 'textArea') {
content = <TextArea {...attrs} />
} else if (propObj.render === 'select') {
content = (
<Select
options={propObj.options}
defaultValue={propObj.defaultValue}
{...attrs} />
)
} else {
content = <Input {...attrs} />
}
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
21 changes: 13 additions & 8 deletions src/pages/devops/components/Pipeline/StepModals/params.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ export default class Params extends React.Component {
formData = parseWithCredientialData(edittingData)
} else if (codeKey) {
value = (Array.isArray(data) ? data[0]?.value?.value : data.value) || ''
formData = {
[codeKey]: value,
}
} else if (Array.isArray(data)) {
formData = data.reduce((prev, arg) => {
const val = arg.value.value
Expand Down Expand Up @@ -305,14 +308,16 @@ export default class Params extends React.Component {
)
case 'code':
return (
<CodeEditor
key={option.name}
className={styles.CodeEditor}
name="script"
mode="yaml"
value={this.state.value}
onChange={this.handleCodeEditorChange(option.name)}
/>
<Form.Item {...formProps} label={null}>
<CodeEditor
key={option.name}
className={styles.CodeEditor}
name={option.name}
mode="yaml"
// value={this.state.value}
// onChange={this.handleCodeEditorChange(option.name)}
/>
</Form.Item>
)
case 'bool':
return (
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,
},
],
}
2 changes: 1 addition & 1 deletion src/stores/crd.resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class CRDResourceStore {
}

get mapper() {
return ObjectMapper.default
return ObjectMapper.customresourcedefinitionsedit
}

getPath({ cluster, namespace } = {}) {
Expand Down
18 changes: 18 additions & 0 deletions src/utils/object.mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,23 @@ const DefaultMapper = item => ({
_originData: getOriginData(item),
})

const CRDEditMapper = item => {
return {
...getBaseInfo(item),
namespace: get(item, 'metadata.namespace'),
spec: get(item, 'spec'),
_originData: omit(item, [
'metadata.uid',
'metadata.selfLink',
'metadata.generation',
'metadata.ownerReferences',
'metadata.resourceVersion',
'metadata.creationTimestamp',
'metadata.managedFields',
]),
}
}

const WorkspaceMapper = item => {
const overrides = get(item, 'spec.overrides', [])
const template = get(item, 'spec.template', {})
Expand Down Expand Up @@ -1504,6 +1521,7 @@ export default {
dashboards: DashboardMapper,
clusterdashboards: DashboardMapper,
customresourcedefinitions: CRDMapper,
customresourcedefinitionsedit: CRDEditMapper,
pipelines: PipelinesMapper,
networkpolicies: NetworkPoliciesMapper,
namespacenetworkpolicies: NetworkPoliciesMapper,
Expand Down

0 comments on commit f2bd058

Please sign in to comment.