Skip to content

Commit 0346bf3

Browse files
cacama-valvatadetjensrobert
authored andcommitted
init command, lump external-dns configuration options into 'not our problem' style
1 parent 082ae15 commit 0346bf3

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

src/asset_files/rcds.yaml.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ profiles:
4040
access_key: {{ prof.s3_accesskey }}
4141
secret_key: {{ prof.s3_secretaccesskey }}
4242
dns:
43-
provider: {{ prof.dns_provider }}
44-
{{ prof.dns_provider }}:
45-
# TODO: provider-specific external-dns
46-
{% endfor %}
43+
# Place external-dns configuration options here;
44+
# this yaml will be passed directly to external-dns without modification
45+
# Reference: https://github.com/bitnami/charts/tree/main/bitnami/external-dns
46+
{% endfor %}

src/commands/init.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub fn run(_interactive: &bool, _blank: &bool) {
2323
options = init::example_init();
2424
}
2525

26-
// TODO write to disk
2726
let configuration = templatize_init(options);
2827
let mut f = match File::create("rcds.yaml") {
2928
Ok(t) => t,
@@ -39,4 +38,8 @@ pub fn run(_interactive: &bool, _blank: &bool) {
3938
exit(1);
4039
}
4140
}
41+
42+
// Note about external-dns
43+
println!("Note: external-dns configuration settings will need to be provided in rcds.yaml after file creation, under the `profiles.name.dns` key.");
44+
println!("Reference: https://github.com/bitnami/charts/tree/main/bitnami/external-dns");
4245
}

src/init/mod.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ pub struct profile {
5050
pub s3_region: String,
5151
pub s3_accesskey: String,
5252
pub s3_secretaccesskey: String,
53-
// TODO external dns garbage
54-
pub dns_provider: String,
55-
// dns_provider_values: HashMap<String, String>
56-
// dns_txtOwnerId: Option<
5753
}
5854

5955
pub fn interactive_init() -> inquire::error::InquireResult<init_vars> {
@@ -256,13 +252,6 @@ pub fn interactive_init() -> inquire::error::InquireResult<init_vars> {
256252
.with_help_message("The secret acess key to the S3 bucket.")
257253
.prompt()?
258254
},
259-
dns_provider: {
260-
// TODO : literally all of the external DNS settings
261-
inquire::Text::new("DNS provider:")
262-
.with_help_message("The name of the cloud DNS provider being used.")
263-
.with_placeholder("route53")
264-
.prompt()?
265-
},
266255
};
267256
profiles.push(prof);
268257

@@ -303,7 +292,6 @@ pub fn blank_init() -> init_vars {
303292
s3_region: String::new(),
304293
s3_accesskey: String::new(),
305294
s3_secretaccesskey: String::new(),
306-
dns_provider: String::from("aws"),
307295
}],
308296
};
309297
}
@@ -333,16 +321,15 @@ pub fn example_init() -> init_vars {
333321
],
334322
profiles: vec![profile {
335323
profile_name: String::from("default"),
336-
frontend_url: String::from("https://ctf.coolguy.xyz"),
324+
frontend_url: String::from("https://ctf.coolguy.invalid"),
337325
frontend_token: String::from("secretsecretsecret"),
338-
challenges_domain: String::from("chals.coolguy.xyz"),
326+
challenges_domain: String::from("chals.coolguy.invalid"),
339327
kubecontext: String::from("ctf-cluster"),
340328
s3_bucket_name: String::from("ctf-bucket"),
341-
s3_endpoint: String::from("s3.coolguy.xyz"),
329+
s3_endpoint: String::from("s3.coolguy.invalid"),
342330
s3_region: String::from("us-west-2"),
343331
s3_accesskey: String::from("accesskey"),
344332
s3_secretaccesskey: String::from("secretkey"),
345-
dns_provider: String::from("aws"),
346333
}],
347334
};
348335
}

0 commit comments

Comments
 (0)