Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Adds logr as dependency

Signed-off-by: Chuck Ha <[email protected]>

* Use logr in the cluster actuator

This only creates the logger. Does not yet swap out actual klog calls.

Signed-off-by: Chuck Ha <[email protected]>

* update bazel

Signed-off-by: Chuck Ha <[email protected]>

* update

Signed-off-by: Chuck Ha <[email protected]>
  • Loading branch information
chuckha authored and detiber committed May 2, 2019
1 parent 4de10ce commit 613f5a1
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func main() {

// Initialize cluster actuator.
clusterActuator := cluster.NewActuator(cluster.ActuatorParams{
Client: cs.ClusterV1alpha1(),
Client: cs.ClusterV1alpha1(),
LoggingContext: "[cluster actuator]",
})

// Initialize machine actuator.
Expand Down
2 changes: 2 additions & 0 deletions pkg/cloud/aws/actuators/cluster/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ go_library(
"//pkg/cloud/aws/services/ec2:go_default_library",
"//pkg/cloud/aws/services/elb:go_default_library",
"//pkg/deployer:go_default_library",
"//vendor/github.com/go-logr/logr:go_default_library",
"//vendor/github.com/pkg/errors:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/klog/klogr:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/controller/error:go_default_library",
Expand Down
7 changes: 6 additions & 1 deletion pkg/cloud/aws/actuators/cluster/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ limitations under the License.
package cluster

import (
"github.com/go-logr/logr"
"github.com/pkg/errors"
"k8s.io/klog"
"k8s.io/klog/klogr"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/certificates"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/ec2"
Expand All @@ -37,18 +39,21 @@ type Actuator struct {
*deployer.Deployer

client client.ClusterV1alpha1Interface
log logr.Logger
}

// ActuatorParams holds parameter information for Actuator
type ActuatorParams struct {
Client client.ClusterV1alpha1Interface
Client client.ClusterV1alpha1Interface
LoggingContext string
}

// NewActuator creates a new Actuator
func NewActuator(params ActuatorParams) *Actuator {
return &Actuator{
Deployer: deployer.New(deployer.Params{ScopeGetter: actuators.DefaultScopeGetter}),
client: params.Client,
log: klogr.New().WithName(params.LoggingContext),
}
}

Expand Down
13 changes: 13 additions & 0 deletions vendor/k8s.io/klog/klogr/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/k8s.io/klog/klogr/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

147 changes: 147 additions & 0 deletions vendor/k8s.io/klog/klogr/klogr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 613f5a1

Please sign in to comment.