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

add k8s api provider plugins #71

Merged
merged 8 commits into from
Jan 8, 2024
Merged

add k8s api provider plugins #71

merged 8 commits into from
Jan 8, 2024

Conversation

tanbowensg
Copy link
Member

@tanbowensg tanbowensg commented Dec 25, 2023

改动

  1. 添加了 Model 和 Relation 的 Plugin Support plugins k8s-api-provider#30
  2. 在 Workload 资源的页面中,添加了重启次数
  3. D2 不需要再感知原始的 k8s 数据结构了
  4. DovetailCRUD 一般不再需要传formatter了,因为plugin里面都已经格式化好了。但暂时没有全部删掉,以防一些特殊需求。
  5. 如果要恢复原本的 k8s 数据结构,应该调用 globalStore 上的 restoreItem 方法
    截屏2023-12-25 16 23 50
    截屏2023-12-25 16 23 35

@tanbowensg tanbowensg force-pushed the bowen/remove-model-reabase branch from cc2c89f to 6d6ecb0 Compare December 25, 2023 08:06
@tanbowensg tanbowensg changed the title Draft: refactor: Remove model in d2 refactor: Remove model in d2 Dec 25, 2023
@tanbowensg tanbowensg changed the title refactor: Remove model in d2 Draft: refactor: Remove model in d2 Dec 26, 2023
@tanbowensg tanbowensg force-pushed the bowen/remove-model-reabase branch from 6d6ecb0 to f67b013 Compare December 27, 2023 09:51
@tanbowensg tanbowensg changed the title Draft: refactor: Remove model in d2 add k8s api provider plugins Dec 28, 2023
@tanbowensg tanbowensg force-pushed the bowen/remove-model-reabase branch from f67b013 to fce1b02 Compare December 28, 2023 03:08
@tanbowensg tanbowensg force-pushed the bowen/remove-model-reabase branch from fce1b02 to 332cc7b Compare January 4, 2024 03:27
@tanbowensg tanbowensg force-pushed the bowen/remove-model-reabase branch from bb1b153 to 176632c Compare January 5, 2024 06:42
PhaseColumnRenderer(),
NameColumnRenderer('jobs'),
NameSpaceColumnRenderer(),
WorkloadImageColumnRenderer(),
CompletionsCountColumnRenderer(),
DurationColumnRenderer(),
AgeColumnRenderer(),
];
] as Column<ResourceModel>[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要使用 as 呢?

const newOne = cloneDeep(this._rawYaml);
const path = 'spec.template.metadata.annotations';
const annotations = get(newOne, path, {});
set(newOne, path, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该要使用 immutable set,不要修改到原来的值,否则更新失败的时候数据会对不上

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没关系,这个值已经clonedeep过了

@Yuyz0112 Yuyz0112 merged commit 7ce2788 into main Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants