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