@@ -3,7 +3,7 @@ use std::collections::HashMap;
33use indicatif:: ProgressStyle ;
44use snafu:: { ResultExt , Snafu } ;
55use stackable_operator:: kvp:: Labels ;
6- use tracing:: { debug , info , info_span , instrument , Instrument as _ , Span } ;
6+ use tracing:: { Instrument as _ , Span , debug , info , info_span , instrument } ;
77use tracing_indicatif:: span_ext:: IndicatifSpanExt as _;
88
99use crate :: {
@@ -77,7 +77,8 @@ pub trait InstallManifestsExt {
7777 debug ! ( "Installing manifests" ) ;
7878
7979 Span :: current ( ) . pb_set_style (
80- & ProgressStyle :: with_template ( "Progress: {wide_bar} {pos}/{len}" ) . expect ( "valid progress template" )
80+ & ProgressStyle :: with_template ( "Progress: {wide_bar} {pos}/{len}" )
81+ . expect ( "valid progress template" ) ,
8182 ) ;
8283 Span :: current ( ) . pb_set_length ( manifests. len ( ) as u64 ) ;
8384
@@ -97,18 +98,25 @@ pub trait InstallManifestsExt {
9798 debug ! ( helm_file, "Installing manifest from Helm chart" ) ;
9899
99100 // Read Helm chart YAML and apply templating
100- let helm_file = helm_file. into_path_or_url ( ) . context ( ParsePathOrUrlSnafu {
101- path_or_url : helm_file. clone ( ) ,
102- } ) ?;
101+ let helm_file =
102+ helm_file. into_path_or_url ( ) . context ( ParsePathOrUrlSnafu {
103+ path_or_url : helm_file. clone ( ) ,
104+ } ) ?;
103105
104106 let helm_chart: helm:: Chart = transfer_client
105107 . get ( & helm_file, & Template :: new ( & parameters) . then ( Yaml :: new ( ) ) )
106108 . await
107109 . context ( FileTransferSnafu ) ?;
108110
109111 info ! ( helm_chart. name, helm_chart. version, "Installing Helm chart" , ) ;
110- Span :: current ( ) . pb_set_message ( format ! ( "Installing {name} Helm chart" , name = helm_chart. name) . as_str ( ) ) ;
111- Span :: current ( ) . pb_set_style ( & ProgressStyle :: with_template ( "{spinner} {msg}" ) . expect ( "valid progress template" ) ) ;
112+ Span :: current ( ) . pb_set_message (
113+ format ! ( "Installing {name} Helm chart" , name = helm_chart. name)
114+ . as_str ( ) ,
115+ ) ;
116+ Span :: current ( ) . pb_set_style (
117+ & ProgressStyle :: with_template ( "{spinner} {msg}" )
118+ . expect ( "valid progress template" ) ,
119+ ) ;
112120
113121 // Assumption: that all manifest helm charts refer to repos not registries
114122 helm:: add_repo ( & helm_chart. repo . name , & helm_chart. repo . url ) . context (
@@ -139,7 +147,10 @@ pub trait InstallManifestsExt {
139147 }
140148 ManifestSpec :: PlainYaml ( manifest_file) => {
141149 debug ! ( manifest_file, "Installing YAML manifest" ) ;
142- Span :: current ( ) . pb_set_style ( & ProgressStyle :: with_template ( "{spinner} Installing YAML manifest" ) . expect ( "valid progress template" ) ) ;
150+ Span :: current ( ) . pb_set_style (
151+ & ProgressStyle :: with_template ( "{spinner} Installing YAML manifest" )
152+ . expect ( "valid progress template" ) ,
153+ ) ;
143154
144155 // Read YAML manifest and apply templating
145156 let path_or_url =
@@ -162,8 +173,9 @@ pub trait InstallManifestsExt {
162173 }
163174
164175 Ok :: < ( ) , Error > ( ( ) )
165-
166- } . instrument ( span) . await ?;
176+ }
177+ . instrument ( span)
178+ . await ?;
167179
168180 Span :: current ( ) . pb_inc ( 1 ) ;
169181 }
0 commit comments