@@ -31,6 +31,7 @@ import (
31
31
"k8s.io/client-go/tools/record"
32
32
"k8s.io/klog"
33
33
34
+ clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
34
35
machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
35
36
clustererror "github.com/openshift/cluster-api/pkg/controller/error"
36
37
apierrors "github.com/openshift/cluster-api/pkg/errors"
@@ -104,7 +105,7 @@ func (a *Actuator) handleMachineError(machine *machinev1.Machine, err *apierrors
104
105
}
105
106
106
107
// Create runs a new EC2 instance
107
- func (a * Actuator ) Create (context context.Context , cluster * machinev1 .Cluster , machine * machinev1.Machine ) error {
108
+ func (a * Actuator ) Create (context context.Context , cluster * clusterv1 .Cluster , machine * machinev1.Machine ) error {
108
109
glog .Info ("creating machine" )
109
110
instance , err := a .CreateMachine (cluster , machine )
110
111
if err != nil {
@@ -175,7 +176,7 @@ func (a *Actuator) updateMachineProviderConditions(machine *machinev1.Machine, c
175
176
}
176
177
177
178
// CreateMachine starts a new AWS instance as described by the cluster and machine resources
178
- func (a * Actuator ) CreateMachine (cluster * machinev1 .Cluster , machine * machinev1.Machine ) (* ec2.Instance , error ) {
179
+ func (a * Actuator ) CreateMachine (cluster * clusterv1 .Cluster , machine * machinev1.Machine ) (* ec2.Instance , error ) {
179
180
machineProviderConfig , err := providerConfigFromMachine (machine , a .codec )
180
181
if err != nil {
181
182
return nil , a .handleMachineError (machine , apierrors .InvalidMachineConfiguration ("error decoding MachineProviderConfig: %v" , err ), createEventAction )
@@ -239,7 +240,7 @@ func (a *Actuator) CreateMachine(cluster *machinev1.Cluster, machine *machinev1.
239
240
}
240
241
241
242
// Delete deletes a machine and updates its finalizer
242
- func (a * Actuator ) Delete (context context.Context , cluster * machinev1 .Cluster , machine * machinev1.Machine ) error {
243
+ func (a * Actuator ) Delete (context context.Context , cluster * clusterv1 .Cluster , machine * machinev1.Machine ) error {
243
244
glog .Info ("deleting machine" )
244
245
if err := a .DeleteMachine (cluster , machine ); err != nil {
245
246
glog .Errorf ("error deleting machine: %v" , err )
@@ -259,7 +260,7 @@ func (gl *glogLogger) Logf(format string, v ...interface{}) {
259
260
}
260
261
261
262
// DeleteMachine deletes an AWS instance
262
- func (a * Actuator ) DeleteMachine (cluster * machinev1 .Cluster , machine * machinev1.Machine ) error {
263
+ func (a * Actuator ) DeleteMachine (cluster * clusterv1 .Cluster , machine * machinev1.Machine ) error {
263
264
machineProviderConfig , err := providerConfigFromMachine (machine , a .codec )
264
265
if err != nil {
265
266
return a .handleMachineError (machine , apierrors .InvalidMachineConfiguration ("error decoding MachineProviderConfig: %v" , err ), deleteEventAction )
@@ -299,7 +300,7 @@ func (a *Actuator) DeleteMachine(cluster *machinev1.Cluster, machine *machinev1.
299
300
// Update attempts to sync machine state with an existing instance. Today this just updates status
300
301
// for details that may have changed. (IPs and hostnames) We do not currently support making any
301
302
// changes to actual machines in AWS. Instead these will be replaced via MachineDeployments.
302
- func (a * Actuator ) Update (context context.Context , cluster * machinev1 .Cluster , machine * machinev1.Machine ) error {
303
+ func (a * Actuator ) Update (context context.Context , cluster * clusterv1 .Cluster , machine * machinev1.Machine ) error {
303
304
glog .Info ("updating machine" )
304
305
305
306
machineProviderConfig , err := providerConfigFromMachine (machine , a .codec )
@@ -373,7 +374,7 @@ func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, m
373
374
374
375
// Exists determines if the given machine currently exists. For AWS we query for instances in
375
376
// running state, with a matching name tag, to determine a match.
376
- func (a * Actuator ) Exists (context context.Context , cluster * machinev1 .Cluster , machine * machinev1.Machine ) (bool , error ) {
377
+ func (a * Actuator ) Exists (context context.Context , cluster * clusterv1 .Cluster , machine * machinev1.Machine ) (bool , error ) {
377
378
glog .Info ("Checking if machine exists" )
378
379
379
380
instances , err := a .getMachineInstances (cluster , machine )
@@ -392,7 +393,7 @@ func (a *Actuator) Exists(context context.Context, cluster *machinev1.Cluster, m
392
393
}
393
394
394
395
// Describe provides information about machine's instance(s)
395
- func (a * Actuator ) Describe (cluster * machinev1 .Cluster , machine * machinev1.Machine ) (* ec2.Instance , error ) {
396
+ func (a * Actuator ) Describe (cluster * clusterv1 .Cluster , machine * machinev1.Machine ) (* ec2.Instance , error ) {
396
397
glog .Infof ("Checking if machine exists" )
397
398
398
399
instances , err := a .getMachineInstances (cluster , machine )
@@ -408,7 +409,7 @@ func (a *Actuator) Describe(cluster *machinev1.Cluster, machine *machinev1.Machi
408
409
return instances [0 ], nil
409
410
}
410
411
411
- func (a * Actuator ) getMachineInstances (cluster * machinev1 .Cluster , machine * machinev1.Machine ) ([]* ec2.Instance , error ) {
412
+ func (a * Actuator ) getMachineInstances (cluster * clusterv1 .Cluster , machine * machinev1.Machine ) ([]* ec2.Instance , error ) {
412
413
machineProviderConfig , err := providerConfigFromMachine (machine , a .codec )
413
414
if err != nil {
414
415
glog .Errorf ("Error decoding MachineProviderConfig: %v" , err )
0 commit comments