Skip to content

Commit b756bbb

Browse files
authored
add Queue spec (#8)
1 parent bffe1ac commit b756bbb

File tree

6 files changed

+59
-13
lines changed

6 files changed

+59
-13
lines changed

pkg/apis/scheduling/v1alpha1/type.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,25 @@ type Queue struct {
3333

3434
// QueueSpec defines the desired state of Queue
3535
type QueueSpec struct {
36-
// TODO
36+
QueuePolicy QueuePolicy `json:"queuePolicy,omitempty" protobuf:"bytes,1,opt,name=queuePolicy`
37+
Priority *int32 `json:"priority,omitempty" protobuf:"varint,2,opt,name=priority"`
38+
PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,3,opt,name=priorityClassName"`
3739
}
3840

3941
// QueueStatus defines the observed state of Queue
4042
type QueueStatus struct {
4143
// TODO
4244
}
4345

46+
// +k8s:openapi-gen=true
47+
// QueuePolicy defines the queueing policy for the elements in the queue
48+
type QueuePolicy string
49+
50+
const (
51+
QueuePolicyFIFO QueuePolicy = "FIFO"
52+
QueuePolicyPriority QueuePolicy = "Priority"
53+
)
54+
4455
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4556

4657
// QueueUnitList contains a list of QueueUnit

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

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

pkg/client/clientset/versioned/fake/register.go

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

pkg/client/listers/scheduling/v1alpha1/queue.go

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

pkg/client/listers/scheduling/v1alpha1/queueunit.go

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

pkg/crd/queue-v1alpha1.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: queues.scheduling.x-k8s.io
5+
annotations:
6+
"api-approved.kubernetes.io": "https://github.com/kube-queue/api/pull/1"
7+
spec:
8+
group: scheduling.x-k8s.io
9+
names:
10+
kind: Queue
11+
plural: queues
12+
singular: queue
13+
shortNames:
14+
- queue
15+
- queues
16+
scope: Namespaced
17+
versions:
18+
- name: "v1alpha1"
19+
served: true
20+
storage: true
21+
schema:
22+
openAPIV3Schema:
23+
type: object
24+
properties:
25+
spec:
26+
type: object
27+
properties:
28+
queuePolicy:
29+
type: string
30+
priority:
31+
type: integer
32+
priorityClassName:
33+
type: string
34+
additionalProperties:
35+
anyOf:
36+
- type: integer
37+
- type: string
38+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
39+
x-kubernetes-int-or-string: true
40+
status:

0 commit comments

Comments
 (0)