Skip to content

Commit

Permalink
Merge pull request #115 from ingvagabund/remove-any-usage-of-cluster-…
Browse files Browse the repository at this point in the history
…object

Remove any usage of cluster object in actuator
  • Loading branch information
openshift-merge-robot authored Feb 16, 2019
2 parents f3b594c + fa8621f commit 7ff8b08
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pkg/cloud/libvirt/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ import (
)

type errorWrapper struct {
cluster *machinev1.Cluster
machine *machinev1.Machine
}

func (e *errorWrapper) Error(err error, message string) error {
return fmt.Errorf("%s/%s: %s: %v", e.cluster.Name, e.machine.Name, message, err)
return fmt.Errorf("%s: %s: %v", e.machine.Name, message, err)
}

func (e *errorWrapper) WithLog(err error, message string) error {
Expand Down Expand Up @@ -110,8 +109,8 @@ func (a *Actuator) handleMachineError(machine *machinev1.Machine, err *apierrors

// Create creates a machine and is invoked by the Machine Controller
func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Creating machine %q for cluster %q.", machine.Name, cluster.Name)
errWrapper := errorWrapper{cluster: cluster, machine: machine}
glog.Infof("Creating machine %q", machine.Name)
errWrapper := errorWrapper{machine: machine}

machineProviderConfig, err := ProviderConfigMachine(a.codec, &machine.Spec)
if err != nil {
Expand Down Expand Up @@ -150,7 +149,7 @@ func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, m

// Delete deletes a machine and is invoked by the Machine Controller
func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Deleting machine %q for cluster %q.", machine.Name, cluster.Name)
glog.Infof("Deleting machine %q", machine.Name)

machineProviderConfig, err := ProviderConfigMachine(a.codec, &machine.Spec)
if err != nil {
Expand All @@ -177,8 +176,8 @@ func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, m

// Update updates a machine and is invoked by the Machine Controller
func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Updating machine %v for cluster %v.", machine.Name, cluster.Name)
errWrapper := errorWrapper{cluster: cluster, machine: machine}
glog.Infof("Updating machine %v", machine.Name)
errWrapper := errorWrapper{machine: machine}

client, err := a.clientForMachine(a.codec, machine)
if err != nil {
Expand All @@ -203,8 +202,8 @@ func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, m

// Exists test for the existance of a machine and is invoked by the Machine Controller
func (a *Actuator) Exists(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) (bool, error) {
glog.Infof("Checking if machine %v for cluster %v exists.", machine.Name, cluster.Name)
errWrapper := errorWrapper{cluster: cluster, machine: machine}
glog.Infof("Checking if machine %v exists.", machine.Name)
errWrapper := errorWrapper{machine: machine}

client, err := a.clientForMachine(a.codec, machine)
if err != nil {
Expand Down

0 comments on commit 7ff8b08

Please sign in to comment.