Merge pull request #48377 from bsalamat/priority_class
Automatic merge from submit-queue Add PriorityClass API object under new "scheduling" API group **What this PR does / why we need it**: This PR is a part of a series of PRs to add pod priority to Kubernetes. This PR adds a new API group called "scheduling" with a new API object called "PriorityClass". PriorityClass maps the string value of priority to its integer value. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: Given the size of this PR, I will add the admission controller for the PriorityClass in a separate PR. **Release note**: ```release-note Add PriorityClass API object under new "scheduling" API group ``` ref/ #47604 ref/ #48646
This commit is contained in:
@@ -43058,6 +43058,704 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/scheduling.k8s.io/": {
|
||||
"get": {
|
||||
"description": "get information of a group",
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling"
|
||||
],
|
||||
"operationId": "getSchedulingAPIGroup",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/apis/scheduling.k8s.io/v1alpha1/": {
|
||||
"get": {
|
||||
"description": "get available resources",
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "getSchedulingV1alpha1APIResources",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/apis/scheduling.k8s.io/v1alpha1/priorityclasses": {
|
||||
"get": {
|
||||
"description": "list or watch objects of kind PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf",
|
||||
"application/json;stream=watch",
|
||||
"application/vnd.kubernetes.protobuf;stream=watch"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "listSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"name": "fieldSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "If true, partially initialized resources are included in the response.",
|
||||
"name": "includeUninitialized",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"name": "labelSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
"name": "resourceVersion",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "integer",
|
||||
"description": "Timeout for the list/watch call.",
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"name": "watch",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClassList"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "list",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"description": "create a PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "createSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "post",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "delete collection of PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "deleteSchedulingV1alpha1CollectionPriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"name": "fieldSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "If true, partially initialized resources are included in the response.",
|
||||
"name": "includeUninitialized",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"name": "labelSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
"name": "resourceVersion",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "integer",
|
||||
"description": "Timeout for the list/watch call.",
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"name": "watch",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "deletecollection",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "If 'true', then the output is pretty printed.",
|
||||
"name": "pretty",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}": {
|
||||
"get": {
|
||||
"description": "read the specified PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "readSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.",
|
||||
"name": "exact",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Should this value be exported. Export strips fields that a user can not specify.",
|
||||
"name": "export",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "get",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"description": "replace the specified PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "replaceSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "put",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "delete a PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "deleteSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "integer",
|
||||
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
||||
"name": "gracePeriodSeconds",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
||||
"name": "orphanDependents",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.",
|
||||
"name": "propagationPolicy",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "delete",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"description": "partially update the specified PriorityClass",
|
||||
"consumes": [
|
||||
"application/json-patch+json",
|
||||
"application/merge-patch+json",
|
||||
"application/strategic-merge-patch+json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "patchSchedulingV1alpha1PriorityClass",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "patch",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "name of the PriorityClass",
|
||||
"name": "name",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "If 'true', then the output is pretty printed.",
|
||||
"name": "pretty",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses": {
|
||||
"get": {
|
||||
"description": "watch individual changes to a list of PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf",
|
||||
"application/json;stream=watch",
|
||||
"application/vnd.kubernetes.protobuf;stream=watch"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "watchSchedulingV1alpha1PriorityClassList",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "watchlist",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"name": "fieldSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "If true, partially initialized resources are included in the response.",
|
||||
"name": "includeUninitialized",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"name": "labelSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "If 'true', then the output is pretty printed.",
|
||||
"name": "pretty",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
"name": "resourceVersion",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "integer",
|
||||
"description": "Timeout for the list/watch call.",
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"name": "watch",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}": {
|
||||
"get": {
|
||||
"description": "watch changes to an object of kind PriorityClass",
|
||||
"consumes": [
|
||||
"*/*"
|
||||
],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf",
|
||||
"application/json;stream=watch",
|
||||
"application/vnd.kubernetes.protobuf;stream=watch"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"tags": [
|
||||
"scheduling_v1alpha1"
|
||||
],
|
||||
"operationId": "watchSchedulingV1alpha1PriorityClass",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "watch",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"name": "fieldSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "If true, partially initialized resources are included in the response.",
|
||||
"name": "includeUninitialized",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"name": "labelSelector",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "name of the PriorityClass",
|
||||
"name": "name",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "If 'true', then the output is pretty printed.",
|
||||
"name": "pretty",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "string",
|
||||
"description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
"name": "resourceVersion",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "integer",
|
||||
"description": "Timeout for the list/watch call.",
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"uniqueItems": true,
|
||||
"type": "boolean",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"name": "watch",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/settings.k8s.io/": {
|
||||
"get": {
|
||||
"description": "get information of a group",
|
||||
@@ -54389,6 +55087,80 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.api.scheduling.v1alpha1.PriorityClass": {
|
||||
"description": "PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.",
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "description is an arbitrary string that usually provides guidelines on when this priority class should be used.",
|
||||
"type": "string"
|
||||
},
|
||||
"globalDefault": {
|
||||
"description": "globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"kind": {
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
|
||||
},
|
||||
"value": {
|
||||
"description": "The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClass"
|
||||
}
|
||||
]
|
||||
},
|
||||
"io.k8s.api.scheduling.v1alpha1.PriorityClassList": {
|
||||
"description": "PriorityClassList is a collection of priority classes.",
|
||||
"required": [
|
||||
"items"
|
||||
],
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
|
||||
"type": "string"
|
||||
},
|
||||
"items": {
|
||||
"description": "items is the list of PriorityClasses",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha1.PriorityClass"
|
||||
}
|
||||
},
|
||||
"kind": {
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "PriorityClassList"
|
||||
}
|
||||
]
|
||||
},
|
||||
"io.k8s.api.settings.v1alpha1.PodPreset": {
|
||||
"description": "PodPreset is a policy resource that defines additional runtime requirements for a Pod.",
|
||||
"properties": {
|
||||
@@ -54962,6 +55734,11 @@
|
||||
"version": "v1beta1",
|
||||
"kind": "DeleteOptions"
|
||||
},
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "DeleteOptions"
|
||||
},
|
||||
{
|
||||
"group": "settings.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
@@ -55450,6 +56227,11 @@
|
||||
"version": "v1beta1",
|
||||
"kind": "WatchEvent"
|
||||
},
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "WatchEvent"
|
||||
},
|
||||
{
|
||||
"group": "settings.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
|
||||
@@ -113,6 +113,14 @@
|
||||
"path": "/apis/rbac.authorization.k8s.io",
|
||||
"description": "get information of a group"
|
||||
},
|
||||
{
|
||||
"path": "/apis/scheduling.k8s.io/v1alpha1",
|
||||
"description": "API at /apis/scheduling.k8s.io/v1alpha1"
|
||||
},
|
||||
{
|
||||
"path": "/apis/scheduling.k8s.io",
|
||||
"description": "get information of a group"
|
||||
},
|
||||
{
|
||||
"path": "/apis/settings.k8s.io/v1alpha1",
|
||||
"description": "API at /apis/settings.k8s.io/v1alpha1"
|
||||
|
||||
114
api/swagger-spec/scheduling.k8s.io.json
Normal file
114
api/swagger-spec/scheduling.k8s.io.json
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/apis/scheduling.k8s.io",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/apis/scheduling.k8s.io",
|
||||
"description": "get information of a group",
|
||||
"operations": [
|
||||
{
|
||||
"type": "v1.APIGroup",
|
||||
"method": "GET",
|
||||
"summary": "get information of a group",
|
||||
"nickname": "getAPIGroup",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"v1.APIGroup": {
|
||||
"id": "v1.APIGroup",
|
||||
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
|
||||
"required": [
|
||||
"name",
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "name is the name of the group."
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.GroupVersionForDiscovery"
|
||||
},
|
||||
"description": "versions are the versions supported in this group."
|
||||
},
|
||||
"preferredVersion": {
|
||||
"$ref": "v1.GroupVersionForDiscovery",
|
||||
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.GroupVersionForDiscovery": {
|
||||
"id": "v1.GroupVersionForDiscovery",
|
||||
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
|
||||
"required": [
|
||||
"groupVersion",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"groupVersion": {
|
||||
"type": "string",
|
||||
"description": "groupVersion specifies the API group and version in the form \"group/version\""
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ServerAddressByClientCIDR": {
|
||||
"id": "v1.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1114
api/swagger-spec/scheduling.k8s.io_v1alpha1.json
Normal file
1114
api/swagger-spec/scheduling.k8s.io_v1alpha1.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,7 @@ var (
|
||||
"storage/",
|
||||
"apps/",
|
||||
"policy/",
|
||||
"scheduling/",
|
||||
"settings/",
|
||||
"networking/",
|
||||
}, "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".")
|
||||
|
||||
@@ -87,6 +87,7 @@ func New() *Generator {
|
||||
`k8s.io/api/rbac/v1beta1`,
|
||||
`k8s.io/api/certificates/v1beta1`,
|
||||
`k8s.io/api/imagepolicy/v1alpha1`,
|
||||
`k8s.io/api/scheduling/v1alpha1`,
|
||||
`k8s.io/api/settings/v1alpha1`,
|
||||
`k8s.io/api/storage/v1beta1`,
|
||||
`k8s.io/api/storage/v1`,
|
||||
|
||||
1354
docs/api-reference/scheduling.k8s.io/v1alpha1/definitions.html
Executable file
1354
docs/api-reference/scheduling.k8s.io/v1alpha1/definitions.html
Executable file
File diff suppressed because it is too large
Load Diff
1709
docs/api-reference/scheduling.k8s.io/v1alpha1/operations.html
Executable file
1709
docs/api-reference/scheduling.k8s.io/v1alpha1/operations.html
Executable file
File diff suppressed because it is too large
Load Diff
@@ -13325,6 +13325,11 @@
|
||||
"version": "v1beta1",
|
||||
"kind": "DeleteOptions"
|
||||
},
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "DeleteOptions"
|
||||
},
|
||||
{
|
||||
"group": "settings.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
@@ -13813,6 +13818,11 @@
|
||||
"version": "v1beta1",
|
||||
"kind": "WatchEvent"
|
||||
},
|
||||
{
|
||||
"group": "scheduling.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
"kind": "WatchEvent"
|
||||
},
|
||||
{
|
||||
"group": "settings.k8s.io",
|
||||
"version": "v1alpha1",
|
||||
|
||||
@@ -148,6 +148,8 @@ pkg/apis/policy/validation
|
||||
pkg/apis/rbac
|
||||
pkg/apis/rbac/v1beta1
|
||||
pkg/apis/rbac/validation
|
||||
pkg/apis/scheduling
|
||||
pkg/apis/scheduling/v1alpha1
|
||||
pkg/apis/settings
|
||||
pkg/apis/settings/v1alpha1
|
||||
pkg/apis/storage
|
||||
@@ -414,6 +416,8 @@ pkg/registry/rbac/rolebinding
|
||||
pkg/registry/rbac/rolebinding/policybased
|
||||
pkg/registry/rbac/validation
|
||||
pkg/registry/registrytest
|
||||
pkg/registry/scheduling/priorityclass/storage
|
||||
pkg/registry/scheduling/rest
|
||||
pkg/registry/settings/podpreset
|
||||
pkg/registry/settings/podpreset/storage
|
||||
pkg/registry/settings/rest
|
||||
@@ -546,6 +550,7 @@ staging/src/k8s.io/api/networking/v1
|
||||
staging/src/k8s.io/api/policy/v1beta1
|
||||
staging/src/k8s.io/api/rbac/v1alpha1
|
||||
staging/src/k8s.io/api/rbac/v1beta1
|
||||
staging/src/k8s.io/api/scheduling/v1alpha1
|
||||
staging/src/k8s.io/api/settings/v1alpha1
|
||||
staging/src/k8s.io/api/storage/v1
|
||||
staging/src/k8s.io/api/storage/v1beta1
|
||||
@@ -738,6 +743,8 @@ staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake
|
||||
staging/src/k8s.io/client-go/kubernetes/typed/storage/v1
|
||||
|
||||
@@ -70,9 +70,10 @@ networking.k8s.io/v1 \
|
||||
policy/v1beta1 \
|
||||
rbac.authorization.k8s.io/v1beta1 \
|
||||
rbac.authorization.k8s.io/v1alpha1 \
|
||||
scheduling.k8s.io/v1alpha1 \
|
||||
settings.k8s.io/v1alpha1 \
|
||||
storage.k8s.io/v1beta1 \
|
||||
storage.k8s.io/v1\
|
||||
storage.k8s.io/v1 \
|
||||
}"
|
||||
|
||||
# not all group versions are exposed by the server. This list contains those
|
||||
|
||||
@@ -31,6 +31,7 @@ filegroup(
|
||||
"//pkg/apis/networking:all-srcs",
|
||||
"//pkg/apis/policy:all-srcs",
|
||||
"//pkg/apis/rbac:all-srcs",
|
||||
"//pkg/apis/scheduling:all-srcs",
|
||||
"//pkg/apis/settings:all-srcs",
|
||||
"//pkg/apis/storage:all-srcs",
|
||||
"//pkg/auth/authorizer/abac:all-srcs",
|
||||
@@ -76,6 +77,8 @@ filegroup(
|
||||
"//pkg/client/listers/rbac/internalversion:all-srcs",
|
||||
"//pkg/client/listers/rbac/v1alpha1:all-srcs",
|
||||
"//pkg/client/listers/rbac/v1beta1:all-srcs",
|
||||
"//pkg/client/listers/scheduling/internalversion:all-srcs",
|
||||
"//pkg/client/listers/scheduling/v1alpha1:all-srcs",
|
||||
"//pkg/client/listers/settings/internalversion:all-srcs",
|
||||
"//pkg/client/listers/settings/v1alpha1:all-srcs",
|
||||
"//pkg/client/listers/storage/internalversion:all-srcs",
|
||||
|
||||
@@ -43,6 +43,8 @@ go_library(
|
||||
"//pkg/apis/policy/install:go_default_library",
|
||||
"//pkg/apis/rbac:go_default_library",
|
||||
"//pkg/apis/rbac/install:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/scheduling/install:go_default_library",
|
||||
"//pkg/apis/settings:go_default_library",
|
||||
"//pkg/apis/settings/install:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
|
||||
@@ -48,6 +48,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/networking"
|
||||
"k8s.io/kubernetes/pkg/apis/policy"
|
||||
"k8s.io/kubernetes/pkg/apis/rbac"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/apis/settings"
|
||||
"k8s.io/kubernetes/pkg/apis/storage"
|
||||
|
||||
@@ -67,6 +68,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/networking/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/scheduling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/settings/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/storage/install"
|
||||
)
|
||||
@@ -83,6 +85,7 @@ var (
|
||||
Federation TestGroup
|
||||
Rbac TestGroup
|
||||
Certificates TestGroup
|
||||
Scheduling TestGroup
|
||||
Settings TestGroup
|
||||
Storage TestGroup
|
||||
ImagePolicy TestGroup
|
||||
@@ -241,6 +244,15 @@ func init() {
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[scheduling.GroupName]; !ok {
|
||||
externalGroupVersion := schema.GroupVersion{Group: scheduling.GroupName, Version: api.Registry.GroupOrDie(scheduling.GroupName).GroupVersion.Version}
|
||||
Groups[scheduling.GroupName] = TestGroup{
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: scheduling.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(scheduling.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[settings.GroupName]; !ok {
|
||||
externalGroupVersion := schema.GroupVersion{Group: settings.GroupName, Version: api.Registry.GroupOrDie(settings.GroupName).GroupVersion.Version}
|
||||
Groups[settings.GroupName] = TestGroup{
|
||||
@@ -323,6 +335,7 @@ func init() {
|
||||
Extensions = Groups[extensions.GroupName]
|
||||
Federation = Groups[federation.GroupName]
|
||||
Rbac = Groups[rbac.GroupName]
|
||||
Scheduling = Groups[scheduling.GroupName]
|
||||
Settings = Groups[settings.GroupName]
|
||||
Storage = Groups[storage.GroupName]
|
||||
ImagePolicy = Groups[imagepolicy.GroupName]
|
||||
|
||||
43
pkg/apis/scheduling/BUILD
Normal file
43
pkg/apis/scheduling/BUILD
Normal file
@@ -0,0 +1,43 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"types.go",
|
||||
"zz_generated.deepcopy.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/apis/scheduling/install:all-srcs",
|
||||
"//pkg/apis/scheduling/v1alpha1:all-srcs",
|
||||
"//pkg/apis/scheduling/validation:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
19
pkg/apis/scheduling/doc.go
Normal file
19
pkg/apis/scheduling/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +groupName=scheduling.k8s.io
|
||||
package scheduling // import "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
36
pkg/apis/scheduling/install/BUILD
Normal file
36
pkg/apis/scheduling/install/BUILD
Normal file
@@ -0,0 +1,36 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["install.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
51
pkg/apis/scheduling/install/install.go
Normal file
51
pkg/apis/scheduling/install/install.go
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package install installs the experimental API group, making it available as
|
||||
// an option to all of the API encoding/decoding machinery.
|
||||
package install
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/apimachinery/announced"
|
||||
"k8s.io/apimachinery/pkg/apimachinery/registered"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Install(api.GroupFactoryRegistry, api.Registry, api.Scheme)
|
||||
}
|
||||
|
||||
// Install registers the API group and adds types to a scheme
|
||||
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
|
||||
if err := announced.NewGroupMetaFactory(
|
||||
&announced.GroupMetaFactoryArgs{
|
||||
GroupName: scheduling.GroupName,
|
||||
VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version},
|
||||
ImportPrefix: "k8s.io/api/scheduling",
|
||||
RootScopedKinds: sets.NewString("PriorityClass"),
|
||||
AddInternalObjectsToScheme: scheduling.AddToScheme,
|
||||
},
|
||||
announced.VersionToSchemeFunc{
|
||||
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
|
||||
},
|
||||
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
51
pkg/apis/scheduling/register.go
Normal file
51
pkg/apis/scheduling/register.go
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package scheduling
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "scheduling.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&PriorityClass{},
|
||||
&PriorityClassList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
60
pkg/apis/scheduling/types.go
Normal file
60
pkg/apis/scheduling/types.go
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package scheduling
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// +genclient=true
|
||||
// +nonNamespaced=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PriorityClass defines the mapping from a priority class name to the priority
|
||||
// integer value. The value can be any valid integer.
|
||||
type PriorityClass struct {
|
||||
metav1.TypeMeta
|
||||
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
|
||||
// +optional
|
||||
metav1.ObjectMeta
|
||||
|
||||
// The value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
Value int32
|
||||
|
||||
// GlobalDefault specifies whether this PriorityClass should be considered as
|
||||
// the default priority for pods that do not have any priority class.
|
||||
// +optional
|
||||
GlobalDefault bool
|
||||
|
||||
// Description is an arbitrary string that usually provides guidelines on
|
||||
// when this priority class should be used.
|
||||
// +optional
|
||||
Description string
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PriorityClassList is a collection of priority classes.
|
||||
type PriorityClassList struct {
|
||||
metav1.TypeMeta
|
||||
// Standard list metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metav1.ListMeta
|
||||
|
||||
// Items is the list of PriorityClasses.
|
||||
Items []PriorityClass
|
||||
}
|
||||
39
pkg/apis/scheduling/v1alpha1/BUILD
Normal file
39
pkg/apis/scheduling/v1alpha1/BUILD
Normal file
@@ -0,0 +1,39 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"zz_generated.conversion.go",
|
||||
"zz_generated.defaults.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
22
pkg/apis/scheduling/v1alpha1/doc.go
Normal file
22
pkg/apis/scheduling/v1alpha1/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/scheduling
|
||||
// +k8s:conversion-gen-external-types=../../../../vendor/k8s.io/api/scheduling/v1alpha1
|
||||
// +groupName=scheduling.k8s.io
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/scheduling/v1alpha1
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1"
|
||||
45
pkg/apis/scheduling/v1alpha1/register.go
Normal file
45
pkg/apis/scheduling/v1alpha1/register.go
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "scheduling.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
localSchemeBuilder = &schedulingv1alpha1.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(RegisterDefaults)
|
||||
}
|
||||
96
pkg/apis/scheduling/v1alpha1/zz_generated.conversion.go
Normal file
96
pkg/apis/scheduling/v1alpha1/zz_generated.conversion.go
Normal file
@@ -0,0 +1,96 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1alpha1_PriorityClass_To_scheduling_PriorityClass,
|
||||
Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass,
|
||||
Convert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList,
|
||||
Convert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList,
|
||||
)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_PriorityClass_To_scheduling_PriorityClass(in *v1alpha1.PriorityClass, out *scheduling.PriorityClass, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Value = in.Value
|
||||
out.GlobalDefault = in.GlobalDefault
|
||||
out.Description = in.Description
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_PriorityClass_To_scheduling_PriorityClass is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_PriorityClass_To_scheduling_PriorityClass(in *v1alpha1.PriorityClass, out *scheduling.PriorityClass, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_PriorityClass_To_scheduling_PriorityClass(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in *scheduling.PriorityClass, out *v1alpha1.PriorityClass, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Value = in.Value
|
||||
out.GlobalDefault = in.GlobalDefault
|
||||
out.Description = in.Description
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass is an autogenerated conversion function.
|
||||
func Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in *scheduling.PriorityClass, out *v1alpha1.PriorityClass, s conversion.Scope) error {
|
||||
return autoConvert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList(in *v1alpha1.PriorityClassList, out *scheduling.PriorityClassList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]scheduling.PriorityClass)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList(in *v1alpha1.PriorityClassList, out *scheduling.PriorityClassList, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList(in *scheduling.PriorityClassList, out *v1alpha1.PriorityClassList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items == nil {
|
||||
out.Items = make([]v1alpha1.PriorityClass, 0)
|
||||
} else {
|
||||
out.Items = *(*[]v1alpha1.PriorityClass)(unsafe.Pointer(&in.Items))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList is an autogenerated conversion function.
|
||||
func Convert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList(in *scheduling.PriorityClassList, out *v1alpha1.PriorityClassList, s conversion.Scope) error {
|
||||
return autoConvert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList(in, out, s)
|
||||
}
|
||||
32
pkg/apis/scheduling/v1alpha1/zz_generated.defaults.go
Normal file
32
pkg/apis/scheduling/v1alpha1/zz_generated.defaults.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by defaulter-gen. Do not edit it manually!
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
||||
45
pkg/apis/scheduling/validation/BUILD
Normal file
45
pkg/apis/scheduling/validation/BUILD
Normal file
@@ -0,0 +1,45 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["validation_test.go"],
|
||||
library = ":go_default_library",
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["validation.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api/validation:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
47
pkg/apis/scheduling/validation/validation.go
Normal file
47
pkg/apis/scheduling/validation/validation.go
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package validation
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
apivalidation "k8s.io/kubernetes/pkg/api/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
// ValidatePriorityClassName can be used to check whether the given priority
|
||||
// class name is valid.
|
||||
var ValidatePriorityClassName = apivalidation.NameIsDNSSubdomain
|
||||
|
||||
// ValidatePriorityClass tests whether required fields in the PriorityClass are
|
||||
// set correctly.
|
||||
func ValidatePriorityClass(pc *scheduling.PriorityClass) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&pc.ObjectMeta, false, ValidatePriorityClassName, field.NewPath("metadata"))...)
|
||||
// The "Value" field can be any valid integer. So, no need to validate.
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePriorityClassUpdate tests if required fields in the PriorityClass are
|
||||
// set and are valid. PriorityClass does not allow updating Name, and Value.
|
||||
func ValidatePriorityClassUpdate(pc, oldPc *scheduling.PriorityClass) field.ErrorList {
|
||||
allErrs := apivalidation.ValidateObjectMetaUpdate(&pc.ObjectMeta, &oldPc.ObjectMeta, field.NewPath("metadata"))
|
||||
// Name is immutable and is checked by the ObjectMeta validator.
|
||||
if pc.Value != oldPc.Value {
|
||||
allErrs = append(allErrs, field.Forbidden(field.NewPath("Value"), "may not be changed in an update."))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
143
pkg/apis/scheduling/validation/validation_test.go
Normal file
143
pkg/apis/scheduling/validation/validation_test.go
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package validation
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
func TestValidatePriorityClass(t *testing.T) {
|
||||
successCases := map[string]scheduling.PriorityClass{
|
||||
"no description": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: ""},
|
||||
Value: 100,
|
||||
},
|
||||
"with description": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: ""},
|
||||
Value: 200,
|
||||
GlobalDefault: false,
|
||||
Description: "Used for the highest priority pods.",
|
||||
},
|
||||
}
|
||||
|
||||
for k, v := range successCases {
|
||||
if errs := ValidatePriorityClass(&v); len(errs) != 0 {
|
||||
t.Errorf("Expected success for %s, got %v", k, errs)
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]scheduling.PriorityClass{
|
||||
"with namespace": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "foo"},
|
||||
Value: 100,
|
||||
},
|
||||
"invalid name": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier&1", Namespace: ""},
|
||||
Value: 100,
|
||||
},
|
||||
}
|
||||
|
||||
for k, v := range errorCases {
|
||||
if errs := ValidatePriorityClass(&v); len(errs) == 0 {
|
||||
t.Errorf("Expected error for %s, but it succeeded", k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidatePriorityClassUpdate(t *testing.T) {
|
||||
old := scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "1"},
|
||||
Value: 100,
|
||||
}
|
||||
successCases := map[string]scheduling.PriorityClass{
|
||||
"no change": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
Description: "Used for the highest priority pods.",
|
||||
},
|
||||
"change description": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
Description: "A different description.",
|
||||
},
|
||||
"remove description": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
},
|
||||
"change globalDefault": {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
GlobalDefault: true,
|
||||
},
|
||||
}
|
||||
|
||||
for k, v := range successCases {
|
||||
if errs := ValidatePriorityClassUpdate(&v, &old); len(errs) != 0 {
|
||||
t.Errorf("Expected success for %s, got %v", k, errs)
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]struct {
|
||||
P scheduling.PriorityClass
|
||||
T field.ErrorType
|
||||
}{
|
||||
"add namespace": {
|
||||
P: scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "foo", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
},
|
||||
T: field.ErrorTypeInvalid,
|
||||
},
|
||||
"change name": {
|
||||
P: scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier2", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 100,
|
||||
},
|
||||
T: field.ErrorTypeInvalid,
|
||||
},
|
||||
"remove value": {
|
||||
P: scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
},
|
||||
T: field.ErrorTypeForbidden,
|
||||
},
|
||||
"change value": {
|
||||
P: scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "tier1", Namespace: "", ResourceVersion: "2"},
|
||||
Value: 101,
|
||||
},
|
||||
T: field.ErrorTypeForbidden,
|
||||
},
|
||||
}
|
||||
|
||||
for k, v := range errorCases {
|
||||
errs := ValidatePriorityClassUpdate(&v.P, &old)
|
||||
if len(errs) == 0 {
|
||||
t.Errorf("Expected error for %s, but it succeeded", k)
|
||||
continue
|
||||
}
|
||||
for i := range errs {
|
||||
if errs[i].Type != v.T {
|
||||
t.Errorf("%s: expected errors to have type %s: %v", k, v.T, errs[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
108
pkg/apis/scheduling/zz_generated.deepcopy.go
Normal file
108
pkg/apis/scheduling/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,108 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package scheduling
|
||||
|
||||
import (
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// Deprecated: register deep-copy functions.
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterDeepCopies)
|
||||
}
|
||||
|
||||
// Deprecated: RegisterDeepCopies adds deep-copy functions to the given scheme. Public
|
||||
// to allow building arbitrary schemes.
|
||||
func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedDeepCopyFuncs(
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PriorityClass).DeepCopyInto(out.(*PriorityClass))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PriorityClass{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PriorityClassList).DeepCopyInto(out.(*PriorityClassList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PriorityClassList{})},
|
||||
)
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityClass) DeepCopyInto(out *PriorityClass) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, creating a new PriorityClass.
|
||||
func (x *PriorityClass) DeepCopy() *PriorityClass {
|
||||
if x == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityClass)
|
||||
x.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (x *PriorityClass) DeepCopyObject() runtime.Object {
|
||||
if c := x.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PriorityClassList) DeepCopyInto(out *PriorityClassList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]PriorityClass, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, creating a new PriorityClassList.
|
||||
func (x *PriorityClassList) DeepCopy() *PriorityClassList {
|
||||
if x == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityClassList)
|
||||
x.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (x *PriorityClassList) DeepCopyObject() runtime.Object {
|
||||
if c := x.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ go_library(
|
||||
"//pkg/apis/extensions/install:go_default_library",
|
||||
"//pkg/apis/policy/install:go_default_library",
|
||||
"//pkg/apis/rbac/install:go_default_library",
|
||||
"//pkg/apis/scheduling/install:go_default_library",
|
||||
"//pkg/apis/settings/install:go_default_library",
|
||||
"//pkg/apis/storage/install:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1:go_default_library",
|
||||
@@ -47,6 +48,7 @@ go_library(
|
||||
"//pkg/client/clientset_generated/clientset/typed/policy/v1beta1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/storage/v1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:go_default_library",
|
||||
@@ -87,6 +89,7 @@ filegroup(
|
||||
"//pkg/client/clientset_generated/clientset/typed/policy/v1beta1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/storage/v1:all-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:all-srcs",
|
||||
|
||||
@@ -38,6 +38,7 @@ import (
|
||||
policyv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/policy/v1beta1"
|
||||
rbacv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1"
|
||||
settingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1"
|
||||
storagev1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1"
|
||||
storagev1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1"
|
||||
@@ -86,6 +87,9 @@ type Interface interface {
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Rbac() rbacv1beta1.RbacV1beta1Interface
|
||||
RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface
|
||||
SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Scheduling() schedulingv1alpha1.SchedulingV1alpha1Interface
|
||||
SettingsV1alpha1() settingsv1alpha1.SettingsV1alpha1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Settings() settingsv1alpha1.SettingsV1alpha1Interface
|
||||
@@ -116,6 +120,7 @@ type Clientset struct {
|
||||
*policyv1beta1.PolicyV1beta1Client
|
||||
*rbacv1beta1.RbacV1beta1Client
|
||||
*rbacv1alpha1.RbacV1alpha1Client
|
||||
*schedulingv1alpha1.SchedulingV1alpha1Client
|
||||
*settingsv1alpha1.SettingsV1alpha1Client
|
||||
*storagev1beta1.StorageV1beta1Client
|
||||
*storagev1.StorageV1Client
|
||||
@@ -365,6 +370,23 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface {
|
||||
return c.RbacV1alpha1Client
|
||||
}
|
||||
|
||||
// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client
|
||||
func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.SchedulingV1alpha1Client
|
||||
}
|
||||
|
||||
// Deprecated: Scheduling retrieves the default version of SchedulingClient.
|
||||
// Please explicitly pick a version.
|
||||
func (c *Clientset) Scheduling() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.SchedulingV1alpha1Client
|
||||
}
|
||||
|
||||
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
|
||||
func (c *Clientset) SettingsV1alpha1() settingsv1alpha1.SettingsV1alpha1Interface {
|
||||
if c == nil {
|
||||
@@ -491,6 +513,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.SchedulingV1alpha1Client, err = schedulingv1alpha1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.SettingsV1alpha1Client, err = settingsv1alpha1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -533,6 +559,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.PolicyV1beta1Client = policyv1beta1.NewForConfigOrDie(c)
|
||||
cs.RbacV1beta1Client = rbacv1beta1.NewForConfigOrDie(c)
|
||||
cs.RbacV1alpha1Client = rbacv1alpha1.NewForConfigOrDie(c)
|
||||
cs.SchedulingV1alpha1Client = schedulingv1alpha1.NewForConfigOrDie(c)
|
||||
cs.SettingsV1alpha1Client = settingsv1alpha1.NewForConfigOrDie(c)
|
||||
cs.StorageV1beta1Client = storagev1beta1.NewForConfigOrDie(c)
|
||||
cs.StorageV1Client = storagev1.NewForConfigOrDie(c)
|
||||
@@ -561,6 +588,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.PolicyV1beta1Client = policyv1beta1.New(c)
|
||||
cs.RbacV1beta1Client = rbacv1beta1.New(c)
|
||||
cs.RbacV1alpha1Client = rbacv1alpha1.New(c)
|
||||
cs.SchedulingV1alpha1Client = schedulingv1alpha1.New(c)
|
||||
cs.SettingsV1alpha1Client = settingsv1alpha1.New(c)
|
||||
cs.StorageV1beta1Client = storagev1beta1.New(c)
|
||||
cs.StorageV1Client = storagev1.New(c)
|
||||
|
||||
@@ -51,6 +51,8 @@ go_library(
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/clientset/typed/storage/v1:go_default_library",
|
||||
@@ -74,6 +76,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/settings/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1beta1:go_default_library",
|
||||
|
||||
@@ -57,6 +57,8 @@ import (
|
||||
fakerbacv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1/fake"
|
||||
rbacv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1"
|
||||
fakerbacv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake"
|
||||
schedulingv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1"
|
||||
fakeschedulingv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1/fake"
|
||||
settingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1"
|
||||
fakesettingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1/fake"
|
||||
storagev1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1"
|
||||
@@ -243,6 +245,16 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface {
|
||||
return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client
|
||||
func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Scheduling retrieves the SchedulingV1alpha1Client
|
||||
func (c *Clientset) Scheduling() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
|
||||
func (c *Clientset) SettingsV1alpha1() settingsv1alpha1.SettingsV1alpha1Interface {
|
||||
return &fakesettingsv1alpha1.FakeSettingsV1alpha1{Fake: &c.Fake}
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
settingsv1alpha1 "k8s.io/api/settings/v1alpha1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1beta1 "k8s.io/api/storage/v1beta1"
|
||||
@@ -84,6 +85,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
||||
policyv1beta1.AddToScheme(scheme)
|
||||
rbacv1beta1.AddToScheme(scheme)
|
||||
rbacv1alpha1.AddToScheme(scheme)
|
||||
schedulingv1alpha1.AddToScheme(scheme)
|
||||
settingsv1alpha1.AddToScheme(scheme)
|
||||
storagev1beta1.AddToScheme(scheme)
|
||||
storagev1.AddToScheme(scheme)
|
||||
|
||||
@@ -31,6 +31,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/scheduling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/settings/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/storage/install"
|
||||
)
|
||||
|
||||
@@ -32,6 +32,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/settings/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1beta1:go_default_library",
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
settingsv1alpha1 "k8s.io/api/settings/v1alpha1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1beta1 "k8s.io/api/storage/v1beta1"
|
||||
@@ -84,6 +85,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
||||
policyv1beta1.AddToScheme(scheme)
|
||||
rbacv1beta1.AddToScheme(scheme)
|
||||
rbacv1alpha1.AddToScheme(scheme)
|
||||
schedulingv1alpha1.AddToScheme(scheme)
|
||||
settingsv1alpha1.AddToScheme(scheme)
|
||||
storagev1beta1.AddToScheme(scheme)
|
||||
storagev1.AddToScheme(scheme)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"generated_expansion.go",
|
||||
"priorityclass.go",
|
||||
"scheduling_client.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/clientset_generated/clientset/scheme:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1/fake:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with custom arguments.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
@@ -0,0 +1,42 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"fake_priorityclass.go",
|
||||
"fake_scheduling_client.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest:go_default_library",
|
||||
"//vendor/k8s.io/client-go/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with custom arguments.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakePriorityClasses implements PriorityClassInterface
|
||||
type FakePriorityClasses struct {
|
||||
Fake *FakeSchedulingV1alpha1
|
||||
}
|
||||
|
||||
var priorityclassesResource = schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha1", Resource: "priorityclasses"}
|
||||
|
||||
var priorityclassesKind = schema.GroupVersionKind{Group: "scheduling.k8s.io", Version: "v1alpha1", Kind: "PriorityClass"}
|
||||
|
||||
func (c *FakePriorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &v1alpha1.PriorityClass{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1alpha1.PriorityClassList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.PriorityClassList{}
|
||||
for _, item := range obj.(*v1alpha1.PriorityClassList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *FakePriorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts))
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *FakePriorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, data, subresources...), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.PriorityClass), err
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/scheduling/v1alpha1"
|
||||
)
|
||||
|
||||
type FakeSchedulingV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeSchedulingV1alpha1) PriorityClasses() v1alpha1.PriorityClassInterface {
|
||||
return &FakePriorityClasses{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeSchedulingV1alpha1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type PriorityClassExpansion interface{}
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
// PriorityClassesGetter has a method to return a PriorityClassInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PriorityClassesGetter interface {
|
||||
PriorityClasses() PriorityClassInterface
|
||||
}
|
||||
|
||||
// PriorityClassInterface has methods to work with PriorityClass resources.
|
||||
type PriorityClassInterface interface {
|
||||
Create(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Update(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*v1alpha1.PriorityClass, error)
|
||||
List(opts v1.ListOptions) (*v1alpha1.PriorityClassList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error)
|
||||
PriorityClassExpansion
|
||||
}
|
||||
|
||||
// priorityClasses implements PriorityClassInterface
|
||||
type priorityClasses struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newPriorityClasses returns a PriorityClasses
|
||||
func newPriorityClasses(c *SchedulingV1alpha1Client) *priorityClasses {
|
||||
return &priorityClasses{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Post().
|
||||
Resource("priorityclasses").
|
||||
Body(priorityClass).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Put().
|
||||
Resource("priorityclasses").
|
||||
Name(priorityClass.Name).
|
||||
Body(priorityClass).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
result = &v1alpha1.PriorityClassList{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("priorityclasses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
rest "k8s.io/client-go/rest"
|
||||
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
type SchedulingV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
PriorityClassesGetter
|
||||
}
|
||||
|
||||
// SchedulingV1alpha1Client is used to interact with features provided by the scheduling.k8s.io group.
|
||||
type SchedulingV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *SchedulingV1alpha1Client) PriorityClasses() PriorityClassInterface {
|
||||
return newPriorityClasses(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new SchedulingV1alpha1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*SchedulingV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SchedulingV1alpha1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new SchedulingV1alpha1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *SchedulingV1alpha1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new SchedulingV1alpha1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *SchedulingV1alpha1Client {
|
||||
return &SchedulingV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *SchedulingV1alpha1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -27,6 +27,7 @@ go_library(
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/networking/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/policy/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/settings/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/storage/internalversion:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
@@ -61,6 +62,7 @@ filegroup(
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/networking/internalversion:all-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/policy/internalversion:all-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion:all-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion:all-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/settings/internalversion:all-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/storage/internalversion:all-srcs",
|
||||
],
|
||||
|
||||
@@ -33,6 +33,7 @@ import (
|
||||
networkinginternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/networking/internalversion"
|
||||
policyinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/internalversion"
|
||||
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
|
||||
schedulinginternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion"
|
||||
settingsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/settings/internalversion"
|
||||
storageinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/storage/internalversion"
|
||||
)
|
||||
@@ -51,6 +52,7 @@ type Interface interface {
|
||||
Networking() networkinginternalversion.NetworkingInterface
|
||||
Policy() policyinternalversion.PolicyInterface
|
||||
Rbac() rbacinternalversion.RbacInterface
|
||||
Scheduling() schedulinginternalversion.SchedulingInterface
|
||||
Settings() settingsinternalversion.SettingsInterface
|
||||
Storage() storageinternalversion.StorageInterface
|
||||
}
|
||||
@@ -71,6 +73,7 @@ type Clientset struct {
|
||||
*networkinginternalversion.NetworkingClient
|
||||
*policyinternalversion.PolicyClient
|
||||
*rbacinternalversion.RbacClient
|
||||
*schedulinginternalversion.SchedulingClient
|
||||
*settingsinternalversion.SettingsClient
|
||||
*storageinternalversion.StorageClient
|
||||
}
|
||||
@@ -171,6 +174,14 @@ func (c *Clientset) Rbac() rbacinternalversion.RbacInterface {
|
||||
return c.RbacClient
|
||||
}
|
||||
|
||||
// Scheduling retrieves the SchedulingClient
|
||||
func (c *Clientset) Scheduling() schedulinginternalversion.SchedulingInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.SchedulingClient
|
||||
}
|
||||
|
||||
// Settings retrieves the SettingsClient
|
||||
func (c *Clientset) Settings() settingsinternalversion.SettingsInterface {
|
||||
if c == nil {
|
||||
@@ -251,6 +262,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.SchedulingClient, err = schedulinginternalversion.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.SettingsClient, err = settingsinternalversion.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -284,6 +299,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.NetworkingClient = networkinginternalversion.NewForConfigOrDie(c)
|
||||
cs.PolicyClient = policyinternalversion.NewForConfigOrDie(c)
|
||||
cs.RbacClient = rbacinternalversion.NewForConfigOrDie(c)
|
||||
cs.SchedulingClient = schedulinginternalversion.NewForConfigOrDie(c)
|
||||
cs.SettingsClient = settingsinternalversion.NewForConfigOrDie(c)
|
||||
cs.StorageClient = storageinternalversion.NewForConfigOrDie(c)
|
||||
|
||||
@@ -306,6 +322,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.NetworkingClient = networkinginternalversion.New(c)
|
||||
cs.PolicyClient = policyinternalversion.New(c)
|
||||
cs.RbacClient = rbacinternalversion.New(c)
|
||||
cs.SchedulingClient = schedulinginternalversion.New(c)
|
||||
cs.SettingsClient = settingsinternalversion.New(c)
|
||||
cs.StorageClient = storageinternalversion.New(c)
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ go_library(
|
||||
"//pkg/apis/networking:go_default_library",
|
||||
"//pkg/apis/policy:go_default_library",
|
||||
"//pkg/apis/rbac:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/settings:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
@@ -55,6 +56,8 @@ go_library(
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/policy/internalversion/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/settings/internalversion:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/settings/internalversion/fake:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/storage/internalversion:go_default_library",
|
||||
|
||||
@@ -47,6 +47,8 @@ import (
|
||||
fakepolicyinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/internalversion/fake"
|
||||
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
|
||||
fakerbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion/fake"
|
||||
schedulinginternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion"
|
||||
fakeschedulinginternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion/fake"
|
||||
settingsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/settings/internalversion"
|
||||
fakesettingsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/settings/internalversion/fake"
|
||||
storageinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/storage/internalversion"
|
||||
@@ -146,6 +148,11 @@ func (c *Clientset) Rbac() rbacinternalversion.RbacInterface {
|
||||
return &fakerbacinternalversion.FakeRbac{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Scheduling retrieves the SchedulingClient
|
||||
func (c *Clientset) Scheduling() schedulinginternalversion.SchedulingInterface {
|
||||
return &fakeschedulinginternalversion.FakeScheduling{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Settings retrieves the SettingsClient
|
||||
func (c *Clientset) Settings() settingsinternalversion.SettingsInterface {
|
||||
return &fakesettingsinternalversion.FakeSettings{Fake: &c.Fake}
|
||||
|
||||
@@ -33,6 +33,7 @@ import (
|
||||
networkinginternalversion "k8s.io/kubernetes/pkg/apis/networking"
|
||||
policyinternalversion "k8s.io/kubernetes/pkg/apis/policy"
|
||||
rbacinternalversion "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
schedulinginternalversion "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
settingsinternalversion "k8s.io/kubernetes/pkg/apis/settings"
|
||||
storageinternalversion "k8s.io/kubernetes/pkg/apis/storage"
|
||||
)
|
||||
@@ -73,6 +74,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
||||
networkinginternalversion.AddToScheme(scheme)
|
||||
policyinternalversion.AddToScheme(scheme)
|
||||
rbacinternalversion.AddToScheme(scheme)
|
||||
schedulinginternalversion.AddToScheme(scheme)
|
||||
settingsinternalversion.AddToScheme(scheme)
|
||||
storageinternalversion.AddToScheme(scheme)
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ go_library(
|
||||
"//pkg/apis/networking/install:go_default_library",
|
||||
"//pkg/apis/policy/install:go_default_library",
|
||||
"//pkg/apis/rbac/install:go_default_library",
|
||||
"//pkg/apis/scheduling/install:go_default_library",
|
||||
"//pkg/apis/settings/install:go_default_library",
|
||||
"//pkg/apis/storage/install:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library",
|
||||
|
||||
@@ -35,6 +35,7 @@ import (
|
||||
networking "k8s.io/kubernetes/pkg/apis/networking/install"
|
||||
policy "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling/install"
|
||||
settings "k8s.io/kubernetes/pkg/apis/settings/install"
|
||||
storage "k8s.io/kubernetes/pkg/apis/storage/install"
|
||||
os "os"
|
||||
@@ -66,6 +67,7 @@ func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *r
|
||||
networking.Install(groupFactoryRegistry, registry, scheme)
|
||||
policy.Install(groupFactoryRegistry, registry, scheme)
|
||||
rbac.Install(groupFactoryRegistry, registry, scheme)
|
||||
scheduling.Install(groupFactoryRegistry, registry, scheme)
|
||||
settings.Install(groupFactoryRegistry, registry, scheme)
|
||||
storage.Install(groupFactoryRegistry, registry, scheme)
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"generated_expansion.go",
|
||||
"priorityclass.go",
|
||||
"scheduling_client.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/scheme:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion/fake:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with the default arguments.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package internalversion
|
||||
@@ -0,0 +1,42 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"fake_priorityclass.go",
|
||||
"fake_scheduling_client.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest:go_default_library",
|
||||
"//vendor/k8s.io/client-go/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with the default arguments.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
// FakePriorityClasses implements PriorityClassInterface
|
||||
type FakePriorityClasses struct {
|
||||
Fake *FakeScheduling
|
||||
}
|
||||
|
||||
var priorityclassesResource = schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "", Resource: "priorityclasses"}
|
||||
|
||||
var priorityclassesKind = schema.GroupVersionKind{Group: "scheduling.k8s.io", Version: "", Kind: "PriorityClass"}
|
||||
|
||||
func (c *FakePriorityClasses) Create(priorityClass *scheduling.PriorityClass) (result *scheduling.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &scheduling.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Update(priorityClass *scheduling.PriorityClass) (result *scheduling.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &scheduling.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &scheduling.PriorityClass{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &scheduling.PriorityClassList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *scheduling.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(priorityclassesResource, name), &scheduling.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), err
|
||||
}
|
||||
|
||||
func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *scheduling.PriorityClassList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &scheduling.PriorityClassList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &scheduling.PriorityClassList{}
|
||||
for _, item := range obj.(*scheduling.PriorityClassList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *FakePriorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts))
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *FakePriorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *scheduling.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, data, subresources...), &scheduling.PriorityClass{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), err
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
internalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion"
|
||||
)
|
||||
|
||||
type FakeScheduling struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeScheduling) PriorityClasses() internalversion.PriorityClassInterface {
|
||||
return &FakePriorityClasses{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeScheduling) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package internalversion
|
||||
|
||||
type PriorityClassExpansion interface{}
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package internalversion
|
||||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
// PriorityClassesGetter has a method to return a PriorityClassInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PriorityClassesGetter interface {
|
||||
PriorityClasses() PriorityClassInterface
|
||||
}
|
||||
|
||||
// PriorityClassInterface has methods to work with PriorityClass resources.
|
||||
type PriorityClassInterface interface {
|
||||
Create(*scheduling.PriorityClass) (*scheduling.PriorityClass, error)
|
||||
Update(*scheduling.PriorityClass) (*scheduling.PriorityClass, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*scheduling.PriorityClass, error)
|
||||
List(opts v1.ListOptions) (*scheduling.PriorityClassList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *scheduling.PriorityClass, err error)
|
||||
PriorityClassExpansion
|
||||
}
|
||||
|
||||
// priorityClasses implements PriorityClassInterface
|
||||
type priorityClasses struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newPriorityClasses returns a PriorityClasses
|
||||
func newPriorityClasses(c *SchedulingClient) *priorityClasses {
|
||||
return &priorityClasses{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Create(priorityClass *scheduling.PriorityClass) (result *scheduling.PriorityClass, err error) {
|
||||
result = &scheduling.PriorityClass{}
|
||||
err = c.client.Post().
|
||||
Resource("priorityclasses").
|
||||
Body(priorityClass).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Update(priorityClass *scheduling.PriorityClass) (result *scheduling.PriorityClass, err error) {
|
||||
result = &scheduling.PriorityClass{}
|
||||
err = c.client.Put().
|
||||
Resource("priorityclasses").
|
||||
Name(priorityClass.Name).
|
||||
Body(priorityClass).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *scheduling.PriorityClass, err error) {
|
||||
result = &scheduling.PriorityClass{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *priorityClasses) List(opts v1.ListOptions) (result *scheduling.PriorityClassList, err error) {
|
||||
result = &scheduling.PriorityClassList{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *scheduling.PriorityClass, err error) {
|
||||
result = &scheduling.PriorityClass{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("priorityclasses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package internalversion
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
type SchedulingInterface interface {
|
||||
RESTClient() rest.Interface
|
||||
PriorityClassesGetter
|
||||
}
|
||||
|
||||
// SchedulingClient is used to interact with features provided by the scheduling.k8s.io group.
|
||||
type SchedulingClient struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *SchedulingClient) PriorityClasses() PriorityClassInterface {
|
||||
return newPriorityClasses(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new SchedulingClient for the given config.
|
||||
func NewForConfig(c *rest.Config) (*SchedulingClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SchedulingClient{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new SchedulingClient for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *SchedulingClient {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new SchedulingClient for the given RESTClient.
|
||||
func New(c rest.Interface) *SchedulingClient {
|
||||
return &SchedulingClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
g, err := scheme.Registry.Group("scheduling.k8s.io")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
config.APIPath = "/apis"
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group {
|
||||
gv := g.GroupVersion
|
||||
config.GroupVersion = &gv
|
||||
}
|
||||
config.NegotiatedSerializer = scheme.Codecs
|
||||
|
||||
if config.QPS == 0 {
|
||||
config.QPS = 5
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *SchedulingClient) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -27,6 +27,7 @@ go_library(
|
||||
"//pkg/client/informers/informers_generated/externalversions/networking:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/policy:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/rbac:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/scheduling:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/settings:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/storage:go_default_library",
|
||||
"//vendor/k8s.io/api/admissionregistration/v1alpha1:go_default_library",
|
||||
@@ -42,6 +43,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/settings/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1beta1:go_default_library",
|
||||
@@ -73,6 +75,7 @@ filegroup(
|
||||
"//pkg/client/informers/informers_generated/externalversions/networking:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/policy:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/rbac:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/scheduling:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/settings:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/storage:all-srcs",
|
||||
],
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
networking "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/networking"
|
||||
policy "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/policy"
|
||||
rbac "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/rbac"
|
||||
scheduling "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/scheduling"
|
||||
settings "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/settings"
|
||||
storage "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/storage"
|
||||
reflect "reflect"
|
||||
@@ -131,6 +132,7 @@ type SharedInformerFactory interface {
|
||||
Networking() networking.Interface
|
||||
Policy() policy.Interface
|
||||
Rbac() rbac.Interface
|
||||
Scheduling() scheduling.Interface
|
||||
Settings() settings.Interface
|
||||
Storage() storage.Interface
|
||||
}
|
||||
@@ -175,6 +177,10 @@ func (f *sharedInformerFactory) Rbac() rbac.Interface {
|
||||
return rbac.New(f)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Scheduling() scheduling.Interface {
|
||||
return scheduling.New(f)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Settings() settings.Interface {
|
||||
return settings.New(f)
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import (
|
||||
policy_v1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbac_v1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
scheduling_v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
settings_v1alpha1 "k8s.io/api/settings/v1alpha1"
|
||||
storage_v1 "k8s.io/api/storage/v1"
|
||||
storage_v1beta1 "k8s.io/api/storage/v1beta1"
|
||||
@@ -176,6 +177,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case rbac_v1beta1.SchemeGroupVersion.WithResource("rolebindings"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil
|
||||
|
||||
// Group=Scheduling, Version=V1alpha1
|
||||
case scheduling_v1alpha1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().PriorityClasses().Informer()}, nil
|
||||
|
||||
// Group=Settings, Version=V1alpha1
|
||||
case settings_v1alpha1.SchemeGroupVersion.WithResource("podpresets"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["interface.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/informers/informers_generated/externalversions/internalinterfaces:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/scheduling/v1alpha1:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/client/informers/informers_generated/externalversions/scheduling/v1alpha1:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package scheduling
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
|
||||
v1alpha1 "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/scheduling/v1alpha1"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V1alpha1 provides access to shared informers for resources in V1alpha1.
|
||||
V1alpha1() v1alpha1.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory) Interface {
|
||||
return &group{f}
|
||||
}
|
||||
|
||||
// V1alpha1 returns a new v1alpha1.Interface.
|
||||
func (g *group) V1alpha1() v1alpha1.Interface {
|
||||
return v1alpha1.New(g.SharedInformerFactory)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"interface.go",
|
||||
"priorityclass.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/clientset_generated/clientset:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/externalversions/internalinterfaces:go_default_library",
|
||||
"//pkg/client/listers/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
PriorityClasses() PriorityClassInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory) Interface {
|
||||
return &version{f}
|
||||
}
|
||||
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
func (v *version) PriorityClasses() PriorityClassInformer {
|
||||
return &priorityClassInformer{factory: v.SharedInformerFactory}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
scheduling_v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
|
||||
v1alpha1 "k8s.io/kubernetes/pkg/client/listers/scheduling/v1alpha1"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// PriorityClassInformer provides access to a shared informer and lister for
|
||||
// PriorityClasses.
|
||||
type PriorityClassInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.PriorityClassLister
|
||||
}
|
||||
|
||||
type priorityClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPriorityClassInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.SchedulingV1alpha1().PriorityClasses().List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.SchedulingV1alpha1().PriorityClasses().Watch(options)
|
||||
},
|
||||
},
|
||||
&scheduling_v1alpha1.PriorityClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
)
|
||||
|
||||
return sharedIndexInformer
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&scheduling_v1alpha1.PriorityClass{}, newPriorityClassInformer)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Lister() v1alpha1.PriorityClassLister {
|
||||
return v1alpha1.NewPriorityClassLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -25,6 +25,7 @@ go_library(
|
||||
"//pkg/apis/networking:go_default_library",
|
||||
"//pkg/apis/policy:go_default_library",
|
||||
"//pkg/apis/rbac:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/settings:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
@@ -39,6 +40,7 @@ go_library(
|
||||
"//pkg/client/informers/informers_generated/internalversion/networking:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/policy:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/rbac:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/scheduling:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/settings:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/storage:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
@@ -69,6 +71,7 @@ filegroup(
|
||||
"//pkg/client/informers/informers_generated/internalversion/networking:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/policy:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/rbac:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/scheduling:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/settings:all-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/storage:all-srcs",
|
||||
],
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
networking "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/networking"
|
||||
policy "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/policy"
|
||||
rbac "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/rbac"
|
||||
scheduling "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/scheduling"
|
||||
settings "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/settings"
|
||||
storage "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/storage"
|
||||
reflect "reflect"
|
||||
@@ -131,6 +132,7 @@ type SharedInformerFactory interface {
|
||||
Networking() networking.Interface
|
||||
Policy() policy.Interface
|
||||
Rbac() rbac.Interface
|
||||
Scheduling() scheduling.Interface
|
||||
Settings() settings.Interface
|
||||
Storage() storage.Interface
|
||||
}
|
||||
@@ -175,6 +177,10 @@ func (f *sharedInformerFactory) Rbac() rbac.Interface {
|
||||
return rbac.New(f)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Scheduling() scheduling.Interface {
|
||||
return scheduling.New(f)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Settings() settings.Interface {
|
||||
return settings.New(f)
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import (
|
||||
networking "k8s.io/kubernetes/pkg/apis/networking"
|
||||
policy "k8s.io/kubernetes/pkg/apis/policy"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
settings "k8s.io/kubernetes/pkg/apis/settings"
|
||||
storage "k8s.io/kubernetes/pkg/apis/storage"
|
||||
)
|
||||
@@ -156,6 +157,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case rbac.SchemeGroupVersion.WithResource("rolebindings"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().InternalVersion().RoleBindings().Informer()}, nil
|
||||
|
||||
// Group=Scheduling, Version=InternalVersion
|
||||
case scheduling.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().InternalVersion().PriorityClasses().Informer()}, nil
|
||||
|
||||
// Group=Settings, Version=InternalVersion
|
||||
case settings.SchemeGroupVersion.WithResource("podpresets"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().InternalVersion().PodPresets().Informer()}, nil
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["interface.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/client/informers/informers_generated/internalversion/internalinterfaces:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/scheduling/internalversion:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/client/informers/informers_generated/internalversion/scheduling/internalversion:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package scheduling
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
|
||||
internalversion "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/scheduling/internalversion"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// InternalVersion provides access to shared informers for resources in InternalVersion.
|
||||
InternalVersion() internalversion.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory) Interface {
|
||||
return &group{f}
|
||||
}
|
||||
|
||||
// InternalVersion returns a new internalversion.Interface.
|
||||
func (g *group) InternalVersion() internalversion.Interface {
|
||||
return internalversion.New(g.SharedInformerFactory)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"interface.go",
|
||||
"priorityclass.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
"//pkg/client/informers/informers_generated/internalversion/internalinterfaces:go_default_library",
|
||||
"//pkg/client/listers/scheduling/internalversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package internalversion
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
PriorityClasses() PriorityClassInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory) Interface {
|
||||
return &version{f}
|
||||
}
|
||||
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
func (v *version) PriorityClasses() PriorityClassInformer {
|
||||
return &priorityClassInformer{factory: v.SharedInformerFactory}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package internalversion
|
||||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
|
||||
internalversion "k8s.io/kubernetes/pkg/client/listers/scheduling/internalversion"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// PriorityClassInformer provides access to a shared informer and lister for
|
||||
// PriorityClasses.
|
||||
type PriorityClassInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() internalversion.PriorityClassLister
|
||||
}
|
||||
|
||||
type priorityClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPriorityClassInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Scheduling().PriorityClasses().List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Scheduling().PriorityClasses().Watch(options)
|
||||
},
|
||||
},
|
||||
&scheduling.PriorityClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
)
|
||||
|
||||
return sharedIndexInformer
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&scheduling.PriorityClass{}, newPriorityClassInformer)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Lister() internalversion.PriorityClassLister {
|
||||
return internalversion.NewPriorityClassLister(f.Informer().GetIndexer())
|
||||
}
|
||||
37
pkg/client/listers/scheduling/internalversion/BUILD
Normal file
37
pkg/client/listers/scheduling/internalversion/BUILD
Normal file
@@ -0,0 +1,37 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"expansion_generated.go",
|
||||
"priorityclass.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package internalversion
|
||||
|
||||
// PriorityClassListerExpansion allows custom methods to be added to
|
||||
// PriorityClassLister.
|
||||
type PriorityClassListerExpansion interface{}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package internalversion
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
scheduling "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
// PriorityClassLister helps list PriorityClasses.
|
||||
type PriorityClassLister interface {
|
||||
// List lists all PriorityClasses in the indexer.
|
||||
List(selector labels.Selector) (ret []*scheduling.PriorityClass, err error)
|
||||
// Get retrieves the PriorityClass from the index for a given name.
|
||||
Get(name string) (*scheduling.PriorityClass, error)
|
||||
PriorityClassListerExpansion
|
||||
}
|
||||
|
||||
// priorityClassLister implements the PriorityClassLister interface.
|
||||
type priorityClassLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewPriorityClassLister returns a new PriorityClassLister.
|
||||
func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister {
|
||||
return &priorityClassLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all PriorityClasses in the indexer.
|
||||
func (s *priorityClassLister) List(selector labels.Selector) (ret []*scheduling.PriorityClass, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*scheduling.PriorityClass))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the PriorityClass from the index for a given name.
|
||||
func (s *priorityClassLister) Get(name string) (*scheduling.PriorityClass, error) {
|
||||
key := &scheduling.PriorityClass{ObjectMeta: v1.ObjectMeta{Name: name}}
|
||||
obj, exists, err := s.indexer.Get(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(scheduling.Resource("priorityclass"), name)
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), nil
|
||||
}
|
||||
37
pkg/client/listers/scheduling/v1alpha1/BUILD
Normal file
37
pkg/client/listers/scheduling/v1alpha1/BUILD
Normal file
@@ -0,0 +1,37 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"expansion_generated.go",
|
||||
"priorityclass.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// PriorityClassListerExpansion allows custom methods to be added to
|
||||
// PriorityClassLister.
|
||||
type PriorityClassListerExpansion interface{}
|
||||
67
pkg/client/listers/scheduling/v1alpha1/priorityclass.go
Normal file
67
pkg/client/listers/scheduling/v1alpha1/priorityclass.go
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PriorityClassLister helps list PriorityClasses.
|
||||
type PriorityClassLister interface {
|
||||
// List lists all PriorityClasses in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.PriorityClass, err error)
|
||||
// Get retrieves the PriorityClass from the index for a given name.
|
||||
Get(name string) (*v1alpha1.PriorityClass, error)
|
||||
PriorityClassListerExpansion
|
||||
}
|
||||
|
||||
// priorityClassLister implements the PriorityClassLister interface.
|
||||
type priorityClassLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewPriorityClassLister returns a new PriorityClassLister.
|
||||
func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister {
|
||||
return &priorityClassLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all PriorityClasses in the indexer.
|
||||
func (s *priorityClassLister) List(selector labels.Selector) (ret []*v1alpha1.PriorityClass, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.PriorityClass))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the PriorityClass from the index for a given name.
|
||||
func (s *priorityClassLister) Get(name string) (*v1alpha1.PriorityClass, error) {
|
||||
key := &v1alpha1.PriorityClass{ObjectMeta: v1.ObjectMeta{Name: name}}
|
||||
obj, exists, err := s.indexer.Get(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha1.Resource("priorityclass"), name)
|
||||
}
|
||||
return obj.(*v1alpha1.PriorityClass), nil
|
||||
}
|
||||
@@ -36,6 +36,7 @@ openapi_library(
|
||||
"k8s.io/api/policy/v1beta1",
|
||||
"k8s.io/api/rbac/v1alpha1",
|
||||
"k8s.io/api/rbac/v1beta1",
|
||||
"k8s.io/api/scheduling/v1alpha1",
|
||||
"k8s.io/api/settings/v1alpha1",
|
||||
"k8s.io/api/storage/v1",
|
||||
"k8s.io/api/storage/v1beta1",
|
||||
|
||||
@@ -38,6 +38,7 @@ go_library(
|
||||
"//pkg/apis/networking/install:go_default_library",
|
||||
"//pkg/apis/policy/install:go_default_library",
|
||||
"//pkg/apis/rbac/install:go_default_library",
|
||||
"//pkg/apis/scheduling/install:go_default_library",
|
||||
"//pkg/apis/settings/install:go_default_library",
|
||||
"//pkg/apis/storage/install:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset/typed/core/internalversion:go_default_library",
|
||||
@@ -59,6 +60,7 @@ go_library(
|
||||
"//pkg/registry/networking/rest:go_default_library",
|
||||
"//pkg/registry/policy/rest:go_default_library",
|
||||
"//pkg/registry/rbac/rest:go_default_library",
|
||||
"//pkg/registry/scheduling/rest:go_default_library",
|
||||
"//pkg/registry/settings/rest:go_default_library",
|
||||
"//pkg/registry/storage/rest:go_default_library",
|
||||
"//pkg/routes:go_default_library",
|
||||
@@ -80,6 +82,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/settings/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/storage/v1beta1:go_default_library",
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/networking/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/scheduling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/settings/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/storage/install"
|
||||
)
|
||||
|
||||
@@ -38,6 +38,7 @@ import (
|
||||
policyapiv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingapiv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
settingv1alpha1 "k8s.io/api/settings/v1alpha1"
|
||||
storageapiv1 "k8s.io/api/storage/v1"
|
||||
storageapiv1beta1 "k8s.io/api/storage/v1beta1"
|
||||
@@ -73,6 +74,7 @@ import (
|
||||
networkingrest "k8s.io/kubernetes/pkg/registry/networking/rest"
|
||||
policyrest "k8s.io/kubernetes/pkg/registry/policy/rest"
|
||||
rbacrest "k8s.io/kubernetes/pkg/registry/rbac/rest"
|
||||
schedulingrest "k8s.io/kubernetes/pkg/registry/scheduling/rest"
|
||||
settingsrest "k8s.io/kubernetes/pkg/registry/settings/rest"
|
||||
storagerest "k8s.io/kubernetes/pkg/registry/storage/rest"
|
||||
)
|
||||
@@ -260,6 +262,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
|
||||
networkingrest.RESTStorageProvider{},
|
||||
policyrest.RESTStorageProvider{},
|
||||
rbacrest.RESTStorageProvider{Authorizer: c.GenericConfig.Authorizer},
|
||||
schedulingrest.RESTStorageProvider{},
|
||||
settingsrest.RESTStorageProvider{},
|
||||
storagerest.RESTStorageProvider{},
|
||||
// keep apps after extensions so legacy clients resolve the extensions versions of shared resource names.
|
||||
@@ -394,6 +397,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
|
||||
// TODO: disable rbac/v1alpha1 and settings/v1alpha1 by default in 1.8
|
||||
rbacv1alpha1.SchemeGroupVersion,
|
||||
settingv1alpha1.SchemeGroupVersion,
|
||||
schedulingapiv1alpha1.SchemeGroupVersion,
|
||||
storageapiv1.SchemeGroupVersion,
|
||||
storageapiv1beta1.SchemeGroupVersion,
|
||||
certificatesapiv1beta1.SchemeGroupVersion,
|
||||
|
||||
@@ -75,6 +75,7 @@ go_library(
|
||||
"//pkg/apis/networking:go_default_library",
|
||||
"//pkg/apis/policy:go_default_library",
|
||||
"//pkg/apis/rbac:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//pkg/apis/storage/util:go_default_library",
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
|
||||
@@ -65,6 +65,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/networking"
|
||||
"k8s.io/kubernetes/pkg/apis/policy"
|
||||
"k8s.io/kubernetes/pkg/apis/rbac"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/apis/storage"
|
||||
storageutil "k8s.io/kubernetes/pkg/apis/storage/util"
|
||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||
@@ -133,6 +134,7 @@ func describerMap(c clientset.Interface) map[schema.GroupKind]printers.Describer
|
||||
api.Kind("Namespace"): &NamespaceDescriber{c},
|
||||
api.Kind("Endpoints"): &EndpointsDescriber{c},
|
||||
api.Kind("ConfigMap"): &ConfigMapDescriber{c},
|
||||
api.Kind("PriorityClass"): &PriorityClassDescriber{c},
|
||||
|
||||
extensions.Kind("ReplicaSet"): &ReplicaSetDescriber{c},
|
||||
extensions.Kind("NetworkPolicy"): &ExtensionsNetworkPolicyDescriber{c},
|
||||
@@ -152,6 +154,7 @@ func describerMap(c clientset.Interface) map[schema.GroupKind]printers.Describer
|
||||
rbac.Kind("RoleBinding"): &RoleBindingDescriber{c},
|
||||
rbac.Kind("ClusterRoleBinding"): &ClusterRoleBindingDescriber{c},
|
||||
networking.Kind("NetworkPolicy"): &NetworkPolicyDescriber{c},
|
||||
scheduling.Kind("PriorityClass"): &PriorityClassDescriber{c},
|
||||
}
|
||||
|
||||
return m
|
||||
@@ -3097,6 +3100,42 @@ func describePodDisruptionBudget(pdb *policy.PodDisruptionBudget, events *api.Ev
|
||||
})
|
||||
}
|
||||
|
||||
// PriorityClassDescriber generates information about a PriorityClass.
|
||||
type PriorityClassDescriber struct {
|
||||
clientset.Interface
|
||||
}
|
||||
|
||||
func (s *PriorityClassDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) {
|
||||
pc, err := s.Scheduling().PriorityClasses().Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var events *api.EventList
|
||||
if describerSettings.ShowEvents {
|
||||
events, _ = s.Core().Events(namespace).Search(api.Scheme, pc)
|
||||
}
|
||||
|
||||
return describePriorityClass(pc, events)
|
||||
}
|
||||
|
||||
func describePriorityClass(pc *scheduling.PriorityClass, events *api.EventList) (string, error) {
|
||||
return tabbedString(func(out io.Writer) error {
|
||||
w := NewPrefixWriter(out)
|
||||
w.Write(LEVEL_0, "Name:\t%s\n", pc.Name)
|
||||
w.Write(LEVEL_0, "Value:\t%s\n", pc.Value)
|
||||
w.Write(LEVEL_0, "GlobalDefault:\t%s\n", pc.GlobalDefault)
|
||||
w.Write(LEVEL_0, "Description:\t%s\n", pc.Description)
|
||||
|
||||
w.Write(LEVEL_0, "Annotations:\t%s\n", labels.FormatLabels(pc.Annotations))
|
||||
if events != nil {
|
||||
DescribeEvents(events, w)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// newErrNoDescriber creates a new ErrNoDescriber with the names of the provided types.
|
||||
func newErrNoDescriber(types ...reflect.Type) error {
|
||||
names := make([]string, 0, len(types))
|
||||
|
||||
@@ -77,6 +77,8 @@ filegroup(
|
||||
"//pkg/registry/policy/rest:all-srcs",
|
||||
"//pkg/registry/rbac:all-srcs",
|
||||
"//pkg/registry/registrytest:all-srcs",
|
||||
"//pkg/registry/scheduling/priorityclass:all-srcs",
|
||||
"//pkg/registry/scheduling/rest:all-srcs",
|
||||
"//pkg/registry/settings/podpreset:all-srcs",
|
||||
"//pkg/registry/settings/rest:all-srcs",
|
||||
"//pkg/registry/storage/rest:all-srcs",
|
||||
|
||||
@@ -51,6 +51,7 @@ const (
|
||||
Pods Resource = "pods"
|
||||
PodSecurityPolicies Resource = "podsecuritypolicies"
|
||||
PodTemplates Resource = "podtemplates"
|
||||
PriorityClasses Resource = "priorityclasses"
|
||||
Replicasets Resource = "replicasets"
|
||||
ResourceQuotas Resource = "resourcequotas"
|
||||
CronJobs Resource = "cronjobs"
|
||||
|
||||
64
pkg/registry/scheduling/priorityclass/BUILD
Normal file
64
pkg/registry/scheduling/priorityclass/BUILD
Normal file
@@ -0,0 +1,64 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["strategy_test.go"],
|
||||
library = ":go_default_library",
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"registry.go",
|
||||
"strategy.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/apis/scheduling/validation:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/storage:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/storage/names:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [
|
||||
":package-srcs",
|
||||
"//pkg/registry/scheduling/priorityclass/storage:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
17
pkg/registry/scheduling/priorityclass/doc.go
Normal file
17
pkg/registry/scheduling/priorityclass/doc.go
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package priorityclass // import "k8s.io/kubernetes/pkg/registry/scheduling/priorityclass"
|
||||
84
pkg/registry/scheduling/priorityclass/registry.go
Normal file
84
pkg/registry/scheduling/priorityclass/registry.go
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package priorityclass
|
||||
|
||||
import (
|
||||
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
// Registry is an interface for things that know how to store PriorityClass.
|
||||
type Registry interface {
|
||||
ListPriorityClasses(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*scheduling.PriorityClassList, error)
|
||||
CreatePriorityClass(ctx genericapirequest.Context, pc *scheduling.PriorityClass) error
|
||||
UpdatePriorityClass(ctx genericapirequest.Context, pc *scheduling.PriorityClass) error
|
||||
GetPriorityClass(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*scheduling.PriorityClass, error)
|
||||
DeletePriorityClass(ctx genericapirequest.Context, name string) error
|
||||
WatchPriorityClasses(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
|
||||
// storage puts strong typing around storage calls
|
||||
type storage struct {
|
||||
rest.StandardStorage
|
||||
}
|
||||
|
||||
// NewRegistry returns a new Registry interface for the given Storage. Any mismatched
|
||||
// types will panic.
|
||||
func NewRegistry(s rest.StandardStorage) Registry {
|
||||
return &storage{s}
|
||||
}
|
||||
|
||||
func (s *storage) ListPriorityClasses(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*scheduling.PriorityClassList, error) {
|
||||
obj, err := s.List(ctx, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*scheduling.PriorityClassList), nil
|
||||
}
|
||||
|
||||
func (s *storage) CreatePriorityClass(ctx genericapirequest.Context, pc *scheduling.PriorityClass) error {
|
||||
_, err := s.Create(ctx, pc, false)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *storage) UpdatePriorityClass(ctx genericapirequest.Context, pc *scheduling.PriorityClass) error {
|
||||
_, _, err := s.Update(ctx, pc.Name, rest.DefaultUpdatedObjectInfo(pc, api.Scheme))
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *storage) WatchPriorityClasses(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
|
||||
return s.Watch(ctx, options)
|
||||
}
|
||||
|
||||
func (s *storage) GetPriorityClass(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*scheduling.PriorityClass, error) {
|
||||
obj, err := s.Get(ctx, name, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*scheduling.PriorityClass), nil
|
||||
}
|
||||
|
||||
func (s *storage) DeletePriorityClass(ctx genericapirequest.Context, name string) error {
|
||||
_, _, err := s.Delete(ctx, name, nil)
|
||||
return err
|
||||
}
|
||||
55
pkg/registry/scheduling/priorityclass/storage/BUILD
Normal file
55
pkg/registry/scheduling/priorityclass/storage/BUILD
Normal file
@@ -0,0 +1,55 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["storage_test.go"],
|
||||
library = ":go_default_library",
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/registry/registrytest:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/storage/etcd/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["storage.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/registry/cachesize:go_default_library",
|
||||
"//pkg/registry/scheduling/priorityclass:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
63
pkg/registry/scheduling/priorityclass/storage/storage.go
Normal file
63
pkg/registry/scheduling/priorityclass/storage/storage.go
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/registry/generic"
|
||||
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
schedulingapi "k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/registry/cachesize"
|
||||
"k8s.io/kubernetes/pkg/registry/scheduling/priorityclass"
|
||||
)
|
||||
|
||||
// rest implements a RESTStorage for priority classes against etcd
|
||||
type REST struct {
|
||||
*genericregistry.Store
|
||||
}
|
||||
|
||||
// NewREST returns a RESTStorage object that will work against priority classes.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &schedulingapi.PriorityClass{} },
|
||||
NewListFunc: func() runtime.Object { return &schedulingapi.PriorityClassList{} },
|
||||
PredicateFunc: priorityclass.Matcher,
|
||||
QualifiedResource: schedulingapi.Resource("priorityclasses"),
|
||||
WatchCacheSize: cachesize.GetWatchCacheSizeByResource("priorityclasses"),
|
||||
|
||||
CreateStrategy: priorityclass.Strategy,
|
||||
UpdateStrategy: priorityclass.Strategy,
|
||||
DeleteStrategy: priorityclass.Strategy,
|
||||
}
|
||||
options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: priorityclass.GetAttrs}
|
||||
if err := store.CompleteWithOptions(options); err != nil {
|
||||
panic(err) // TODO: Propagate error up
|
||||
}
|
||||
|
||||
return &REST{store}
|
||||
}
|
||||
|
||||
// Implement ShortNamesProvider
|
||||
var _ rest.ShortNamesProvider = &REST{}
|
||||
|
||||
// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.
|
||||
func (r *REST) ShortNames() []string {
|
||||
return []string{"pc"}
|
||||
}
|
||||
153
pkg/registry/scheduling/priorityclass/storage/storage_test.go
Normal file
153
pkg/registry/scheduling/priorityclass/storage/storage_test.go
Normal file
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/registry/generic"
|
||||
etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
)
|
||||
|
||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||
etcdStorage, server := registrytest.NewEtcdStorage(t, scheduling.GroupName)
|
||||
restOptions := generic.RESTOptions{
|
||||
StorageConfig: etcdStorage,
|
||||
Decorator: generic.UndecoratedStorage,
|
||||
DeleteCollectionWorkers: 1,
|
||||
ResourcePrefix: "priorityclasses",
|
||||
}
|
||||
return NewREST(restOptions), server
|
||||
}
|
||||
|
||||
func validNewPriorityClass() *scheduling.PriorityClass {
|
||||
return &scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo",
|
||||
},
|
||||
Value: 100,
|
||||
GlobalDefault: false,
|
||||
Description: "This is created only for testing.",
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestCreate(
|
||||
validNewPriorityClass(),
|
||||
// invalid cases
|
||||
&scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "*badName",
|
||||
},
|
||||
Value: 100,
|
||||
GlobalDefault: true,
|
||||
Description: "This is created only for testing.",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func TestUpdate(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestUpdate(
|
||||
// valid
|
||||
validNewPriorityClass(),
|
||||
// There is no valid update function
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
pc := obj.(*scheduling.PriorityClass)
|
||||
pc.Value = 100
|
||||
pc.GlobalDefault = false
|
||||
return pc
|
||||
},
|
||||
// invalid updates
|
||||
// Change Value
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
pc := obj.(*scheduling.PriorityClass)
|
||||
pc.Value = 200
|
||||
pc.GlobalDefault = false
|
||||
return pc
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestDelete(validNewPriorityClass())
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestGet(validNewPriorityClass())
|
||||
}
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestList(validNewPriorityClass())
|
||||
}
|
||||
|
||||
func TestWatch(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
test := registrytest.New(t, storage.Store).ClusterScope()
|
||||
test.TestWatch(
|
||||
validNewPriorityClass(),
|
||||
// matching labels
|
||||
[]labels.Set{},
|
||||
// not matching labels
|
||||
[]labels.Set{
|
||||
{"foo": "bar"},
|
||||
},
|
||||
// matching fields
|
||||
[]fields.Set{
|
||||
{"metadata.name": "foo"},
|
||||
},
|
||||
// not matching fields
|
||||
[]fields.Set{
|
||||
{"metadata.name": "bar"},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func TestShortNames(t *testing.T) {
|
||||
storage, server := newStorage(t)
|
||||
defer server.Terminate(t)
|
||||
defer storage.Store.DestroyFunc()
|
||||
expected := []string{"pc"}
|
||||
registrytest.AssertShortNames(t, storage, expected)
|
||||
}
|
||||
109
pkg/registry/scheduling/priorityclass/strategy.go
Normal file
109
pkg/registry/scheduling/priorityclass/strategy.go
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package priorityclass
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/registry/generic"
|
||||
apistorage "k8s.io/apiserver/pkg/storage"
|
||||
"k8s.io/apiserver/pkg/storage/names"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling/validation"
|
||||
)
|
||||
|
||||
// priorityClassStrategy implements verification logic for PriorityClass.
|
||||
type priorityClassStrategy struct {
|
||||
runtime.ObjectTyper
|
||||
names.NameGenerator
|
||||
}
|
||||
|
||||
// Strategy is the default logic that applies when creating and updating PriorityClass objects.
|
||||
var Strategy = priorityClassStrategy{api.Scheme, names.SimpleNameGenerator}
|
||||
|
||||
// NamespaceScoped returns true because all PriorityClasses are global.
|
||||
func (priorityClassStrategy) NamespaceScoped() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// PrepareForCreate clears the status of a PriorityClass before creation.
|
||||
func (priorityClassStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
|
||||
pc := obj.(*scheduling.PriorityClass)
|
||||
pc.Generation = 1
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
func (priorityClassStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
|
||||
_ = obj.(*scheduling.PriorityClass)
|
||||
_ = old.(*scheduling.PriorityClass)
|
||||
}
|
||||
|
||||
// Validate validates a new PriorityClass.
|
||||
func (priorityClassStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
|
||||
pc := obj.(*scheduling.PriorityClass)
|
||||
return validation.ValidatePriorityClass(pc)
|
||||
}
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (priorityClassStrategy) Canonicalize(obj runtime.Object) {}
|
||||
|
||||
// AllowCreateOnUpdate is false for PriorityClass; this means POST is needed to create one.
|
||||
func (priorityClassStrategy) AllowCreateOnUpdate() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (priorityClassStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
|
||||
validationErrorList := validation.ValidatePriorityClass(obj.(*scheduling.PriorityClass))
|
||||
updateErrorList := validation.ValidatePriorityClassUpdate(obj.(*scheduling.PriorityClass), old.(*scheduling.PriorityClass))
|
||||
return append(validationErrorList, updateErrorList...)
|
||||
}
|
||||
|
||||
// AllowUnconditionalUpdate is the default update policy for PriorityClass objects.
|
||||
func (priorityClassStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// SelectableFields returns a field set that represents the object.
|
||||
func SelectableFields(pc *scheduling.PriorityClass) fields.Set {
|
||||
return generic.ObjectMetaFieldsSet(&pc.ObjectMeta, false)
|
||||
}
|
||||
|
||||
// GetAttrs returns labels and fields of a given object for filtering purposes.
|
||||
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
|
||||
pc, ok := obj.(*scheduling.PriorityClass)
|
||||
if !ok {
|
||||
return nil, nil, false, fmt.Errorf("given object is not a PriorityClass")
|
||||
}
|
||||
return labels.Set(pc.ObjectMeta.Labels), SelectableFields(pc), pc.Initializers != nil, nil
|
||||
}
|
||||
|
||||
// Matcher is the filter used by the generic etcd backend to watch events
|
||||
// from etcd to clients of the apiserver only interested in specific labels/fields.
|
||||
func Matcher(label labels.Selector, field fields.Selector) apistorage.SelectionPredicate {
|
||||
return apistorage.SelectionPredicate{
|
||||
Label: label,
|
||||
Field: field,
|
||||
GetAttrs: GetAttrs,
|
||||
}
|
||||
}
|
||||
64
pkg/registry/scheduling/priorityclass/strategy_test.go
Normal file
64
pkg/registry/scheduling/priorityclass/strategy_test.go
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package priorityclass
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
)
|
||||
|
||||
func TestPriorityClassStrategy(t *testing.T) {
|
||||
ctx := genericapirequest.NewDefaultContext()
|
||||
if Strategy.NamespaceScoped() {
|
||||
t.Errorf("PriorityClass must not be namespace scoped")
|
||||
}
|
||||
if Strategy.AllowCreateOnUpdate() {
|
||||
t.Errorf("PriorityClass should not allow create on update")
|
||||
}
|
||||
|
||||
priorityClass := &scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "valid-class",
|
||||
},
|
||||
Value: 10,
|
||||
}
|
||||
|
||||
Strategy.PrepareForCreate(ctx, priorityClass)
|
||||
|
||||
errs := Strategy.Validate(ctx, priorityClass)
|
||||
if len(errs) != 0 {
|
||||
t.Errorf("unexpected error validating %v", errs)
|
||||
}
|
||||
|
||||
newPriorityClass := &scheduling.PriorityClass{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "valid-class-2",
|
||||
ResourceVersion: "4",
|
||||
},
|
||||
Value: 20,
|
||||
}
|
||||
|
||||
Strategy.PrepareForUpdate(ctx, newPriorityClass, priorityClass)
|
||||
|
||||
errs = Strategy.ValidateUpdate(ctx, newPriorityClass, priorityClass)
|
||||
if len(errs) == 0 {
|
||||
t.Errorf("Expected a validation error")
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user