@@ -12,7 +12,7 @@ use crate::clients::{apply_manifest_yaml, kube_client, wait_for_status};
12
12
use crate :: configparser:: challenge:: ExposeType ;
13
13
use crate :: configparser:: config:: ProfileConfig ;
14
14
use crate :: configparser:: { get_config, get_profile_config, ChallengeConfig } ;
15
- use crate :: utils:: TryJoinAll ;
15
+ use crate :: utils:: { render_strict , TryJoinAll } ;
16
16
17
17
pub mod templates;
18
18
@@ -73,10 +73,10 @@ async fn deploy_single_challenge(
73
73
74
74
let kube = kube_client ( profile) . await ?;
75
75
76
- let ns_manifest = minijinja :: render! (
76
+ let ns_manifest = render_strict (
77
77
templates:: CHALLENGE_NAMESPACE ,
78
- chal, slug => chal. slugify( )
79
- ) ;
78
+ minijinja :: context! { chal, slug => chal. slugify( ) } ,
79
+ ) ? ;
80
80
trace ! ( "NAMESPACE:\n {}" , ns_manifest) ;
81
81
82
82
debug ! ( "applying namespace for chal {:?}" , chal. directory) ;
@@ -94,10 +94,13 @@ async fn deploy_single_challenge(
94
94
95
95
for pod in & chal. pods {
96
96
let pod_image = chal. container_tag_for_pod ( profile_name, & pod. name ) ?;
97
- let depl_manifest = minijinja :: render! (
97
+ let depl_manifest = render_strict (
98
98
templates:: CHALLENGE_DEPLOYMENT ,
99
- chal, pod, pod_image, profile_name, slug => chal. slugify( ) ,
100
- ) ;
99
+ minijinja:: context! {
100
+ chal, pod, pod_image, profile_name,
101
+ slug => chal. slugify( ) ,
102
+ } ,
103
+ ) ?;
101
104
trace ! ( "DEPLOYMENT:\n {}" , depl_manifest) ;
102
105
103
106
debug ! (
@@ -132,10 +135,13 @@ async fn deploy_single_challenge(
132
135
. partition ( |p| matches ! ( p. expose, ExposeType :: Tcp ( _) ) ) ;
133
136
134
137
if !tcp_ports. is_empty ( ) {
135
- let tcp_manifest = minijinja :: render! (
138
+ let tcp_manifest = render_strict (
136
139
templates:: CHALLENGE_SERVICE_TCP ,
137
- chal, pod, tcp_ports, slug => chal. slugify( ) , domain => profile. challenges_domain
138
- ) ;
140
+ minijinja:: context! {
141
+ chal, pod, tcp_ports,
142
+ slug => chal. slugify( ) , domain => profile. challenges_domain
143
+ } ,
144
+ ) ?;
139
145
trace ! ( "TCP SERVICE:\n {}" , tcp_manifest) ;
140
146
141
147
debug ! (
@@ -168,10 +174,13 @@ async fn deploy_single_challenge(
168
174
}
169
175
170
176
if !http_ports. is_empty ( ) {
171
- let http_manifest = minijinja :: render! (
177
+ let http_manifest = render_strict (
172
178
templates:: CHALLENGE_SERVICE_HTTP ,
173
- chal, pod, http_ports, slug => chal. slugify( ) , domain => profile. challenges_domain
174
- ) ;
179
+ minijinja:: context! {
180
+ chal, pod, http_ports,
181
+ slug => chal. slugify( ) , domain => profile. challenges_domain
182
+ } ,
183
+ ) ?;
175
184
trace ! ( "HTTP INGRESS:\n {}" , http_manifest) ;
176
185
177
186
debug ! (
0 commit comments