Skip to content

Commit

Permalink
eks: Add check for provisioning cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
ecpullen committed Jan 23, 2024
1 parent e40e6ab commit e17f596
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub struct ProductionMemo {

// The role arn that is being assumed.
pub assume_role: Option<String>,

pub provisioning_started: bool,
}

impl Configuration for ProductionMemo {}
Expand Down Expand Up @@ -380,6 +382,7 @@ impl Create for EksCreator {
if do_create {
info!("Creating cluster with eksctl");
memo.current_status = "Creating cluster".to_string();
memo.provisioning_started = true;
client
.send_info(memo.clone())
.await
Expand Down Expand Up @@ -897,8 +900,12 @@ impl Destroy for EksDestroyer {
.await
.context(Resources::Remaining, "Unable to get info from client")?;

if !memo.provisioning_started {
return Ok(());
}

let cluster_name = match &memo.cluster_name {
Some(x) => x,
Some(cluster_name) => cluster_name,
None => {
return Err(ProviderError::new_with_context(
Resources::Unknown,
Expand Down

0 comments on commit e17f596

Please sign in to comment.