Skip to content

Commit c4a57fe

Browse files
committed
Review feedback
1 parent ffc87ea commit c4a57fe

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

api/compute/v1alpha1/machinereservation_types.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import (
1212
// ReservationSpec defines the desired state of Reservation
1313
type ReservationSpec struct {
1414
Pools []corev1.LocalObjectReference `json:"pools"`
15-
Resources corev1alpha1.ResourceList `json:"capabilities,omitempty"`
15+
Resources corev1alpha1.ResourceList `json:"resources,omitempty"`
1616
}
1717

1818
// ReservationStatus defines the observed state of Reservation
1919
type ReservationStatus struct {
20-
Pools []ReservationPoolStatus `json:"pools,omitempty"`
20+
Pools []ReservationPoolStatus `json:"pools,omitempty"`
21+
Conditions []ReservationCondition `json:"conditions,omitempty"`
2122
}
2223

2324
// ReservationState is the state of a Reservation.
@@ -33,6 +34,25 @@ const (
3334
ReservationStateRejected ReservationState = "Rejected"
3435
)
3536

37+
// ReservationConditionType is a type a ReservationCondition can have.
38+
type ReservationConditionType string
39+
40+
// ReservationCondition is one of the conditions of a volume.
41+
type ReservationCondition struct {
42+
// Type is the type of the condition.
43+
Type ReservationConditionType `json:"type"`
44+
// Status is the status of the condition.
45+
Status corev1.ConditionStatus `json:"status"`
46+
// Reason is a machine-readable indication of why the condition is in a certain state.
47+
Reason string `json:"reason"`
48+
// Message is a human-readable explanation of why the condition has a certain reason / state.
49+
Message string `json:"message"`
50+
// ObservedGeneration represents the .metadata.generation that the condition was set based upon.
51+
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
52+
// LastTransitionTime is the last time the status of a condition has transitioned from one state to another.
53+
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
54+
}
55+
3656
type ReservationPoolStatus struct {
3757
Name string `json:"ref,omitempty"`
3858
State ReservationState `json:"state,omitempty"`

internal/apis/compute/machinereservation_types.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ type ReservationSpec struct {
1717

1818
// ReservationStatus defines the observed state of Reservation
1919
type ReservationStatus struct {
20-
Pools []ReservationPoolStatus
20+
Pools []ReservationPoolStatus
21+
Conditions []ReservationCondition
2122
}
2223

2324
// ReservationState is the state of a Reservation.
@@ -38,6 +39,25 @@ type ReservationPoolStatus struct {
3839
State ReservationState
3940
}
4041

42+
// ReservationConditionType is a type a ReservationCondition can have.
43+
type ReservationConditionType string
44+
45+
// ReservationCondition is one of the conditions of a volume.
46+
type ReservationCondition struct {
47+
// Type is the type of the condition.
48+
Type ReservationConditionType
49+
// Status is the status of the condition.
50+
Status corev1.ConditionStatus
51+
// Reason is a machine-readable indication of why the condition is in a certain state.
52+
Reason string
53+
// Message is a human-readable explanation of why the condition has a certain reason / state.
54+
Message string
55+
// ObservedGeneration represents the .metadata.generation that the condition was set based upon.
56+
ObservedGeneration int64
57+
// LastTransitionTime is the last time the status of a condition has transitioned from one state to another.
58+
LastTransitionTime metav1.Time
59+
}
60+
4161
// +genclient
4262
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4363

0 commit comments

Comments
 (0)