Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit bb85483

Browse files
committed
Added State to PodGroupStatus struct, based on Pod.Status
Edited PR Autogenerated update
1 parent bfc9fdc commit bb85483

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

pkg/apis/scheduling/v1alpha1/types.go

+62
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,63 @@ const (
2828
UnschedulableEvent Event = "Unschedulable"
2929
)
3030

31+
// PodGroupPhase is the phase of a pod group at the current time.
32+
type PodGroupPhase string
33+
34+
// These are the valid phase of podGroups.
35+
const (
36+
// PodPending means the pod group has been accepted by the system, but scheduler can not allocate
37+
// enough resources to it.
38+
PodGroupPending PodGroupPhase = "Pending"
39+
40+
// PodRunning means `spec.minMember` pods of PodGroups has been in running phase.
41+
PodGroupRunning PodGroupPhase = "Running"
42+
43+
// PodGroupRecovering means part of `spec.minMember` pods have exception, e.g. killed; scheduler will
44+
// wait for related controller to recover it.
45+
PodGroupRecovering PodGroupPhase = "Recovering"
46+
47+
// PodGroupUnschedulable means part of `spec.minMember` pods are running but the other part can not
48+
// be scheduled, e.g. not enough resource; scheduler will wait for related controller to recover it.
49+
PodGroupUnschedulable PodGroupPhase = "Unschedulable"
50+
)
51+
52+
// PodGroupState contains details for the current state of this pod group.
53+
type PodGroupState struct {
54+
// Current phase of PodGroup.
55+
Phase PodGroupPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase"`
56+
57+
// Last time we probed to this Phase.
58+
// +optional
59+
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,2,opt,name=lastProbeTime"`
60+
61+
// Last time the phase transitioned from another to current phase.
62+
// +optional
63+
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
64+
65+
// Unique, one-word, CamelCase reason for the phase's last transition.
66+
// +optional
67+
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
68+
69+
// Human-readable message indicating details about last transition.
70+
// +optional
71+
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
72+
}
73+
74+
const (
75+
// PodFailedReason is probed if pod of PodGroup failed
76+
PodFailedReason string = "PodFailed"
77+
78+
// PodDeletedReason is probed if pod of PodGroup deleted
79+
PodDeletedReason string = "PodDeleted"
80+
81+
// NotEnoughResourcesReason is probed if there're not enough resources to schedule pods
82+
NotEnoughResourcesReason string = "NotEnoughResources"
83+
84+
// NotEnoughPodsReason is probed if there're not enough tasks compared to `spec.minMember`
85+
NotEnoughPodsReason string = "NotEnoughTasks"
86+
)
87+
3188
// +genclient
3289
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3390

@@ -67,12 +124,17 @@ type PodGroupStatus struct {
67124
// The number of actively running pods.
68125
// +optional
69126
Running int32 `json:"running,omitempty" protobuf:"bytes,3,opt,name=running"`
127+
70128
// The number of pods which reached phase Succeeded.
71129
// +optional
72130
Succeeded int32 `json:"succeeded,omitempty" protobuf:"bytes,3,opt,name=succeeded"`
131+
73132
// The number of pods which reached phase Failed.
74133
// +optional
75134
Failed int32 `json:"failed,omitempty" protobuf:"bytes,3,opt,name=failed"`
135+
136+
// +optional
137+
State PodGroupState `json:"state,omitempty" protobuf:"bytes,1,opt,name=state,casttype=State"`
76138
}
77139

78140
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

pkg/apis/scheduling/v1alpha1/zz_generated.deepcopy.go

+20-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)