Skip to content

Commit ed187d0

Browse files
author
Joshua Reed
committed
Remove extraneous type.
1 parent cf36aa4 commit ed187d0

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

api/v1beta2/cloudstackmachine_types.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,18 @@ type CloudStackResourceDiskOffering struct {
109109
Label string `json:"label"`
110110
}
111111

112-
// TODO: Review the use of this field/type.
113-
type InstanceState string
114-
115112
// Type pulled mostly from the CloudStack API.
116113
type CloudStackMachineStatus struct {
117114
// Zone ID is used so that the zone can be computed once per reconcile and then propagate.
118115
// +optional
119-
ZoneID string `json:"zoneID,omitempty"`
116+
ZoneID string `json:"zoneID"`
120117

121118
// Addresses contains a CloudStack VM instance's IP addresses.
122-
Addresses []corev1.NodeAddress `json:"addresses,omitempty"`
119+
Addresses []corev1.NodeAddress `json:"addresses"`
123120

124121
// InstanceState is the state of the CloudStack instance for this machine.
125122
// +optional
126-
InstanceState InstanceState `json:"instanceState,omitempty"`
123+
InstanceState string `json:"instanceState"`
127124

128125
// InstanceStateLastUpdated is the time the instance state was last updated.
129126
// +optional

pkg/cloud/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func setMachineDataFromVMMetrics(vmResponse *cloudstack.VirtualMachinesMetric, c
4343
csMachine.Spec.ProviderID = pointer.StringPtr(fmt.Sprintf("cloudstack:///%s", vmResponse.Id))
4444
csMachine.Spec.InstanceID = pointer.StringPtr(vmResponse.Id)
4545
csMachine.Status.Addresses = []corev1.NodeAddress{{Type: corev1.NodeInternalIP, Address: vmResponse.Ipaddress}}
46-
newInstanceState := infrav1.InstanceState(vmResponse.State)
46+
newInstanceState := vmResponse.State
4747
if newInstanceState != csMachine.Status.InstanceState || (newInstanceState != "" && csMachine.Status.InstanceStateLastUpdated.IsZero()) {
4848
csMachine.Status.InstanceState = newInstanceState
4949
csMachine.Status.InstanceStateLastUpdated = metav1.Now()

0 commit comments

Comments
 (0)