Skip to content

Commit

Permalink
Use InstanceState instead of String in Machine Status (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
liztio authored and k8s-ci-robot committed Feb 14, 2019
1 parent 878bae8 commit d11e7ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type AWSMachineProviderStatus struct {

// InstanceState is the state of the AWS instance for this machine
// +optional
InstanceState *string `json:"instanceState,omitempty"`
InstanceState *InstanceState `json:"instanceState,omitempty"`

// Conditions is a set of conditions associated with the Machine to indicate
// errors or other status
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/awsprovider/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/cloud/aws/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machi
}

scope.MachineStatus.InstanceID = &i.ID
scope.MachineStatus.InstanceState = aws.String(string(i.State))
scope.MachineStatus.InstanceState = &i.State

if machine.Annotations == nil {
machine.Annotations = map[string]string{}
Expand Down Expand Up @@ -406,6 +406,8 @@ func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machi
return false, nil
}

scope.MachineStatus.InstanceState = &instance.State

if err := a.reconcileLBAttachment(scope, machine, instance); err != nil {
return true, err
}
Expand Down

0 comments on commit d11e7ea

Please sign in to comment.