From 4198bc3a0c3d6af47ff4c47b6f2c31a780a63bff Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 23 Dec 2018 16:46:59 +0100 Subject: [PATCH] Make ProviderConfigFromMachine private --- pkg/actuators/machine/actuator.go | 8 ++++---- pkg/actuators/machine/utils.go | 4 ++-- pkg/actuators/machine/utils_test.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/actuators/machine/actuator.go b/pkg/actuators/machine/actuator.go index c7f94d284b..437836acf8 100644 --- a/pkg/actuators/machine/actuator.go +++ b/pkg/actuators/machine/actuator.go @@ -170,7 +170,7 @@ func (a *Actuator) updateMachineProviderConditions(machine *clusterv1.Machine, c // CreateMachine starts a new AWS instance as described by the cluster and machine resources func (a *Actuator) CreateMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (*ec2.Instance, error) { - machineProviderConfig, err := ProviderConfigFromMachine(a.client, machine, a.codec) + machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { return nil, a.handleMachineError(machine, apierrors.InvalidMachineConfiguration("error decoding MachineProviderConfig: %v", err), createEventAction) } @@ -235,7 +235,7 @@ func (a *Actuator) Delete(context context.Context, cluster *clusterv1.Cluster, m // DeleteMachine deletes an AWS instance func (a *Actuator) DeleteMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { - machineProviderConfig, err := ProviderConfigFromMachine(a.client, machine, a.codec) + machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { return a.handleMachineError(machine, apierrors.InvalidMachineConfiguration("error decoding MachineProviderConfig: %v", err), deleteEventAction) } @@ -276,7 +276,7 @@ func (a *Actuator) DeleteMachine(cluster *clusterv1.Cluster, machine *clusterv1. func (a *Actuator) Update(context context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { glog.Info("updating machine") - machineProviderConfig, err := ProviderConfigFromMachine(a.client, machine, a.codec) + machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { return a.handleMachineError(machine, apierrors.InvalidMachineConfiguration("error decoding MachineProviderConfig: %v", err), noEventAction) } @@ -379,7 +379,7 @@ func (a *Actuator) Describe(cluster *clusterv1.Cluster, machine *clusterv1.Machi } func (a *Actuator) getMachineInstances(cluster *clusterv1.Cluster, machine *clusterv1.Machine) ([]*ec2.Instance, error) { - machineProviderConfig, err := ProviderConfigFromMachine(a.client, machine, a.codec) + machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { glog.Errorf("error decoding MachineProviderConfig: %v", err) return nil, err diff --git a/pkg/actuators/machine/utils.go b/pkg/actuators/machine/utils.go index 269daa27ad..d23dd295ae 100644 --- a/pkg/actuators/machine/utils.go +++ b/pkg/actuators/machine/utils.go @@ -136,9 +136,9 @@ func terminateInstances(client awsclient.Client, instances []*ec2.Instance) erro return nil } -// ProviderConfigFromMachine gets the machine provider config MachineSetSpec from the +// providerConfigFromMachine gets the machine provider config MachineSetSpec from the // specified cluster-api MachineSpec. -func ProviderConfigFromMachine(client client.Client, machine *clusterv1.Machine, codec *providerconfigv1.AWSProviderConfigCodec) (*providerconfigv1.AWSMachineProviderConfig, error) { +func providerConfigFromMachine(client client.Client, machine *clusterv1.Machine, codec *providerconfigv1.AWSProviderConfigCodec) (*providerconfigv1.AWSMachineProviderConfig, error) { var providerSpecRawExtention runtime.RawExtension // TODO(jchaloup): Remove providerConfig once all consumers migrate to providerSpec diff --git a/pkg/actuators/machine/utils_test.go b/pkg/actuators/machine/utils_test.go index 0e2b36a3c1..7018760ba9 100644 --- a/pkg/actuators/machine/utils_test.go +++ b/pkg/actuators/machine/utils_test.go @@ -114,7 +114,7 @@ func TestProviderConfigFromMachine(t *testing.T) { client := fake.NewFakeClient(machineClass) for _, tc := range testCases { - decodedProviderConfig, err := ProviderConfigFromMachine(client, tc.machine, codec) + decodedProviderConfig, err := providerConfigFromMachine(client, tc.machine, codec) if err != nil { t.Error(err) }