@@ -236,6 +236,15 @@ func (impl LifecycleImplementation) collectAdditionalInstanceArgs(
236236 ctx context.Context ,
237237 pluginConfiguration * config.PluginConfiguration ,
238238) ([]string , error ) {
239+ collectTypedAdditionalArgs := func (store * barmancloudv1.ObjectStore ) []string {
240+ var args []string
241+ if len (store .Spec .InstanceSidecarConfiguration .LogLevel ) > 0 {
242+ args = append (args , "--log-level" , store .Spec .InstanceSidecarConfiguration .LogLevel )
243+ }
244+
245+ return args
246+ }
247+
239248 // Prefer the cluster object store (backup/archive). If not set, fallback to the recovery object store.
240249 // If neither is configured, no additional args are provided.
241250 if len (pluginConfiguration .BarmanObjectName ) > 0 {
@@ -244,7 +253,11 @@ func (impl LifecycleImplementation) collectAdditionalInstanceArgs(
244253 return nil , fmt .Errorf ("while getting barman object store %s: %w" ,
245254 pluginConfiguration .GetBarmanObjectKey ().String (), err )
246255 }
247- return barmanObjectStore .Spec .InstanceSidecarConfiguration .AdditionalContainerArgs , nil
256+ args := append (
257+ barmanObjectStore .Spec .InstanceSidecarConfiguration .AdditionalContainerArgs ,
258+ collectTypedAdditionalArgs (& barmanObjectStore )... ,
259+ )
260+ return args , nil
248261 }
249262
250263 if len (pluginConfiguration .RecoveryBarmanObjectName ) > 0 {
@@ -253,7 +266,11 @@ func (impl LifecycleImplementation) collectAdditionalInstanceArgs(
253266 return nil , fmt .Errorf ("while getting recovery barman object store %s: %w" ,
254267 pluginConfiguration .GetRecoveryBarmanObjectKey ().String (), err )
255268 }
256- return barmanObjectStore .Spec .InstanceSidecarConfiguration .AdditionalContainerArgs , nil
269+ args := append (
270+ barmanObjectStore .Spec .InstanceSidecarConfiguration .AdditionalContainerArgs ,
271+ collectTypedAdditionalArgs (& barmanObjectStore )... ,
272+ )
273+ return args , nil
257274 }
258275
259276 return nil , nil
0 commit comments