-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,16 +38,24 @@ def test_restart_by_annotation | |
def test_restart_statefulset_on_delete_restarts_child_pods | ||
result = deploy_fixtures("hello-cloud", subset: ["configmap-data.yml", "unmanaged-pod-1.yml.erb", | ||
"stateful_set.yml"], render_erb: true) do |fixtures| | ||
end | ||
assert_deploy_success(result) | ||
|
||
result = deploy_fixtures("hello-cloud", subset: ["configmap-data.yml", "unmanaged-pod-1.yml.erb", | ||
"stateful_set.yml"], render_erb: true, wait: false) do |fixtures| | ||
statefulset = fixtures["stateful_set.yml"]["StatefulSet"].first | ||
statefulset["spec"]["updateStrategy"] = { "type" => "OnDelete" } | ||
# https://github.com/kubernetes/kubernetes/issues/100151#issuecomment-801073848 | ||
statefulset["spec"]["updateStrategy"] = { "type" => "OnDelete", "rollingUpdate" => nil } | ||
container = statefulset['spec']['template']['spec']['containers'].first | ||
container['readinessProbe'] = { "exec" => { "command" => ['ls'] } } | ||
end | ||
assert_deploy_success(result) | ||
before_pods = kubeclient.get_pods(namespace: @namespace, label_selector: "name=stateful-busybox").map do |p| | ||
p.metadata.uid | ||
end | ||
|
||
restart = build_restart_task | ||
This comment has been minimized.
Sorry, something went wrong. |
||
assert_restart_success(restart.perform) | ||
assert_restart_success(restart.perform(verify_result: false)) | ||
This comment has been minimized.
Sorry, something went wrong.
stefanmb
Author
Contributor
|
||
after_pods = kubeclient.get_pods(namespace: @namespace, label_selector: "name=stateful-busybox").map do |p| | ||
p.metadata.uid | ||
end | ||
|
The restart at this point causes the
currentReplicas
filed to disappear: