Repository navigation
Commit 4cea54f
committed
fix(deploy): bound Helm rendering on hostile input, no partial or wrong release images
Review round 1 of DeusData#2677. Every case ends in an explicit unknown, never in a
hang, an OOM, a partial or a wrong image.
Bounds (helm_template.c):
- A per-render step and output budget (10,000,000 steps, 64 MiB): a range
over a huge int, a huge indent, defines that include each other in a fan
stop the render; every probe of the template is UNKNOWN, also one captured
before, and the trip is logged (helm.render.budget). Counted, never timed.
On the 20 infra corpora no render reaches it.
- go-yaml v2's alias limit: values whose decodes are mostly alias expansion
(a billion laughs) do not parse, as in Helm.
- --set: an index past strvals' MaxIndex (65536) or a key longer than the
parser holds is no value (the release is unknown), never a padded list or
a split key.
Reads (pass_k8s.c, pass_terraform.c): a values file, Chart.yaml, kustomize
valuesFile or Terraform file() named by path is read only when it is a
discovered file of the repository -- never through a symlink out of it --
with the size cap and tree-sitter padding of every other read. A chart file
that is there but not read makes the chart's values unknown, not empty.
Wrong images:
- Terraform number sets reach the chart as Terraform's exact decimal
(1.10 -> "1.1"), not %.17g.
- A release with a value source not read -- Flux valuesFrom, valuesFiles,
postRenderers; kustomize additionalValuesFiles, a valuesMerge other than
override, a valuesFile not read; Terraform dynamic "set" -- has no image of
its own.
- An aliased subchart renders with .Chart.Name its alias.
- An UNKNOWN if / with / range makes what its bodies assign UNKNOWN and
leaves the loop a break in them would; set / unset / merge poison the map
they change (merge: the maps within too). A change that may reach values
another part holds taints every later capture; one of a new value
(fromYaml, deepCopy, an empty dict, a part of one) does not.
Marks and secrets:
- The chart edge reads default_of as JSON (list paths kept), builds its
properties to size, and writes no edge whose mark it could not carry whole.
- Build arguments with a secret (by name or value) are never kept; build
edge properties and values-path marks are never cut.
Tests: one per bound and per wrong-image case, each RED on d21949e by its
assertion; a Helm chart joins the Kubernetes complexity fixture.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent d21949e commit 4cea54f
12 files changed
Lines changed: 1780 additions & 151 deletions
File tree
- src/pipeline
- tests
- fixtures/complexity/Kubernetes/chart
- templates
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
| 1089 | + | |
| 1090 | + | |
1090 | 1091 | | |
1091 | 1092 | | |
1092 | 1093 | | |
| |||
1109 | 1110 | | |
1110 | 1111 | | |
1111 | 1112 | | |
1112 | | - | |
| 1113 | + | |
1113 | 1114 | | |
1114 | 1115 | | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1119 | 1126 | | |
1120 | 1127 | | |
1121 | 1128 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2489 | 2489 | | |
2490 | 2490 | | |
2491 | 2491 | | |
2492 | | - | |
| 2492 | + | |
| 2493 | + | |
2493 | 2494 | | |
2494 | 2495 | | |
2495 | 2496 | | |
| |||
2500 | 2501 | | |
2501 | 2502 | | |
2502 | 2503 | | |
2503 | | - | |
2504 | | - | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
2505 | 2515 | | |
2506 | 2516 | | |
2507 | 2517 | | |
| |||
3763 | 3773 | | |
3764 | 3774 | | |
3765 | 3775 | | |
3766 | | - | |
3767 | 3776 | | |
3768 | 3777 | | |
3769 | 3778 | | |
3770 | | - | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
3771 | 3788 | | |
3772 | 3789 | | |
3773 | 3790 | | |
3774 | 3791 | | |
3775 | 3792 | | |
3776 | 3793 | | |
| 3794 | + | |
3777 | 3795 | | |
3778 | 3796 | | |
3779 | 3797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
333 | 419 | | |
334 | | - | |
335 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
336 | 424 | | |
337 | 425 | | |
338 | 426 | | |
| |||
371 | 459 | | |
372 | 460 | | |
373 | 461 | | |
374 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
375 | 467 | | |
376 | 468 | | |
377 | 469 | | |
| |||
388 | 480 | | |
389 | 481 | | |
390 | 482 | | |
391 | | - | |
| 483 | + | |
392 | 484 | | |
393 | 485 | | |
394 | 486 | | |
| |||
411 | 503 | | |
412 | 504 | | |
413 | 505 | | |
414 | | - | |
| 506 | + | |
415 | 507 | | |
416 | | - | |
| 508 | + | |
417 | 509 | | |
418 | 510 | | |
419 | 511 | | |
| |||
424 | 516 | | |
425 | 517 | | |
426 | 518 | | |
427 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
428 | 528 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
| 529 | + | |
433 | 530 | | |
434 | 531 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
459 | 535 | | |
460 | 536 | | |
461 | 537 | | |
| |||
512 | 588 | | |
513 | 589 | | |
514 | 590 | | |
515 | | - | |
516 | | - | |
| 591 | + | |
| 592 | + | |
517 | 593 | | |
518 | 594 | | |
519 | 595 | | |
520 | 596 | | |
521 | 597 | | |
522 | 598 | | |
523 | 599 | | |
524 | | - | |
525 | 600 | | |
526 | 601 | | |
527 | 602 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | 603 | | |
532 | 604 | | |
533 | 605 | | |
| |||
550 | 622 | | |
551 | 623 | | |
552 | 624 | | |
553 | | - | |
| 625 | + | |
554 | 626 | | |
555 | 627 | | |
556 | 628 | | |
| |||
561 | 633 | | |
562 | 634 | | |
563 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
564 | 655 | | |
565 | 656 | | |
566 | | - | |
| 657 | + | |
| 658 | + | |
567 | 659 | | |
568 | 660 | | |
569 | 661 | | |
| |||
576 | 668 | | |
577 | 669 | | |
578 | 670 | | |
579 | | - | |
580 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
581 | 675 | | |
582 | 676 | | |
583 | 677 | | |
| |||
598 | 692 | | |
599 | 693 | | |
600 | 694 | | |
601 | | - | |
| 695 | + | |
602 | 696 | | |
603 | 697 | | |
604 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments