|
50 | 50 | 'container_runtime' => 'cri_containerd', |
51 | 51 | 'controller' => true, |
52 | 52 | 'cloud_provider' => ':undef', |
53 | | - |
| 53 | + 'manage_docker' => true, |
54 | 54 | } |
55 | 55 | end |
56 | 56 | it { should contain_file('/etc/systemd/system/kubelet.service.d')} |
|
61 | 61 | it { should contain_service('etcd')} |
62 | 62 | end |
63 | 63 |
|
64 | | - context 'with controller => true and container_runtime => docker' do |
| 64 | + context 'with controller => true and container_runtime => docker and manage_docker => true' do |
65 | 65 | let(:pre_condition) { 'class {"kubernetes::config": |
66 | 66 | kubernetes_version => "1.10.2", |
67 | 67 | container_runtime => "docker", |
|
98 | 98 | 'container_runtime' => 'docker', |
99 | 99 | 'controller' => true, |
100 | 100 | 'cloud_provider' => ':undef', |
| 101 | + 'manage_docker' => true, |
101 | 102 | } |
102 | 103 | end |
103 | 104 | it { should contain_service('docker')} |
104 | 105 | it { should contain_service('etcd')} |
105 | 106 | end |
| 107 | + |
| 108 | + context 'with controller => true and container_runtime => docker and manage_docker => false' do |
| 109 | + let(:pre_condition) { 'class {"kubernetes::config": |
| 110 | + kubernetes_version => "1.10.2", |
| 111 | + container_runtime => "docker", |
| 112 | + etcd_version => "3.1.12", |
| 113 | + etcd_ca_key => "foo", |
| 114 | + etcd_ca_crt => "foo", |
| 115 | + etcdclient_key => "foo", |
| 116 | + etcdclient_crt => "foo", |
| 117 | + api_server_count => 3, |
| 118 | + kubernetes_ca_crt => "foo", |
| 119 | + kubernetes_ca_key => "foo", |
| 120 | + discovery_token_hash => "foo", |
| 121 | + sa_pub => "foo", |
| 122 | + sa_key => "foo", |
| 123 | + kube_api_advertise_address => "foo", |
| 124 | + cni_pod_cidr => "10.0.0.0/24", |
| 125 | + etcdserver_crt => "foo", |
| 126 | + etcdserver_key => "foo", |
| 127 | + etcdpeer_crt => "foo", |
| 128 | + etcdpeer_key => "foo", |
| 129 | + etcd_peers => ["foo"], |
| 130 | + etcd_ip => "foo", |
| 131 | + etcd_initial_cluster => "foo", |
| 132 | + token => "foo", |
| 133 | + apiserver_cert_extra_sans => ["foo"], |
| 134 | + apiserver_extra_arguments => ["foo"], |
| 135 | + service_cidr => "10.96.0.0/12", |
| 136 | + node_label => "foo", |
| 137 | + cloud_provider => ":undef", |
| 138 | + kubeadm_extra_config => {"foo" => ["bar", "baz"]}, |
| 139 | + }' } |
| 140 | + let(:params) do |
| 141 | + { |
| 142 | + 'container_runtime' => 'docker', |
| 143 | + 'controller' => true, |
| 144 | + 'cloud_provider' => ':undef', |
| 145 | + 'manage_docker' => false, |
| 146 | + } |
| 147 | + end |
| 148 | + it { should_not contain_service('docker')} |
| 149 | + it { should contain_service('etcd')} |
| 150 | + end |
106 | 151 | end |
0 commit comments