Skip to content

Commit

Permalink
Add fallback to metadata name for stack name
Browse files Browse the repository at this point in the history
The stack name used for Logging in and Updating now falls back to the metadata name if not specified explicitly in the pulumi_stack specification. This change is intended to prevent failure of these actions if stack name is not specified in pulumi_stack spec.
  • Loading branch information
jan-br committed Sep 22, 2023
1 parent 3b80c30 commit 09af387
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pulumi-operator-kubernetes-job/src/pulumi_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ impl PulumiExecution {
}
}

let stack_name = pulumi_stack
.spec
.stack_name
.clone()
.unwrap_or(pulumi_stack.metadata.name.clone().unwrap());

pulumi
.login(LoginOptions {
url: inner_stack_auth.backend,
Expand All @@ -148,13 +154,13 @@ impl PulumiExecution {

pulumi
.cancel(CancelOptions {
stack: pulumi_stack.spec.stack_name.clone(),
stack: Some(stack_name.clone()),
})
.await;

let exit = pulumi
.up(UpOptions {
stack: pulumi_stack.spec.stack_name.clone(),
stack: Some(stack_name.clone()),
..Default::default()
})
.await;
Expand Down

0 comments on commit 09af387

Please sign in to comment.