Skip to content

Commit 9f9b923

Browse files
committed
further uninstall adjustments
1 parent 0e0658f commit 9f9b923

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

rust/stackable-cockpit/src/platform/demo/spec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

rust/stackable-cockpit/src/platform/stack/params.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ pub struct StackInstallParameters {
2525
pub 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

rust/stackable-cockpit/src/platform/stack/spec.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

rust/stackablectl/src/cmds/stack.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)