Skip to content

Commit d03f548

Browse files
committed
refactor subscriber init
1 parent 6d80e34 commit d03f548

File tree

11 files changed

+30
-34
lines changed

11 files changed

+30
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl DemoSpec {
191191
transfer_client: &xfer::Client,
192192
) -> Result<(), Error> {
193193
info!("Installing demo manifests");
194-
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing manifests").expect("This is a valid progress template"));
194+
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing manifests").expect("valid progress template"));
195195

196196
let params = install_params
197197
.parameters

rust/stackable-cockpit/src/platform/manifests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub trait InstallManifestsExt {
7777
debug!("Installing manifests");
7878

7979
Span::current().pb_set_style(
80-
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("This is a valid progress template")
80+
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("valid progress template")
8181
);
8282
Span::current().pb_set_length(manifests.len() as u64);
8383

rust/stackable-cockpit/src/platform/operator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl OperatorSpec {
195195
) -> Result<(), helm::Error> {
196196
info!(operator = %self, "Installing operator");
197197
Span::current().pb_set_message(format!("Installing {}-operator", self.name).as_str());
198-
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} {msg}").expect("This is a valid progress template"));
198+
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} {msg}").expect("valid progress template"));
199199

200200
let version = self.version.as_ref().map(|v| v.to_string());
201201
let helm_name = self.helm_name();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl ReleaseSpec {
6565
) -> Result<()> {
6666
info!("Installing release");
6767
Span::current().pb_set_style(
68-
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("This is a valid progress template")
68+
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("valid progress template")
6969
);
7070

7171
include_products.iter().for_each(|product| {
@@ -125,7 +125,7 @@ impl ReleaseSpec {
125125
info!("Uninstalling release");
126126

127127
Span::current().pb_set_style(
128-
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("This is a valid progress template")
128+
&ProgressStyle::with_template("Progress: {wide_bar} {pos}/{len}").expect("valid progress template")
129129
);
130130
Span::current().pb_set_length(self.products.len() as u64);
131131

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl StackSpec {
205205
chart_source: &ChartSourceType,
206206
) -> Result<(), Error> {
207207
info!(self.release, "Trying to install release");
208-
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing operators").expect("This is a valid progress template"));
208+
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing operators").expect("valid progress template"));
209209

210210
// Get the release by name
211211
let release = release_list
@@ -229,7 +229,7 @@ impl StackSpec {
229229
transfer_client: &xfer::Client,
230230
) -> Result<(), Error> {
231231
info!("Installing stack manifests");
232-
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing manifests").expect("This is a valid progress template"));
232+
Span::current().pb_set_style(&ProgressStyle::with_template("{spinner} Installing manifests").expect("valid progress template"));
233233

234234
let parameters = install_params
235235
.parameters

rust/stackablectl/src/cmds/demo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl DemoArgs {
216216
async fn list_cmd(args: &DemoListArgs, cli: &Cli, list: demo::List) -> Result<String, CmdError> {
217217
info!("Listing demos");
218218
Span::current().pb_set_style(
219-
&ProgressStyle::with_template("{spinner} Fetching demo information").expect("This is a valid progress template")
219+
&ProgressStyle::with_template("{spinner} Fetching demo information").expect("valid progress template")
220220
);
221221

222222
match args.output_type {
@@ -271,7 +271,7 @@ async fn describe_cmd(
271271
) -> Result<String, CmdError> {
272272
info!(demo_name = %args.demo_name, "Describing demo");
273273
Span::current().pb_set_style(
274-
&ProgressStyle::with_template("{spinner} Fetching demo information").expect("This is a valid progress template")
274+
&ProgressStyle::with_template("{spinner} Fetching demo information").expect("valid progress template")
275275
);
276276

277277
let demo = list.get(&args.demo_name).ok_or(CmdError::NoSuchDemo {
@@ -336,7 +336,7 @@ async fn install_cmd(
336336
) -> Result<String, CmdError> {
337337
info!(demo_name = %args.demo_name, "Installing demo");
338338
Span::current()
339-
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing demo").expect("This is a valid progress template"));
339+
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing demo").expect("valid progress template"));
340340

341341
// Init result output and progress output
342342
let mut output = cli.result();

rust/stackablectl/src/cmds/operator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl OperatorArgs {
192192
async fn list_cmd(args: &OperatorListArgs, cli: &Cli) -> Result<String, CmdError> {
193193
debug!("Listing operators");
194194
Span::current().pb_set_style(
195-
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("This is a valid progress template")
195+
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("valid progress template")
196196
);
197197

198198
// Build map which maps artifacts to a chart source
@@ -252,7 +252,7 @@ async fn list_cmd(args: &OperatorListArgs, cli: &Cli) -> Result<String, CmdError
252252
async fn describe_cmd(args: &OperatorDescribeArgs, cli: &Cli) -> Result<String, CmdError> {
253253
debug!(operator_name = %args.operator_name, "Describing operator");
254254
Span::current().pb_set_style(
255-
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("This is a valid progress template")
255+
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("valid progress template")
256256
);
257257

258258
// Build map which maps artifacts to a chart source
@@ -314,7 +314,7 @@ async fn describe_cmd(args: &OperatorDescribeArgs, cli: &Cli) -> Result<String,
314314
async fn install_cmd(args: &OperatorInstallArgs, cli: &Cli) -> Result<String, CmdError> {
315315
info!("Installing operator(s)");
316316
Span::current()
317-
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing operator(s)").expect("This is a valid progress template"));
317+
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing operator(s)").expect("valid progress template"));
318318

319319
args.local_cluster
320320
.install_if_needed()
@@ -365,7 +365,7 @@ async fn install_cmd(args: &OperatorInstallArgs, cli: &Cli) -> Result<String, Cm
365365
fn uninstall_cmd(args: &OperatorUninstallArgs, cli: &Cli) -> Result<String, CmdError> {
366366
info!("Uninstalling operator(s)");
367367
Span::current()
368-
.pb_set_style(&ProgressStyle::with_template("{spinner} Uninstalling operator(s)").expect("This is a valid progress template"));
368+
.pb_set_style(&ProgressStyle::with_template("{spinner} Uninstalling operator(s)").expect("valid progress template"));
369369

370370
for operator in &args.operators {
371371
operator
@@ -397,7 +397,7 @@ fn uninstall_cmd(args: &OperatorUninstallArgs, cli: &Cli) -> Result<String, CmdE
397397
fn installed_cmd(args: &OperatorInstalledArgs, cli: &Cli) -> Result<String, CmdError> {
398398
info!("Listing installed operators");
399399
Span::current().pb_set_style(
400-
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("This is a valid progress template")
400+
&ProgressStyle::with_template("{spinner} Fetching operator information").expect("valid progress template")
401401
);
402402

403403
type ReleaseList = IndexMap<String, Release>;

rust/stackablectl/src/cmds/release.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async fn list_cmd(
160160
) -> Result<String, CmdError> {
161161
info!("Listing releases");
162162
Span::current().pb_set_style(
163-
&ProgressStyle::with_template("{spinner} Fetching release information").expect("This is a valid progress template")
163+
&ProgressStyle::with_template("{spinner} Fetching release information").expect("valid progress template")
164164
);
165165

166166
match args.output_type {
@@ -217,7 +217,7 @@ async fn describe_cmd(
217217
) -> Result<String, CmdError> {
218218
info!(release = %args.release, "Describing release");
219219
Span::current().pb_set_style(
220-
&ProgressStyle::with_template("{spinner} Fetching release information").expect("This is a valid progress template")
220+
&ProgressStyle::with_template("{spinner} Fetching release information").expect("valid progress template")
221221
);
222222

223223
let release = release_list.get(&args.release);
@@ -281,7 +281,7 @@ async fn install_cmd(
281281
) -> Result<String, CmdError> {
282282
info!(release = %args.release, "Installing release");
283283
Span::current()
284-
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing release").expect("This is a valid progress template"));
284+
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing release").expect("valid progress template"));
285285

286286
match release_list.get(&args.release) {
287287
Some(release) => {
@@ -332,7 +332,7 @@ async fn uninstall_cmd(
332332
release_list: release::ReleaseList,
333333
) -> Result<String, CmdError> {
334334
Span::current()
335-
.pb_set_style(&ProgressStyle::with_template("{spinner} Uninstalling release").expect("This is a valid progress template"));
335+
.pb_set_style(&ProgressStyle::with_template("{spinner} Uninstalling release").expect("valid progress template"));
336336

337337
match release_list.get(&args.release) {
338338
Some(release) => {

rust/stackablectl/src/cmds/stack.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn list_cmd(
202202
) -> Result<String, CmdError> {
203203
info!("Listing stacks");
204204
Span::current().pb_set_style(
205-
&ProgressStyle::with_template("{spinner} Fetching stack information").expect("This is a valid progress template")
205+
&ProgressStyle::with_template("{spinner} Fetching stack information").expect("valid progress template")
206206
);
207207

208208
match args.output_type {
@@ -255,7 +255,7 @@ fn describe_cmd(
255255
) -> Result<String, CmdError> {
256256
info!(stack_name = %args.stack_name, "Describing stack");
257257
Span::current().pb_set_style(
258-
&ProgressStyle::with_template("{spinner} Fetching stack information").expect("This is a valid progress template")
258+
&ProgressStyle::with_template("{spinner} Fetching stack information").expect("valid progress template")
259259
);
260260

261261
match stack_list.get(&args.stack_name) {
@@ -321,7 +321,7 @@ async fn install_cmd(
321321
) -> Result<String, CmdError> {
322322
info!(stack_name = %args.stack_name, "Installing stack");
323323
Span::current()
324-
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing stack").expect("This is a valid progress template"));
324+
.pb_set_style(&ProgressStyle::with_template("{spinner} Installing stack").expect("valid progress template"));
325325

326326
let files = cli.get_release_files().context(PathOrUrlParseSnafu)?;
327327
let release_list = release::ReleaseList::build(&files, transfer_client)

rust/stackablectl/src/cmds/stacklet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl StackletArgs {
9595
async fn list_cmd(args: &StackletListArgs, cli: &Cli) -> Result<String, CmdError> {
9696
info!("Listing installed stacklets");
9797
Span::current().pb_set_style(
98-
&ProgressStyle::with_template("{spinner} Fetching stacklet information").expect("This is a valid progress template")
98+
&ProgressStyle::with_template("{spinner} Fetching stacklet information").expect("valid progress template")
9999
);
100100

101101
let client = Client::new().await.context(KubeClientCreateSnafu)?;
@@ -211,7 +211,7 @@ async fn list_cmd(args: &StackletListArgs, cli: &Cli) -> Result<String, CmdError
211211
async fn credentials_cmd(args: &StackletCredentialsArgs) -> Result<String, CmdError> {
212212
info!("Displaying stacklet credentials");
213213
Span::current().pb_set_style(
214-
&ProgressStyle::with_template("{spinner} Fetching stacklet information").expect("This is a valid progress template")
214+
&ProgressStyle::with_template("{spinner} Fetching stacklet information").expect("valid progress template")
215215
);
216216

217217
let client = Client::new().await.context(KubeClientCreateSnafu)?;

0 commit comments

Comments
 (0)