Skip to content

Commit

Permalink
Prune pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
dturn committed Aug 9, 2018
1 parent b9aefc5 commit 84d87b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/kubernetes-deploy/deploy_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def prune_whitelist
extensions/v1beta1/Ingress
apps/v1beta1/StatefulSet
autoscaling/v1/HorizontalPodAutoscaler
policy/v1beta1/PodDisruptionBudget
)
if server_version >= Gem::Version.new('1.8.0')
wl << "batch/v1beta1/CronJob"
Expand Down
7 changes: 0 additions & 7 deletions test/integration-serial/run_serial_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ def test_crd_can_fail
end

def test_crd_pruning
widget = Class.new(KubernetesDeploy::KubernetesResource) do
def deploy_method
:replace
end
end
KubernetesDeploy.const_set("Widget", widget)

assert_deploy_success(deploy_fixtures("crd", subset: %w(mail.yml widgets.yml)))
assert_logs_match_all([
"Phase 1: Initializing deploy",
Expand Down
6 changes: 6 additions & 0 deletions test/integration/kubernetes_deploy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1070,4 +1070,10 @@ def test_hpa_can_be_pruned
assert_deploy_success(deploy_fixtures("hpa", subset: ["deployment.yml"]))
assert_logs_match_all([/The following resources were pruned: horizontalpodautoscaler(.autoscaling)? "hello-hpa"/])
end

def test_not_apply_resource_can_be_pruned
assert_deploy_success(deploy_fixtures("hello-cloud", subset: %w(disruption-budgets.yml configmap-data.yml)))
assert_deploy_success(deploy_fixtures("hello-cloud", subset: %w(configmap-data.yml)))
assert_logs_match_all([/The following resources were pruned: poddisruptionbudget(.policy)? "test"/])
end
end

0 comments on commit 84d87b3

Please sign in to comment.