|
2 | 2 |
|
3 | 3 | require 'spec_helper' |
4 | 4 | describe 'kubernetes::packages', type: :class do |
5 | | - subject(:catalogue) { catalogue } |
6 | | - |
7 | 5 | let(:pre_condition) do |
8 | 6 | [ |
9 | 7 | 'include kubernetes', |
|
332 | 330 | it { is_expected.to contain_file('/etc/containerd/config.toml').without_source } |
333 | 331 |
|
334 | 332 | it { |
335 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 333 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
336 | 334 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"\]\s*}, |
337 | 335 | ) |
338 | 336 | } |
339 | 337 |
|
340 | 338 | it { |
341 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 339 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
342 | 340 | %r{\s*endpoint = \["https://registry-1.docker.io"\]\s*}, |
343 | 341 | ) |
344 | 342 | } |
345 | 343 |
|
346 | 344 | it { |
347 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').without_content( |
| 345 | + is_expected.to contain_file('/etc/containerd/config.toml').without_content( |
348 | 346 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.private.example.com"\]\s*}, |
349 | 347 | ) |
350 | 348 | } |
351 | 349 |
|
352 | 350 | it { |
353 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 351 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
354 | 352 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.even-more-private.example.com"\]\s*}, |
355 | 353 | ) |
356 | 354 | } |
357 | 355 |
|
358 | 356 | it { |
359 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 357 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
360 | 358 | %r{\s*endpoint = \["https://docker.even-more-private.example.com"\]\s*}, |
361 | 359 | ) |
362 | 360 | } |
363 | 361 |
|
364 | 362 | it { |
365 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 363 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
366 | 364 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.private.example.com".auth\]\s*}, |
367 | 365 | ) |
368 | 366 | } |
369 | 367 |
|
370 | 368 | it { |
371 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 369 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
372 | 370 | %r{\s*auth = "1azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT=="\s*}, |
373 | 371 | ) |
374 | 372 | } |
375 | 373 |
|
376 | 374 | it { |
377 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 375 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
378 | 376 | %r{\s*username = "user2"\s*}, |
379 | 377 | ) |
380 | 378 | } |
381 | 379 |
|
382 | 380 | it { |
383 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 381 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
384 | 382 | %r{\s*password = "secret2"\s*}, |
385 | 383 | ) |
386 | 384 | } |
387 | 385 |
|
388 | 386 | it { |
389 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 387 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
390 | 388 | %r{\s*identitytoken = "azhzLXVuaXQtdGVzdDpCQ0NwNWZUUXlyd3c1aUxoMXpEQXJnUT"\s*}, |
391 | 389 | ) |
392 | 390 | } |
393 | 391 |
|
394 | 392 | it { |
395 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 393 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
396 | 394 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.private.example.com".tls\]\s*}, |
397 | 395 | ) |
398 | 396 | } |
399 | 397 |
|
400 | 398 | it { |
401 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 399 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
402 | 400 | %r{\s*ca_file = "ca1.pem"\s*}, |
403 | 401 | ) |
404 | 402 | } |
405 | 403 |
|
406 | 404 | it { |
407 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 405 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
408 | 406 | %r{\s*cert_file = "cert1.pem"\s*}, |
409 | 407 | ) |
410 | 408 | } |
411 | 409 |
|
412 | 410 | it { |
413 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 411 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
414 | 412 | %r{\s*key_file = "key1.pem"\s*}, |
415 | 413 | ) |
416 | 414 | } |
417 | 415 |
|
418 | 416 | it { |
419 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 417 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
420 | 418 | %r{\s*insecure_skip_verify = true\s*}, |
421 | 419 | ) |
422 | 420 | } |
423 | 421 |
|
424 | 422 | it { |
425 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 423 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
426 | 424 | %r{\s*ca_file = "ca2.pem"\s*}, |
427 | 425 | ) |
428 | 426 | } |
429 | 427 |
|
430 | 428 | it { is_expected.not_to contain_file('/etc/apt/preferences.d/containerd') } |
431 | 429 |
|
432 | 430 | it { |
433 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 431 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
434 | 432 | %r{\saddress = "/run/containerd/containerd.sock"}, |
435 | 433 | ) |
436 | 434 | } |
|
983 | 981 | it { is_expected.to contain_file('/etc/containerd/config.toml') } |
984 | 982 |
|
985 | 983 | it { |
986 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 984 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
987 | 985 | %r{\s*\[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"\]\s*}, |
988 | 986 | ) |
989 | 987 | } |
990 | 988 |
|
991 | 989 | it { |
992 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 990 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
993 | 991 | %r{\s*endpoint = \["https://registry-1.docker.io"\]\s*}, |
994 | 992 | ) |
995 | 993 | } |
|
1162 | 1160 | it { is_expected.not_to contain_file('/etc/systemd/system/docker.service.d') } |
1163 | 1161 |
|
1164 | 1162 | it { |
1165 | | - expect(catalogue).to contain_file('/etc/containerd/config.toml').with_content( |
| 1163 | + is_expected.to contain_file('/etc/containerd/config.toml').with_content( |
1166 | 1164 | %r{\saddress = "unix:///run/containerd/containerd.sock"}, |
1167 | 1165 | ) |
1168 | 1166 | } |
|
0 commit comments