@@ -4,11 +4,12 @@ use itertools::Itertools;
44use minijinja;
55use regex:: Regex ;
66use serde;
7+ use serde_yaml_ng:: Value ;
78use std:: collections:: HashMap ;
89use std:: fmt;
910use tracing:: { debug, error, info, trace, warn} ;
1011
11- use crate :: configparser:: config;
12+ use crate :: configparser:: config:: { self , ProfileConfig , S3Config } ;
1213use crate :: utils:: render_strict;
1314
1415pub mod example_values;
@@ -85,17 +86,17 @@ pub fn interactive_init() -> inquire::error::InquireResult<config::RcdsConfig> {
8586 difficulty : inquire:: Text :: new ( "Difficulty class:" )
8687 . with_validator ( inquire:: required!( "Please provide a name." ) )
8788 . with_help_message ( "The name of the difficulty class." )
88- . with_placeholder ( example_values:: POINTS_DIFFICULTY )
89+ . with_placeholder ( example_values:: POINTS_EASY_DIFFICULTY )
8990 . prompt ( ) ?,
9091 min : inquire:: CustomType :: < i64 > :: new ( "Minimum points:" )
9192 . with_error_message ( "Please type a valid number." ) // default parser calls std::u64::from_str
9293 . with_help_message ( "The minimum number of points that challenges within this difficulty class are worth." ) // too long to format
93- . with_default ( example_values:: POINTS_MIN )
94+ . with_default ( example_values:: POINTS_EASY_MIN )
9495 . prompt ( ) ?,
9596 max : inquire:: CustomType :: < i64 > :: new ( "Maximum points:" )
9697 . with_error_message ( "Please type a valid number." ) // default parser calls std::u64::from_str
9798 . with_help_message ( "The maximum number of points that challenges within this difficulty class are worth." ) // too long to format
98- . with_default ( example_values:: POINTS_MAX )
99+ . with_default ( example_values:: POINTS_EASY_MAX )
99100 . prompt ( ) ?,
100101 } ;
101102 points. push ( points_obj) ;
@@ -265,19 +266,44 @@ pub fn example_init() -> config::RcdsConfig {
265266 memory : example_values:: DEFAULTS_RESOURCES_MEMORY . to_string ( ) ,
266267 } ,
267268 } ,
268- points : vec ! [ config:: ChallengePoints {
269- difficulty: example_values:: POINTS_DIFFICULTY . to_string( ) ,
270- min: example_values:: POINTS_MIN ,
271- max: example_values:: POINTS_MAX ,
272- } ] ,
269+ points : vec ! [
270+ config:: ChallengePoints {
271+ difficulty: example_values:: POINTS_EASY_DIFFICULTY . to_string( ) ,
272+ min: example_values:: POINTS_EASY_MIN ,
273+ max: example_values:: POINTS_EASY_MAX ,
274+ } ,
275+ config:: ChallengePoints {
276+ difficulty: example_values:: POINTS_HARD_DIFFICULTY . to_string( ) ,
277+ min: example_values:: POINTS_HARD_MIN ,
278+ max: example_values:: POINTS_HARD_MAX ,
279+ } ,
280+ ] ,
273281
274282 deploy : HashMap :: from ( [ (
275283 example_values:: PROFILES_PROFILE_NAME . to_string ( ) ,
276284 config:: ProfileDeploy {
277285 challenges : HashMap :: new ( ) ,
278286 } ,
279287 ) ] ) ,
280- profiles : HashMap :: from ( [ ] ) ,
288+
289+ profiles : HashMap :: from ( [ (
290+ example_values:: PROFILES_PROFILE_NAME . to_string ( ) ,
291+ ProfileConfig {
292+ frontend_url : example_values:: PROFILES_FRONTEND_URL . to_string ( ) ,
293+ frontend_token : example_values:: PROFILES_FRONTEND_TOKEN . to_string ( ) ,
294+ challenges_domain : example_values:: PROFILES_CHALLENGES_DOMAIN . to_string ( ) ,
295+ kubeconfig : None ,
296+ kubecontext : example_values:: PROFILES_KUBECONTEXT . to_string ( ) ,
297+ s3 : S3Config {
298+ bucket_name : example_values:: PROFILES_S3_BUCKET_NAME . to_string ( ) ,
299+ endpoint : example_values:: PROFILES_S3_ENDPOINT . to_string ( ) ,
300+ region : example_values:: PROFILES_S3_REGION . to_string ( ) ,
301+ access_key : example_values:: PROFILES_S3_ACCESSKEY . to_string ( ) ,
302+ secret_key : example_values:: PROFILES_S3_SECRETACCESSKEY . to_string ( ) ,
303+ } ,
304+ dns : Value :: Null ,
305+ } ,
306+ ) ] ) ,
281307 }
282308}
283309
0 commit comments