Skip to content

Commit 7ff8b08

Browse files
Merge pull request #115 from ingvagabund/remove-any-usage-of-cluster-object
Remove any usage of cluster object in actuator
2 parents f3b594c + fa8621f commit 7ff8b08

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pkg/cloud/libvirt/actuators/machine/actuator.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ import (
3838
)
3939

4040
type errorWrapper struct {
41-
cluster *machinev1.Cluster
4241
machine *machinev1.Machine
4342
}
4443

4544
func (e *errorWrapper) Error(err error, message string) error {
46-
return fmt.Errorf("%s/%s: %s: %v", e.cluster.Name, e.machine.Name, message, err)
45+
return fmt.Errorf("%s: %s: %v", e.machine.Name, message, err)
4746
}
4847

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)