feat: 新增 Pod_ContainerCreating 云盘 PVC 创建失败故障场景#299
Open
woyaonidish wants to merge 1 commit intomasterfrom
Open
feat: 新增 Pod_ContainerCreating 云盘 PVC 创建失败故障场景#299woyaonidish wants to merge 1 commit intomasterfrom
woyaonidish wants to merge 1 commit intomasterfrom
Conversation
Add new chaos action "containercreating-disk" to simulate Pod
ContainerCreating state caused by cloud disk PVC creation failure
due to StorageClass misconfiguration.
- New file: exec/pod/containercreatingdisk.go (437 lines)
- PreCreate: validate namespace, storage-class parameters
- Create: deploy error StorageClass PVC + deployment
- Destroy: cleanup PVC and deployment
- PreDestroy: resource cleanup preparation
- Resource prefix: ccd
- Parameters: namespace, storage-class, pvc-name, deploy-name
- New file: exec/pod/containercreatingdisk_test.go (233 lines)
- 13 test cases covering ActionSpec metadata, Executor name,
PreCreate validation (empty namespace, comma in namespace,
empty storage-class, normal flow), PreDestroy normal flow
- Modified: exec/pod/pod.go — register containercreating-disk action
All 85 tests pass (100%), race detection clean.
goimports and gofumpt formatting verified.
Fixes #81818669
Signed-off-by: woyaonidish <jiangzelin.jzl@alibaba-inc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
在 chaosblade-operator 中新增 Pod_ContainerCreating 故障场景,模拟云盘 PVC 创建失败(如 StorageClass 不存在)导致的 Pod 卡在 ContainerCreating 状态。
Does this pull request fix one issue?
Fixes #81818669
Describe how you did it
参考现有 containercreating.go 实现模式,新增 containercreatingdisk.go:
Describe how to verify it
go test -race ./exec/pod/ -run ContainerCreatingDiskSpecial notes for reviews