File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
stackable-cockpit/src/platform Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -224,8 +224,9 @@ impl DemoSpec {
224224 . into_params ( stack. parameters . clone ( ) )
225225 . context ( ParseParametersSnafu ) ?;
226226
227- // We add the STACK parameter, so that stacks can use that to render e.g. the stack label
227+ // We add the STACK and DEMO parameter, so that stacks can use that to render e.g. the stack label
228228 stack_parameters. insert ( "STACK" . to_owned ( ) , self . stack . clone ( ) ) ;
229+ stack_parameters. insert ( "DEMO" . to_owned ( ) , uninstall_parameters. demo_name . clone ( ) ) ;
229230
230231 Self :: uninstall_helm_manifests (
231232 & stack. manifests ,
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ pub struct StackInstallParameters {
2525pub struct StackUninstallParameters {
2626 pub stack_name : String ,
2727
28+ /// Optional name of the demo, which is only present in case this stack is uninstalled as part of
29+ /// a demo. This is unset in case a stack is uninstalled directly.
30+ pub demo_name : Option < String > ,
31+
2832 pub operator_namespace : String ,
2933 pub stack_namespace : String ,
3034
Original file line number Diff line number Diff line change @@ -220,8 +220,11 @@ impl StackSpec {
220220 . into_params ( self . parameters . clone ( ) )
221221 . context ( ParseParametersSnafu ) ?;
222222
223- // We add the STACK parameter, so that stacks can use that to render e.g. the stack label
223+ // We add the STACK and optionally DEMO parameter, so that stacks can use that to render e.g. the stack label
224224 parameters. insert ( "STACK" . to_owned ( ) , uninstall_parameters. stack_name . clone ( ) ) ;
225+ if let Some ( demo_name) = uninstall_parameters. demo_name {
226+ parameters. insert ( "DEMO" . to_owned ( ) , demo_name) ;
227+ }
225228
226229 Self :: uninstall_helm_manifests (
227230 & self . manifests ,
Original file line number Diff line number Diff line change @@ -497,6 +497,8 @@ async fn uninstall_cmd(
497497 release_list,
498498 StackUninstallParameters {
499499 stack_name : args. stack_name . clone ( ) ,
500+ // There is no demo when uninstalling only a stack
501+ demo_name : None ,
500502 operator_namespace : args. namespaces . operator_namespace . clone ( ) ,
501503 stack_namespace : args. namespaces . namespace . clone ( ) ,
502504 skip_operators : args. skip_operators_and_crds ,
You can’t perform that action at this time.
0 commit comments