diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-07-25 19:23:10 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-07-25 19:23:10 -0400 |
| commit | a2e2df7c0f97633bba3a91981c4c1598a062aaac (patch) | |
| tree | cabee0ef8f1c7dc9cfcf7bf6f730703060a94499 | |
| parent | 2996d2b6268a320fafc512fcbee03a1b6182c521 (diff) | |
Further naming cleanup
| -rw-r--r-- | src/autoscaling.rs | 4 | ||||
| -rw-r--r-- | src/converge.rs | 4 | ||||
| -rw-r--r-- | src/ec2.rs | 12 | ||||
| -rw-r--r-- | src/route53.rs | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/autoscaling.rs b/src/autoscaling.rs index ac60613..024b556 100644 --- a/src/autoscaling.rs +++ b/src/autoscaling.rs @@ -6,7 +6,7 @@ use aws_sdk_autoscaling::types::{AutoScalingGroup, Instance, LifecycleState}; use aws_sdk_route53::types::ResourceRecordSet; use trust_dns_proto::rr::Name; -use crate::ec2::{instance_recordsets, Ec2}; +use crate::ec2::{instance_proposal, Ec2}; use crate::hashable::Hashable; pub trait AutoScaling { @@ -28,7 +28,7 @@ where .ok_or(anyhow!("Autoscaling group returned from AWS with no name"))?; let live_instance_ids = live_instance_ids(asg.instances()); let proposed = - instance_recordsets(aws_context, asg_name, dns_name, dns_ttl, &live_instance_ids).await?; + instance_proposal(aws_context, asg_name, dns_name, dns_ttl, &live_instance_ids).await?; Ok(proposed) } diff --git a/src/converge.rs b/src/converge.rs index e203a5a..d25a82b 100644 --- a/src/converge.rs +++ b/src/converge.rs @@ -9,7 +9,7 @@ use trust_dns_proto::rr::Name; use crate::autoscaling::{propose_asg_recordsets, AutoScaling}; use crate::ec2::Ec2; use crate::hashable::Hashable; -use crate::route53::{host_recordsets, zone_for_domain, Route53}; +use crate::route53::{zone_actual_recordsets, zone_for_domain, Route53}; #[derive(Debug)] pub struct Changes<T> { @@ -31,7 +31,7 @@ where let (proposed, actual) = try_join!( propose_asg_recordsets(aws_context, asg_name, dns_name, dns_ttl), - host_recordsets(aws_context, &zone.id, dns_name), + zone_actual_recordsets(aws_context, &zone.id, dns_name), )?; let changes = changes_for_records(&zone.id, &proposed, &actual); @@ -14,7 +14,7 @@ pub trait Ec2 { fn ec2(&self) -> &ec2::Client; } -pub async fn instance_recordsets<C>( +pub async fn instance_proposal<C>( aws_context: &C, asg_name: &str, dns_name: &Name, @@ -70,17 +70,17 @@ where } let dns_name = dns_name.to_ascii(); - let ip4_recordset = host_recordset(&dns_name, dns_ttl, RrType::A, ip4)?; - let ip6_recordset = host_recordset(&dns_name, dns_ttl, RrType::Aaaa, ip6)?; + let ip4_proposal = host_proposal(&dns_name, dns_ttl, RrType::A, ip4)?; + let ip6_proposal = host_proposal(&dns_name, dns_ttl, RrType::Aaaa, ip6)?; - Ok(ip4_recordset + Ok(ip4_proposal .into_iter() - .chain(ip6_recordset.into_iter()) + .chain(ip6_proposal.into_iter()) .map(Hashable::from) .collect()) } -fn host_recordset( +fn host_proposal( dns_name: &str, dns_ttl: i64, rr_type: RrType, diff --git a/src/route53.rs b/src/route53.rs index c89e699..e4379af 100644 --- a/src/route53.rs +++ b/src/route53.rs @@ -49,7 +49,7 @@ where zone.ok_or(anyhow!("No Route53 zone found for DNS suffix: {}", name)) } -pub async fn host_recordsets<C>( +pub async fn zone_actual_recordsets<C>( aws_context: &C, zone_id: &str, dns_name: &Name, |
