Skip to content

Commit 14f9f7b

Browse files
committed
add assume-yes argument and some small fixes
1 parent 55eeceb commit 14f9f7b

10 files changed

Lines changed: 105 additions & 22 deletions

File tree

extra/completions/_stackablectl

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/completions/stackablectl.bash

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/completions/stackablectl.elv

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/completions/stackablectl.fish

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/completions/stackablectl.nu

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/stackable-cockpit/src/utils/k8s/client.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use snafu::{OptionExt, ResultExt, Snafu};
55
use stackable_operator::{
66
crd::listener::v1alpha1::Listener,
77
k8s_openapi::{
8+
Resource,
89
api::{
910
apps::v1::{Deployment, StatefulSet},
1011
core::v1::{Endpoints, Namespace, Node, Secret, Service},
@@ -382,7 +383,10 @@ impl Client {
382383
api_resource: &ApiResource,
383384
namespace: Option<&str>,
384385
) -> Result<(), Error> {
385-
Span::current().pb_set_message(&format!("Deleting {} {}", api_resource.kind, object_name));
386+
Span::current().pb_set_message(&format!(
387+
"Deleting {kind} {object_name}",
388+
kind = api_resource.kind
389+
));
386390

387391
let object_api = match namespace {
388392
Some(namespace) => {
@@ -573,9 +577,12 @@ impl Client {
573577
}
574578

575579
/// Deletes a [`Namespace`] with `name` in the cluster.
580+
#[instrument(skip_all, fields(indicatif.pb_show = true))]
576581
pub async fn delete_namespace(&self, name: String) -> Result<()> {
577582
let namespace_api: Api<Namespace> = Api::all(self.client.clone());
578583

584+
Span::current().pb_set_message(&format!("Deleting {kind} {name}", kind = Namespace::KIND));
585+
579586
kube::runtime::wait::delete::delete_and_finalize(
580587
namespace_api,
581588
&name,

rust/stackablectl/src/args/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ mod cluster;
22
mod file;
33
mod namespace;
44
mod operator_configs;
5+
mod prompt;
56
mod repo;
67

78
pub use cluster::*;
89
pub use file::*;
910
pub use namespace::*;
1011
pub use operator_configs::*;
12+
pub use prompt::*;
1113
pub use repo::*;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use clap::Args;
2+
3+
#[derive(Debug, Args)]
4+
#[command(next_help_heading = "Prompt options")]
5+
pub struct CommonPromptArgs {
6+
/// Assume "yes" as answer to all prompts and run non-interactively
7+
#[arg(long, visible_aliases(["yes"]), short = 'y', global = true)]
8+
pub assume_yes: bool,
9+
}

0 commit comments

Comments
 (0)