Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust/stackablectl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ All notable changes to this project will be documented in this file.
- Add confirmation prompt to `install` subcommand for namespace selection ([#429]).
- Add `--assume-yes` option for running commands non-interactively ([#429]).
- Support Helm charts sourced from OCI registries in demo/stack manifests ([#440]).
- Abort early if `uninstall` is issued for `default` namespace ([#442]).
Comment thread
sweb marked this conversation as resolved.

[#429]: https://github.com/stackabletech/stackable-cockpit/pull/429
[#438]: https://github.com/stackabletech/stackable-cockpit/pull/438
[#440]: https://github.com/stackabletech/stackable-cockpit/pull/440
[#442]: https://github.com/stackabletech/stackable-cockpit/pull/442

## [1.4.0] - 2026-03-18

Expand Down
12 changes: 12 additions & 0 deletions rust/stackablectl/src/cmds/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ pub enum CmdError {
demo_name: String,
},

#[snafu(display(
"demo {demo_name:?} cannot be uninstalled from the {DEFAULT_NAMESPACE:?} namespace, because Kubernetes does not allow deleting it. Pass --namespace <NAMESPACE> if the demo was installed in a different namespace, or delete the demo's resources manually"
))]
UninstallFromDefaultNamespace { demo_name: String },

#[snafu(display("failed to build labels for demo resources"))]
BuildLabels { source: LabelError },

Expand Down Expand Up @@ -525,6 +530,13 @@ async fn uninstall_cmd(
// Init result output and progress output
let mut output = Cli::result();

ensure!(
args.namespaces.namespace != DEFAULT_NAMESPACE,
UninstallFromDefaultNamespaceSnafu {
demo_name: args.demo_name.clone(),
}
);

let proceed_with_uninstall = args.prompt_args.assume_yes
|| {
tracing_indicatif::suspend_tracing_indicatif(|| -> Result<bool, CmdError> {
Expand Down
12 changes: 12 additions & 0 deletions rust/stackablectl/src/cmds/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ pub enum CmdError {
stack_name: String,
},

#[snafu(display(
"stack {stack_name:?} cannot be uninstalled from the {DEFAULT_NAMESPACE:?} namespace, because Kubernetes does not allow deleting it. Pass --namespace <NAMESPACE> if the stack was installed in a different namespace, or delete the stack's resources manually"
))]
UninstallFromDefaultNamespace { stack_name: String },

#[snafu(display("failed to build labels for stack resources"))]
BuildLabels { source: LabelError },

Expand Down Expand Up @@ -496,6 +501,13 @@ async fn uninstall_cmd(
) -> Result<String, CmdError> {
let mut output = Cli::result();

ensure!(
args.namespaces.namespace != DEFAULT_NAMESPACE,
UninstallFromDefaultNamespaceSnafu {
stack_name: args.stack_name.clone(),
}
);

let proceed_with_uninstall = args.prompt_args.assume_yes
|| tracing_indicatif::suspend_tracing_indicatif(|| -> Result<bool, CmdError> {
Confirm::new()
Expand Down
Loading