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