mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 21:23:12 +01:00
feat: migrato to string
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
This commit is contained in:
parent
1003a3e6a7
commit
877e80572d
@ -52,9 +52,10 @@ func NewCmd() *cobra.Command {
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().Bool("pprof-server",
|
||||
false,
|
||||
"If true it will start a pprof debug http server on localhost:6061. Defaults to false.",
|
||||
cmd.Flags().String("pprof-server",
|
||||
"",
|
||||
"The address where pprof server should be exposed, for example: 0.0.0.0:6061. "+
|
||||
"Empty string means disabled. Disabled by default",
|
||||
)
|
||||
_ = viper.BindPFlag("pprof-server", cmd.Flags().Lookup("pprof-server"))
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ func Start(ctx context.Context) error {
|
||||
namespace := viper.GetString("namespace")
|
||||
|
||||
controllerOptions := ctrl.Options{
|
||||
PprofBindAddress: getPprofServerAddress(),
|
||||
PprofBindAddress: viper.GetString("pprof-server"),
|
||||
Scheme: scheme,
|
||||
Client: client.Options{
|
||||
// Important: the caching options below are used by
|
||||
@ -149,11 +149,3 @@ func generateScheme(ctx context.Context) *runtime.Scheme {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func getPprofServerAddress() string {
|
||||
if viper.GetBool("pprof-server") {
|
||||
return "0.0.0.0:6061"
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
@ -77,10 +77,11 @@ For a complete list of supported options, refer to the
|
||||
|
||||
## Enable the pprof debug server for the sidecar
|
||||
|
||||
You can enable the instance sidecar's pprof debug HTTP server by adding the `--pprof-server` flag to the container's
|
||||
arguments via `.spec.instanceSidecarConfiguration.additionalContainerArgs` in the `ObjectStore` resource.
|
||||
You can enable the instance sidecar's pprof debug HTTP server by adding the `--pprof-server=<address>` flag to the container's
|
||||
arguments via `.spec.instanceSidecarConfiguration.additionalContainerArgs`.
|
||||
|
||||
This starts a pprof server on port 6061 inside the Pod.
|
||||
Pass a bind address in the form `<host>:<port>` (for example, `0.0.0.0:6061`).
|
||||
An empty value disables the server (disabled by default).
|
||||
|
||||
### Example
|
||||
|
||||
@ -92,5 +93,5 @@ metadata:
|
||||
spec:
|
||||
instanceSidecarConfiguration:
|
||||
additionalContainerArgs:
|
||||
- "--pprof-server"
|
||||
- "--pprof-server=0.0.0.0:6061"
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user