Skip to content

Commit

Permalink
fix:Updating crd resource on ks-console page loses status information (
Browse files Browse the repository at this point in the history
…#3866)

Signed-off-by: yaozhenxiu <[email protected]>
  • Loading branch information
yzxiu authored Oct 18, 2023
1 parent 6122855 commit 46eecf6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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 46eecf6

Please sign in to comment.