Skip to content

Commit 8363f7a

Browse files
authored
Make powervs debug log optional (#509)
1 parent ca0c351 commit 8363f7a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cloud/scope/powervs_cluster.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ import (
4040
servicesutils "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/utils"
4141
)
4242

43+
const (
44+
DEBUGLEVEL = 5
45+
)
46+
4347
// PowerVSClusterScopeParams defines the input parameters used to create a new PowerVSClusterScope.
4448
type PowerVSClusterScopeParams struct {
4549
Client client.Client
@@ -104,7 +108,7 @@ func NewPowerVSClusterScope(params PowerVSClusterScopeParams) (*PowerVSClusterSc
104108

105109
options := powervs.ServiceOptions{
106110
PIOptions: &ibmpisession.PIOptions{
107-
Debug: true,
111+
Debug: params.Logger.V(DEBUGLEVEL).Enabled(),
108112
UserAccount: account,
109113
Region: region,
110114
Zone: *res.RegionID,

cloud/scope/powervs_machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func NewPowerVSMachineScope(params PowerVSMachineScopeParams) (*PowerVSMachineSc
121121

122122
options := powervs.ServiceOptions{
123123
PIOptions: &ibmpisession.PIOptions{
124-
Debug: true,
124+
Debug: params.Logger.V(DEBUGLEVEL).Enabled(),
125125
UserAccount: account,
126126
Region: region,
127127
Zone: *res.RegionID,

0 commit comments

Comments
 (0)