Commit 9d279d6
authored
Update custom TinkerbellTemplateConfig to use new static IPAM logic (#10338)
The custom template in TestTinkerbellCustomTemplateRefSimpleFlow was using
the deprecated STATIC_NETPLAN environment variable approach which was
removed in PR #10163. That PR changed the templating logic to directly
configure IPAM using netplan or NetworkManager by referencing the Hardware
object's network metadata.
This commit updates the custom template to:
- Remove STATIC_NETPLAN environment variable
- Add CONTENTS with Go template expressions that access network details
directly from .Hardware.Interfaces[0].DHCP fields
- Support both VLAN and non-VLAN configurations using conditional logic
- Use netmaskToCIDR template function for proper CIDR notation
- Maintain the custom cexec action for test validation
The updated template now follows the same pattern as the default template
generation in NewDefaultTinkerbellTemplateConfigCreate, specifically
mirroring the withNetplanAction() function for Ubuntu OS family.
Ref: #101631 parent 50960c9 commit 9d279d6
1 file changed
+41
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
20 | 58 | | |
21 | 59 | | |
22 | 60 | | |
23 | 61 | | |
24 | 62 | | |
25 | 63 | | |
26 | | - | |
27 | 64 | | |
28 | 65 | | |
29 | 66 | | |
| |||
54 | 91 | | |
55 | 92 | | |
56 | 93 | | |
57 | | - | |
| 94 | + | |
58 | 95 | | |
59 | 96 | | |
60 | 97 | | |
61 | | - | |
| 98 | + | |
62 | 99 | | |
63 | 100 | | |
64 | 101 | | |
| |||
70 | 107 | | |
71 | 108 | | |
72 | 109 | | |
73 | | - | |
74 | | - | |
| 110 | + | |
75 | 111 | | |
76 | 112 | | |
77 | 113 | | |
| |||
0 commit comments