We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b756bbb commit 631d49eCopy full SHA for 631d49e
pkg/apis/scheduling/v1alpha1/type.go
@@ -108,5 +108,19 @@ type QueueUnitList struct {
108
109
// Suspend is a flag that instructs the job operator to suspend processing this job
110
const Suspend = "scheduling.x-k8s.io/suspend"
111
+
112
// Placement is the scheduling result of the scheduler
113
const Placement = "scheduling.x-k8s.io/placement"
114
115
+// JobSuspended checks if a Job should be suspended by checking whether its annotation contains key Suspend and its
116
+// value is set "true"
117
+func JobSuspended(job metav1.Object) bool {
118
+ const suspended = "true"
119
+ annotations := job.GetAnnotations()
120
+ if annotations != nil {
121
+ if val, exist := annotations[Suspend]; exist {
122
+ return val == suspended
123
+ }
124
125
+ return false
126
+}
0 commit comments