blob: a9aaa86650d2f4afd912ccb94816466cecc0c063 [file] [log] [blame]
sslobodrd046be82019-01-16 10:02:22 -05001/*
2Copyright 2018 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21)
22
23// +genclient
24// +genclient:nonNamespaced
25// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
26
27// PriorityClass defines mapping from a priority class name to the priority
28// integer value. The value can be any valid integer.
29type PriorityClass struct {
30 metav1.TypeMeta `json:",inline"`
31 // Standard object's metadata.
32 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
33 // +optional
34 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
35
36 // The value of this priority class. This is the actual priority that pods
37 // receive when they have the name of this class in their pod spec.
38 Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"`
39
40 // globalDefault specifies whether this PriorityClass should be considered as
41 // the default priority for pods that do not have any priority class.
42 // Only one PriorityClass can be marked as `globalDefault`. However, if more than
43 // one PriorityClasses exists with their `globalDefault` field set to true,
44 // the smallest value of such global default PriorityClasses will be used as the default priority.
45 // +optional
46 GlobalDefault bool `json:"globalDefault,omitempty" protobuf:"bytes,3,opt,name=globalDefault"`
47
48 // description is an arbitrary string that usually provides guidelines on
49 // when this priority class should be used.
50 // +optional
51 Description string `json:"description,omitempty" protobuf:"bytes,4,opt,name=description"`
52}
53
54// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
55
56// PriorityClassList is a collection of priority classes.
57type PriorityClassList struct {
58 metav1.TypeMeta `json:",inline"`
59 // Standard list metadata
60 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
61 // +optional
62 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
63
64 // items is the list of PriorityClasses
65 Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"`
66}