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

Revert "Add Daemon Set resource" #147

Merged
merged 1 commit into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 0 additions & 95 deletions lib/kubernetes-deploy/kubernetes_resource/daemon_set.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/kubernetes-deploy/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
pod_disruption_budget
replica_set
service_account
daemon_set
).each do |subresource|
require "kubernetes-deploy/kubernetes_resource/#{subresource}"
end
Expand Down
16 changes: 0 additions & 16 deletions test/fixtures/hello-cloud/daemon_set.yml

This file was deleted.

7 changes: 0 additions & 7 deletions test/helpers/fixture_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ def assert_service_account_present(name)
assert desired.present?, "Service account #{name} does not exist"
end

def assert_daemon_set_present(name)
labels = "name=#{name},app=#{app_name}"
daemon_sets = v1beta1_kubeclient.get_daemon_sets(namespace: namespace, label_selector: labels)
desired = daemon_sets.find { |ds| ds.metadata.name == name }
assert desired.present?, "Daemon set #{name} does not exist"
end

def assert_annotated(obj, annotation)
annotations = obj.metadata.annotations.to_h.stringify_keys
assert annotations.key?(annotation), "Expected secret to have annotation #{annotation}, but it did not"
Expand Down
5 changes: 0 additions & 5 deletions test/helpers/fixture_sets/hello_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def assert_all_up
assert_poddisruptionbudget
assert_bare_replicaset_up
assert_all_service_accounts_up
assert_daemon_set_up
end

def assert_unmanaged_pod_statuses(status, count = 1)
Expand Down Expand Up @@ -85,9 +84,5 @@ def assert_bare_replicaset_up
def assert_all_service_accounts_up
assert_service_account_present("build-robot")
end

def assert_daemon_set_up
assert_daemon_set_present("nginx")
end
end
end
30 changes: 4 additions & 26 deletions test/integration/kubernetes_deploy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ def test_full_hello_cloud_set_deploy_succeeds
"Deploying ConfigMap/hello-cloud-configmap-data (timeout: 30s)",
"Hello from Docker!", # unmanaged pod logs
"Result: SUCCESS",
"Successfully deployed 14 resources"
"Successfully deployed 13 resources"
], in_order: true)

assert_logs_match_all([
%r{ReplicaSet/bare-replica-set\s+1 replica, 1 availableReplica, 1 readyReplica},
%r{Deployment/web\s+1 replica, 1 updatedReplica, 1 availableReplica},
%r{Service/web\s+Selects at least 1 pod},
%r{DaemonSet/nginx\s+1 currentNumberScheduled, 1 desiredNumberScheduled, 1 numberReady, 1 numberAvailable}
%r{Service/web\s+Selects at least 1 pod}
])
end

Expand Down Expand Up @@ -50,10 +49,9 @@ def test_pruning_works
'pod "unmanaged-pod-',
'service "web"',
'deployment "web"',
'ingress "web"',
'daemonset "nginx"'
'ingress "web"'
] # not necessarily listed in this order
expected_msgs = [/Pruned 6 resources and successfully deployed 3 resources/]
expected_msgs = [/Pruned 5 resources and successfully deployed 3 resources/]
expected_pruned.map do |resource|
expected_msgs << /The following resources were pruned:.*#{resource}/
end
Expand Down Expand Up @@ -634,26 +632,6 @@ def test_output_when_unmanaged_pod_preexists
assert_logs_match("Unmanaged pods like Pod/oops-it-is-static must have unique names on every deploy")
end

def test_bad_container_on_daemon_sets_fails
success = deploy_fixtures("hello-cloud", subset: ["daemon_set.yml"]) do |fixtures|
daemon_set = fixtures['daemon_set.yml']['DaemonSet'].first
container = daemon_set['spec']['template']['spec']['containers'].first
container["image"] = "busybox"
container["command"] = ["ls", "/not-a-dir"]
end

refute success
assert_logs_match_all([
"DaemonSet/nginx: FAILED",
"nginx: Crashing repeatedly (exit 1). See logs for more information.",
"Final status: 1 currentNumberScheduled, 1 desiredNumberScheduled, 0 numberReady",
"Events (common success events excluded):",
"BackOff: Back-off restarting failed container",
"Logs from container 'nginx' (last 250 lines shown):",
"ls: /not-a-dir: No such file or directory"
], in_order: true)
end

private

def count_by_revisions(pods)
Expand Down