|
65 | 65 | 'etcd_archive_checksum' => nil, |
66 | 66 | 'runc_source_checksum' => nil, |
67 | 67 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 68 | + 'containerd_plugins_registry' => { |
| 69 | + 'docker.io' => { |
| 70 | + 'mirrors' => { |
| 71 | + 'endpoint' => 'https://registry-1.docker.io' |
| 72 | + }, |
| 73 | + }, |
| 74 | + }, |
68 | 75 | } |
69 | 76 | end |
70 | 77 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
154 | 161 | 'etcd_archive_checksum' => nil, |
155 | 162 | 'runc_source_checksum' => nil, |
156 | 163 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 164 | + 'containerd_plugins_registry' => { |
| 165 | + 'docker.io' => { |
| 166 | + 'mirrors' => { |
| 167 | + 'endpoint' => 'https://registry-1.docker.io' |
| 168 | + }, |
| 169 | + }, |
| 170 | + }, |
157 | 171 | } |
158 | 172 | end |
159 | 173 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
242 | 256 | 'etcd_archive_checksum' => nil, |
243 | 257 | 'runc_source_checksum' => nil, |
244 | 258 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 259 | + 'containerd_plugins_registry' => { |
| 260 | + 'docker.io' => { |
| 261 | + 'mirrors' => { |
| 262 | + 'endpoint' => 'https://registry-1.docker.io' |
| 263 | + }, |
| 264 | + }, |
| 265 | + 'docker.private.example.com' => { |
| 266 | + 'mirrors' => {}, |
| 267 | + 'tls' => { |
| 268 | + 'ca_file' => 'ca1.pem', |
| 269 | + 'cert_file' => 'cert1.pem', |
| 270 | + 'key_file' => 'key1.pem', |
| 271 | + }, |
| 272 | + 'auth' => { |
| 273 | + 'auth' => '1azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT==', |
| 274 | + }, |
| 275 | + }, |
| 276 | + 'docker.more-private.example.com' => { |
| 277 | + 'mirrors' => { |
| 278 | + 'endpoint' => 'https://docker.more-private.example.com' |
| 279 | + }, |
| 280 | + 'tls' => { |
| 281 | + 'insecure_skip_verify' => true, |
| 282 | + }, |
| 283 | + 'auth' => { |
| 284 | + 'username' => 'user2', |
| 285 | + 'password' => 'secret2', |
| 286 | + }, |
| 287 | + }, |
| 288 | + 'docker.even-more-private.example.com' => { |
| 289 | + 'mirrors' => { |
| 290 | + 'endpoint' => 'https://docker.even-more-private.example.com' |
| 291 | + }, |
| 292 | + 'tls' => { |
| 293 | + 'ca_file' => 'ca2.pem', |
| 294 | + }, |
| 295 | + 'auth' => { |
| 296 | + 'identitytoken' => 'azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT', |
| 297 | + }, |
| 298 | + }, |
| 299 | + }, |
245 | 300 | } |
246 | 301 | end |
247 | 302 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
255 | 310 | it { should contain_package('kubectl').with_ensure('1.10.2')} |
256 | 311 | it { should contain_package('kubeadm').with_ensure('1.10.2')} |
257 | 312 | it { should contain_file('/etc/containerd')} |
258 | | - it { should contain_file('/etc/containerd/config.toml')} |
| 313 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 314 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"\]\s*/ |
| 315 | + )} |
| 316 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 317 | + /\s*endpoint = \["https:\/\/registry-1.docker.io"\]\s*/ |
| 318 | + )} |
| 319 | + it { should contain_file('/etc/containerd/config.toml').without_content( |
| 320 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.private.example.com"\]\s*/ |
| 321 | + )} |
| 322 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 323 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.even-more-private.example.com"\]\s*/ |
| 324 | + )} |
| 325 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 326 | + /\s*endpoint = \["https:\/\/docker.even-more-private.example.com"\]\s*/ |
| 327 | + )} |
| 328 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 329 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.private.example.com".auth\]\s*/ |
| 330 | + )} |
| 331 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 332 | + /\s*auth = "1azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT=="\s*/ |
| 333 | + )} |
| 334 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 335 | + /\s*username = "user2"\s*/ |
| 336 | + )} |
| 337 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 338 | + /\s*password = "secret2"\s*/ |
| 339 | + )} |
| 340 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 341 | + /\s*identitytoken = "azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT"\s*/ |
| 342 | + )} |
| 343 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 344 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.private.example.com".tls\]\s*/ |
| 345 | + )} |
| 346 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 347 | + /\s*ca_file = "ca1.pem"\s*/ |
| 348 | + )} |
| 349 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 350 | + /\s*cert_file = "cert1.pem"\s*/ |
| 351 | + )} |
| 352 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 353 | + /\s*key_file = "key1.pem"\s*/ |
| 354 | + )} |
| 355 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 356 | + /\s*insecure_skip_verify = true\s*/ |
| 357 | + )} |
| 358 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 359 | + /\s*ca_file = "ca2.pem"\s*/ |
| 360 | + )} |
259 | 361 | it { should_not contain_file('/etc/apt/preferences.d/containerd')} |
260 | 362 | end |
261 | 363 |
|
|
319 | 421 | 'etcd_archive_checksum' => nil, |
320 | 422 | 'runc_source_checksum' => nil, |
321 | 423 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 424 | + 'containerd_plugins_registry' => { |
| 425 | + 'docker.io' => { |
| 426 | + 'mirrors' => { |
| 427 | + 'endpoint' => 'https://registry-1.docker.io' |
| 428 | + }, |
| 429 | + }, |
| 430 | + }, |
322 | 431 | } |
323 | 432 | end |
324 | 433 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
407 | 516 | 'etcd_archive_checksum' => nil, |
408 | 517 | 'runc_source_checksum' => nil, |
409 | 518 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 519 | + 'containerd_plugins_registry' => { |
| 520 | + 'docker.io' => { |
| 521 | + 'mirrors' => { |
| 522 | + 'endpoint' => 'https://registry-1.docker.io' |
| 523 | + }, |
| 524 | + }, |
| 525 | + }, |
410 | 526 | } |
411 | 527 | end |
412 | 528 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
495 | 611 | 'etcd_archive_checksum' => nil, |
496 | 612 | 'runc_source_checksum' => nil, |
497 | 613 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 614 | + 'containerd_plugins_registry' => { |
| 615 | + 'docker.io' => { |
| 616 | + 'mirrors' => { |
| 617 | + 'endpoint' => 'https://registry-1.docker.io' |
| 618 | + }, |
| 619 | + }, |
| 620 | + }, |
498 | 621 | } |
499 | 622 | end |
500 | 623 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
579 | 702 | 'etcd_archive_checksum' => nil, |
580 | 703 | 'runc_source_checksum' => nil, |
581 | 704 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 705 | + 'containerd_plugins_registry' => { |
| 706 | + 'docker.io' => { |
| 707 | + 'mirrors' => { |
| 708 | + 'endpoint' => 'https://registry-1.docker.io' |
| 709 | + }, |
| 710 | + }, |
| 711 | + }, |
582 | 712 | } |
583 | 713 | end |
584 | 714 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
593 | 723 | it { should contain_package('containerd.io').with_ensure('1.4.3')} |
594 | 724 | it { should contain_file('/etc/containerd')} |
595 | 725 | it { should contain_file('/etc/containerd/config.toml')} |
596 | | - it { should contain_file('/etc/apt/preferences.d/containerd')} |
| 726 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 727 | + /\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"\]\s*/ |
| 728 | + )} |
| 729 | + it { should contain_file('/etc/containerd/config.toml').with_content( |
| 730 | + /\s*endpoint = \["https:\/\/registry-1.docker.io"\]\s*/ |
| 731 | + )} |
| 732 | + # it { should contain_file('/etc/apt/preferences.d/containerd')} |
597 | 733 | end |
598 | 734 |
|
599 | 735 | context 'with disable_swap => true' do |
|
656 | 792 | 'etcd_archive_checksum' => 'bcab421f6bf4111accfceb004e0a0ac2bcfb92ac93081d9429e313248dd78c41', |
657 | 793 | 'runc_source_checksum' => 'bcab421f6bf4111accfceb004e0a0ac2bcfb92ac93081d9429e313248dd78c41', |
658 | 794 | 'tmp_directory' => '/var/tmp/puppetlabs-kubernetes', |
| 795 | + 'containerd_plugins_registry' => { |
| 796 | + 'docker.io' => { |
| 797 | + 'mirrors' => { |
| 798 | + 'endpoint' => 'https://registry-1.docker.io' |
| 799 | + }, |
| 800 | + }, |
| 801 | + }, |
659 | 802 | } |
660 | 803 | end |
661 | 804 | it { should contain_file_line('remove swap in /etc/fstab')} |
|
0 commit comments