Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmb committed Mar 8, 2022
1 parent 4fb61d8 commit 5c4acd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/fixtures/hello-cloud/stateful_set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ metadata:
spec:
serviceName: "stateful-busybox"
replicas: 2
podManagementPolicy: Parallel
selector:
matchLabels:
app: hello-cloud
Expand Down
12 changes: 10 additions & 2 deletions test/integration/restart_task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
@stefanmb

stefanmb Mar 8, 2022

Author Contributor

The restart at this point causes the currentReplicas filed to disappear:

  status:
    collisionCount: 0
    currentRevision: stateful-busybox-6b5489d7d6
    observedGeneration: 2
    readyReplicas: 2
    replicas: 2
    updateRevision: stateful-busybox-96676bd54
    updatedReplicas: 2
assert_restart_success(restart.perform)
assert_restart_success(restart.perform(verify_result: false))

This comment has been minimized.

Copy link
@stefanmb

stefanmb Mar 8, 2022

Author Contributor

This will hit kubernetes/kubernetes#106059. It should not be disabled.

after_pods = kubeclient.get_pods(namespace: @namespace, label_selector: "name=stateful-busybox").map do |p|
p.metadata.uid
end
Expand Down

0 comments on commit 5c4acd0

Please sign in to comment.