Skip to content

Commit

Permalink
Make ProviderConfigFromMachine private
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvagabund committed Jan 7, 2019
1 parent 0cf4e1b commit 4198bc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/actuators/machine/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/actuators/machine/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4198bc3

Please sign in to comment.