Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Update acceptance tests to use core-dns
Browse files Browse the repository at this point in the history
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
  • Loading branch information
JoshVanL committed Feb 5, 2019
1 parent 01fa4be commit 285174b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file should be kept in sync with https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy
---
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
Expand Down
16 changes: 13 additions & 3 deletions puppet/modules/tarmak/spec/acceptance/single_node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
ENV['KUBERNETES_AUTHORIZATION_MODE'] || '[]'
end

if Gem::Version.new(ENV['KUBERNETES_VERSION']) >= Gem::Version.new('1.10.0')
let :dns_name do
'core'
end
else
let :dns_name do
'kube'
end
end

context 'single node with master + worker components' do
let :cluster_name do
'test'
Expand Down Expand Up @@ -111,15 +121,15 @@
end

it 'should have three ready dns pods', :retry => 20, :retry_wait => 5 do
result = shell('kubectl get pods --namespace kube-system -l k8s-app=kube-dns')
result = shell("kubectl get pods --namespace kube-system -l k8s-app=#{dns_name}-dns")
logger.notify "kubectl get pods:\n#{result.stdout}"
expect(result.exit_code).to eq(0)
expect(result.stdout.scan(/Running/m).size).to eq(3)
expect(result.stdout.scan(/(4\/4|3\/3)/m).size).to eq(3)
expect(result.stdout.scan(/(4\/4|3\/3|1\/1)/m).size).to eq(3)
end

it 'should have a ready dns autoscaler pod', :retry => 20, :retry_wait => 5 do
result = shell('kubectl get pods --namespace kube-system -l k8s-app=kube-dns-autoscaler')
result = shell("kubectl get pods --namespace kube-system -l k8s-app=#{dns_name}-dns-autoscaler")
logger.notify "kubectl get pods:\n#{result.stdout}"
expect(result.exit_code).to eq(0)
expect(result.stdout.scan(/Running/m).size).to eq(1)
Expand Down

0 comments on commit 285174b

Please sign in to comment.