Skip to content

Commit

Permalink
enable debug logs for vpc and expose additional params
Browse files Browse the repository at this point in the history
Signed-off-by: Prajyot-Parab <[email protected]>
  • Loading branch information
Prajyot-Parab committed Apr 19, 2022
1 parent 3486841 commit 0aad73f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cloud/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ import (
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/record"
)

const (
// VPCDebugLevel indicates the debug level of the logs.
VPCDebugLevel = 5
)

// ClusterScopeParams defines the input parameters used to create a new ClusterScope.
type ClusterScopeParams struct {
IBMVPCClients
Expand Down Expand Up @@ -76,6 +81,10 @@ func NewClusterScope(params ClusterScopeParams, authenticator core.Authenticator
return nil, errors.Wrap(vpcErr, "failed to create IBM VPC session")
}

if core.GetLogger().GetLogLevel() != VPCDebugLevel {
core.SetLoggingLevel(VPCDebugLevel)
}

return &ClusterScope{
Logger: params.Logger,
client: params.Client,
Expand Down
4 changes: 4 additions & 0 deletions cloud/scope/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func NewMachineScope(params MachineScopeParams, authenticator core.Authenticator
return nil, errors.Wrap(vpcErr, "failed to create IBM VPC session")
}

if core.GetLogger().GetLogLevel() != VPCDebugLevel {
core.SetLoggingLevel(VPCDebugLevel)
}

return &MachineScope{
Logger: params.Logger,
client: params.Client,
Expand Down
8 changes: 8 additions & 0 deletions templates/cluster-template-powervs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ spec:
name: "${IBMPOWERVS_IMAGE_NAME}"
network:
name: "${IBMPOWERVS_NETWORK_NAME}"
memory: ${IBMPOWERVS_MEMORY:="4"}
processors: ${IBMPOWERVS_PROCESSORS:="0.25"}
sysType: ${IBMPOWERVS_SYSTYPE:="s922"}
procType: ${IBMPOWERVS_PROCTYPE:="shared"}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
Expand Down Expand Up @@ -199,6 +203,10 @@ spec:
name: "${IBMPOWERVS_IMAGE_NAME}"
network:
name: "${IBMPOWERVS_NETWORK_NAME}"
memory: ${IBMPOWERVS_MEMORY:="4"}
processors: ${IBMPOWERVS_PROCESSORS:="0.25"}
sysType: ${IBMPOWERVS_SYSTYPE:="s922"}
procType: ${IBMPOWERVS_PROCTYPE:="shared"}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
Expand Down

0 comments on commit 0aad73f

Please sign in to comment.