Commit 9321b39
authored
fix: skip validating unknown version names (#123)
Same problem as seen in #115.
This fixes a problem where having multiple template version names
manually set using Terraform variables would always return a duplicate
name error, as Terraform would mark the attribute, although it is
required and already written in the config, as Unknown before calling
our custom validator. This unknown value is only ever passed to the
validator, never `Create` or `Update`.
Knowing this, we see the same problem exists for all attributes we read
in our custom validator. The only remaining one is `active`, where we
check at least one version is marked as active. In this case, we also
need to skip validating `active` if any of the booleans are unknown.
We previously didn't have any tests that explicitly used Terraform
variables, so this PR adds one, in case the behaviour of these variable
set attributes is changed in the future.1 parent 39ce21c commit 9321b39
File tree
2 files changed
+74
-13
lines changed- internal/provider
2 files changed
+74
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
899 | 912 | | |
900 | 913 | | |
901 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
902 | 920 | | |
903 | 921 | | |
904 | 922 | | |
| |||
910 | 928 | | |
911 | 929 | | |
912 | 930 | | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | 931 | | |
927 | 932 | | |
928 | 933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
651 | 707 | | |
652 | 708 | | |
653 | 709 | | |
| |||
0 commit comments