Merge pull request #95718 from SergeyKanzhelev/runtimeClass2

RuntimeClass GA
This commit is contained in:
Kubernetes Prow Robot 2020-11-12 00:44:51 -08:00 committed by GitHub
commit 12d9183da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
88 changed files with 4377 additions and 305 deletions

View File

@ -12814,6 +12814,115 @@
},
"type": "object"
},
"io.k8s.api.node.v1.Overhead": {
"description": "Overhead structure represents the resource overhead associated with running a pod.",
"properties": {
"podFixed": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
},
"description": "PodFixed represents the fixed resource overhead associated with running a pod.",
"type": "object"
}
},
"type": "object"
},
"io.k8s.api.node.v1.RuntimeClass": {
"description": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/",
"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/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"handler": {
"description": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
"type": "string"
},
"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/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta",
"description": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
},
"overhead": {
"$ref": "#/definitions/io.k8s.api.node.v1.Overhead",
"description": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see\n https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/\nThis field is in beta starting v1.18 and is only honored by servers that enable the PodOverhead feature."
},
"scheduling": {
"$ref": "#/definitions/io.k8s.api.node.v1.Scheduling",
"description": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes."
}
},
"required": [
"handler"
],
"type": "object",
"x-kubernetes-group-version-kind": [
{
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
]
},
"io.k8s.api.node.v1.RuntimeClassList": {
"description": "RuntimeClassList is a list of RuntimeClass objects.",
"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/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"description": "Items is a list of schema objects.",
"items": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
},
"type": "array"
},
"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/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta",
"description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
}
},
"required": [
"items"
],
"type": "object",
"x-kubernetes-group-version-kind": [
{
"group": "node.k8s.io",
"kind": "RuntimeClassList",
"version": "v1"
}
]
},
"io.k8s.api.node.v1.Scheduling": {
"description": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.",
"properties": {
"nodeSelector": {
"additionalProperties": {
"type": "string"
},
"description": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.",
"type": "object"
},
"tolerations": {
"description": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"type": "object"
},
"io.k8s.api.node.v1alpha1.Overhead": {
"description": "Overhead structure represents the resource overhead associated with running a pod.",
"properties": {
@ -17794,6 +17903,11 @@
"kind": "DeleteOptions",
"version": "v1beta1"
},
{
"group": "node.k8s.io",
"kind": "DeleteOptions",
"version": "v1"
},
{
"group": "node.k8s.io",
"kind": "DeleteOptions",
@ -18446,6 +18560,11 @@
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "node.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "node.k8s.io",
"kind": "WatchEvent",
@ -79726,6 +79845,856 @@
]
}
},
"/apis/node.k8s.io/v1/": {
"get": {
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"description": "get available resources",
"operationId": "getNodeV1APIResources",
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
]
}
},
"/apis/node.k8s.io/v1/runtimeclasses": {
"delete": {
"consumes": [
"*/*"
],
"description": "delete collection of RuntimeClass",
"operationId": "deleteNodeV1CollectionRuntimeClass",
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
}
},
{
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
"in": "query",
"name": "continue",
"type": "string",
"uniqueItems": true
},
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"in": "query",
"name": "fieldSelector",
"type": "string",
"uniqueItems": true
},
{
"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.",
"in": "query",
"name": "gracePeriodSeconds",
"type": "integer",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"in": "query",
"name": "labelSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
"in": "query",
"name": "limit",
"type": "integer",
"uniqueItems": true
},
{
"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.",
"in": "query",
"name": "orphanDependents",
"type": "boolean",
"uniqueItems": true
},
{
"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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
"in": "query",
"name": "propagationPolicy",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersion",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersionMatch",
"type": "string",
"uniqueItems": true
},
{
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"in": "query",
"name": "timeoutSeconds",
"type": "integer",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "deletecollection",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"get": {
"consumes": [
"*/*"
],
"description": "list or watch objects of kind RuntimeClass",
"operationId": "listNodeV1RuntimeClass",
"parameters": [
{
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
"in": "query",
"name": "allowWatchBookmarks",
"type": "boolean",
"uniqueItems": true
},
{
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
"in": "query",
"name": "continue",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"in": "query",
"name": "fieldSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"in": "query",
"name": "labelSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
"in": "query",
"name": "limit",
"type": "integer",
"uniqueItems": true
},
{
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersion",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersionMatch",
"type": "string",
"uniqueItems": true
},
{
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"in": "query",
"name": "timeoutSeconds",
"type": "integer",
"uniqueItems": true
},
{
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
"in": "query",
"name": "watch",
"type": "boolean",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClassList"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "list",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"parameters": [
{
"description": "If 'true', then the output is pretty printed.",
"in": "query",
"name": "pretty",
"type": "string",
"uniqueItems": true
}
],
"post": {
"consumes": [
"*/*"
],
"description": "create a RuntimeClass",
"operationId": "createNodeV1RuntimeClass",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"in": "query",
"name": "fieldManager",
"type": "string",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "post",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
}
},
"/apis/node.k8s.io/v1/runtimeclasses/{name}": {
"delete": {
"consumes": [
"*/*"
],
"description": "delete a RuntimeClass",
"operationId": "deleteNodeV1RuntimeClass",
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
}
},
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"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.",
"in": "query",
"name": "gracePeriodSeconds",
"type": "integer",
"uniqueItems": true
},
{
"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.",
"in": "query",
"name": "orphanDependents",
"type": "boolean",
"uniqueItems": true
},
{
"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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
"in": "query",
"name": "propagationPolicy",
"type": "string",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "delete",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"get": {
"consumes": [
"*/*"
],
"description": "read the specified RuntimeClass",
"operationId": "readNodeV1RuntimeClass",
"parameters": [
{
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.",
"in": "query",
"name": "exact",
"type": "boolean",
"uniqueItems": true
},
{
"description": "Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.",
"in": "query",
"name": "export",
"type": "boolean",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "get",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"parameters": [
{
"description": "name of the RuntimeClass",
"in": "path",
"name": "name",
"required": true,
"type": "string",
"uniqueItems": true
},
{
"description": "If 'true', then the output is pretty printed.",
"in": "query",
"name": "pretty",
"type": "string",
"uniqueItems": true
}
],
"patch": {
"consumes": [
"application/json-patch+json",
"application/merge-patch+json",
"application/strategic-merge-patch+json",
"application/apply-patch+yaml"
],
"description": "partially update the specified RuntimeClass",
"operationId": "patchNodeV1RuntimeClass",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
}
},
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).",
"in": "query",
"name": "fieldManager",
"type": "string",
"uniqueItems": true
},
{
"description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.",
"in": "query",
"name": "force",
"type": "boolean",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "patch",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"put": {
"consumes": [
"*/*"
],
"description": "replace the specified RuntimeClass",
"operationId": "replaceNodeV1RuntimeClass",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"in": "query",
"name": "fieldManager",
"type": "string",
"uniqueItems": true
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/io.k8s.api.node.v1.RuntimeClass"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "put",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
}
},
"/apis/node.k8s.io/v1/watch/runtimeclasses": {
"get": {
"consumes": [
"*/*"
],
"description": "watch individual changes to a list of RuntimeClass. deprecated: use the 'watch' parameter with a list operation instead.",
"operationId": "watchNodeV1RuntimeClassList",
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "watchlist",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"parameters": [
{
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
"in": "query",
"name": "allowWatchBookmarks",
"type": "boolean",
"uniqueItems": true
},
{
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
"in": "query",
"name": "continue",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"in": "query",
"name": "fieldSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"in": "query",
"name": "labelSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
"in": "query",
"name": "limit",
"type": "integer",
"uniqueItems": true
},
{
"description": "If 'true', then the output is pretty printed.",
"in": "query",
"name": "pretty",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersion",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersionMatch",
"type": "string",
"uniqueItems": true
},
{
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"in": "query",
"name": "timeoutSeconds",
"type": "integer",
"uniqueItems": true
},
{
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
"in": "query",
"name": "watch",
"type": "boolean",
"uniqueItems": true
}
]
},
"/apis/node.k8s.io/v1/watch/runtimeclasses/{name}": {
"get": {
"consumes": [
"*/*"
],
"description": "watch changes to an object of kind RuntimeClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.",
"operationId": "watchNodeV1RuntimeClass",
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"node_v1"
],
"x-kubernetes-action": "watch",
"x-kubernetes-group-version-kind": {
"group": "node.k8s.io",
"kind": "RuntimeClass",
"version": "v1"
}
},
"parameters": [
{
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
"in": "query",
"name": "allowWatchBookmarks",
"type": "boolean",
"uniqueItems": true
},
{
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
"in": "query",
"name": "continue",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"in": "query",
"name": "fieldSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"in": "query",
"name": "labelSelector",
"type": "string",
"uniqueItems": true
},
{
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
"in": "query",
"name": "limit",
"type": "integer",
"uniqueItems": true
},
{
"description": "name of the RuntimeClass",
"in": "path",
"name": "name",
"required": true,
"type": "string",
"uniqueItems": true
},
{
"description": "If 'true', then the output is pretty printed.",
"in": "query",
"name": "pretty",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersion",
"type": "string",
"uniqueItems": true
},
{
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersionMatch",
"type": "string",
"uniqueItems": true
},
{
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"in": "query",
"name": "timeoutSeconds",
"type": "integer",
"uniqueItems": true
},
{
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
"in": "query",
"name": "watch",
"type": "boolean",
"uniqueItems": true
}
]
},
"/apis/node.k8s.io/v1alpha1/": {
"get": {
"consumes": [

View File

@ -67,6 +67,7 @@ tags_values_pkgs = {"openapi-gen": {
"staging/src/k8s.io/api/imagepolicy/v1alpha1",
"staging/src/k8s.io/api/networking/v1",
"staging/src/k8s.io/api/networking/v1beta1",
"staging/src/k8s.io/api/node/v1",
"staging/src/k8s.io/api/node/v1alpha1",
"staging/src/k8s.io/api/node/v1beta1",
"staging/src/k8s.io/api/policy/v1beta1",
@ -152,6 +153,7 @@ tags_pkgs_values = {"openapi-gen": {
"staging/src/k8s.io/api/imagepolicy/v1alpha1": ["true"],
"staging/src/k8s.io/api/networking/v1": ["true"],
"staging/src/k8s.io/api/networking/v1beta1": ["true"],
"staging/src/k8s.io/api/node/v1": ["true"],
"staging/src/k8s.io/api/node/v1alpha1": ["true"],
"staging/src/k8s.io/api/node/v1beta1": ["true"],
"staging/src/k8s.io/api/policy/v1beta1": ["true"],

View File

@ -278,6 +278,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
{Group: "scheduling.k8s.io", Version: "v1alpha1"}: {group: 16600, version: 9},
{Group: "coordination.k8s.io", Version: "v1"}: {group: 16500, version: 15},
{Group: "coordination.k8s.io", Version: "v1beta1"}: {group: 16500, version: 9},
{Group: "node.k8s.io", Version: "v1"}: {group: 16300, version: 15},
{Group: "node.k8s.io", Version: "v1alpha1"}: {group: 16300, version: 1},
{Group: "node.k8s.io", Version: "v1beta1"}: {group: 16300, version: 9},
{Group: "discovery.k8s.io", Version: "v1beta1"}: {group: 16200, version: 12},

View File

@ -27,6 +27,7 @@
"k8s.io/api/networking/v1beta1": "networkingv1beta1",
"k8s.io/api/node/v1alpha1": "nodev1alpha1",
"k8s.io/api/node/v1beta1": "nodev1beta1",
"k8s.io/api/node/v1": "nodev1",
"k8s.io/api/policy/v1beta1": "policyv1beta1",
"k8s.io/api/rbac/v1": "rbacv1",
"k8s.io/api/rbac/v1alpha1": "rbacv1alpha1",

View File

@ -92,6 +92,7 @@ events.k8s.io/v1beta1 \
imagepolicy.k8s.io/v1alpha1 \
networking.k8s.io/v1 \
networking.k8s.io/v1beta1 \
node.k8s.io/v1 \
node.k8s.io/v1alpha1 \
node.k8s.io/v1beta1 \
policy/v1beta1 \

View File

@ -488,11 +488,6 @@ func dropDisabledFields(
dropDisabledFSGroupFields(podSpec, oldPodSpec)
if !utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) && !runtimeClassInUse(oldPodSpec) {
// Set RuntimeClassName to nil only if feature is disabled and it is not used
podSpec.RuntimeClassName = nil
}
if !utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) && !overheadInUse(oldPodSpec) {
// Set Overhead to nil only if the feature is disabled and it is not used
podSpec.Overhead = nil
@ -618,17 +613,6 @@ func subpathInUse(podSpec *api.PodSpec) bool {
return inUse
}
// runtimeClassInUse returns true if the pod spec is non-nil and has a RuntimeClassName set
func runtimeClassInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {
return false
}
if podSpec.RuntimeClassName != nil {
return true
}
return false
}
// overheadInUse returns true if the pod spec is non-nil and has Overhead set
func overheadInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {

View File

@ -717,95 +717,6 @@ func TestDropSubPath(t *testing.T) {
}
}
func TestDropRuntimeClass(t *testing.T) {
runtimeClassName := "some_container_engine"
podWithoutRuntimeClass := func() *api.Pod {
return &api.Pod{
Spec: api.PodSpec{
RuntimeClassName: nil,
},
}
}
podWithRuntimeClass := func() *api.Pod {
return &api.Pod{
Spec: api.PodSpec{
RuntimeClassName: &runtimeClassName,
},
}
}
podInfo := []struct {
description string
hasPodRuntimeClassName bool
pod func() *api.Pod
}{
{
description: "pod Without RuntimeClassName",
hasPodRuntimeClassName: false,
pod: podWithoutRuntimeClass,
},
{
description: "pod With RuntimeClassName",
hasPodRuntimeClassName: true,
pod: podWithRuntimeClass,
},
{
description: "is nil",
hasPodRuntimeClassName: false,
pod: func() *api.Pod { return nil },
},
}
for _, enabled := range []bool{true, false} {
for _, oldPodInfo := range podInfo {
for _, newPodInfo := range podInfo {
oldPodHasRuntimeClassName, oldPod := oldPodInfo.hasPodRuntimeClassName, oldPodInfo.pod()
newPodHasRuntimeClassName, newPod := newPodInfo.hasPodRuntimeClassName, newPodInfo.pod()
if newPod == nil {
continue
}
t.Run(fmt.Sprintf("feature enabled=%v, old pod %v, new pod %v", enabled, oldPodInfo.description, newPodInfo.description), func(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RuntimeClass, enabled)()
var oldPodSpec *api.PodSpec
if oldPod != nil {
oldPodSpec = &oldPod.Spec
}
dropDisabledFields(&newPod.Spec, nil, oldPodSpec, nil)
// old pod should never be changed
if !reflect.DeepEqual(oldPod, oldPodInfo.pod()) {
t.Errorf("old pod changed: %v", diff.ObjectReflectDiff(oldPod, oldPodInfo.pod()))
}
switch {
case enabled || oldPodHasRuntimeClassName:
// new pod should not be changed if the feature is enabled, or if the old pod had RuntimeClass
if !reflect.DeepEqual(newPod, newPodInfo.pod()) {
t.Errorf("new pod changed: %v", diff.ObjectReflectDiff(newPod, newPodInfo.pod()))
}
case newPodHasRuntimeClassName:
// new pod should be changed
if reflect.DeepEqual(newPod, newPodInfo.pod()) {
t.Errorf("new pod was not changed")
}
// new pod should not have RuntimeClass
if !reflect.DeepEqual(newPod, podWithoutRuntimeClass()) {
t.Errorf("new pod had PodRuntimeClassName: %v", diff.ObjectReflectDiff(newPod, podWithoutRuntimeClass()))
}
default:
// new pod should not need to be changed
if !reflect.DeepEqual(newPod, newPodInfo.pod()) {
t.Errorf("new pod changed: %v", diff.ObjectReflectDiff(newPod, newPodInfo.pod()))
}
}
})
}
}
}
}
func TestDropProcMount(t *testing.T) {
procMount := api.UnmaskedProcMount
defaultProcMount := api.DefaultProcMount

View File

@ -41,6 +41,5 @@ go_test(
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/component-base/featuregate/testing:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
],
)

View File

@ -38,10 +38,6 @@ func DropDisabledFields(pspSpec, oldPSPSpec *policy.PodSecurityPolicySpec) {
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) {
pspSpec.AllowedCSIDrivers = nil
}
if !utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) &&
(oldPSPSpec == nil || oldPSPSpec.RuntimeClass == nil) {
pspSpec.RuntimeClass = nil
}
}
func allowedProcMountTypesInUse(oldPSPSpec *policy.PodSecurityPolicySpec) bool {

View File

@ -21,8 +21,6 @@ import (
"reflect"
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/diff"
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
@ -278,55 +276,3 @@ func TestDropSysctls(t *testing.T) {
}
}
}
func TestDropRuntimeClass(t *testing.T) {
type testcase struct {
name string
featureEnabled bool
pspSpec, oldPSPSpec *policy.PodSecurityPolicySpec
expectRuntimeClass bool
}
tests := []testcase{}
pspGenerator := func(withRuntimeClass bool) *policy.PodSecurityPolicySpec {
psp := &policy.PodSecurityPolicySpec{}
if withRuntimeClass {
psp.RuntimeClass = &policy.RuntimeClassStrategyOptions{
AllowedRuntimeClassNames: []string{policy.AllowAllRuntimeClassNames},
}
}
return psp
}
for _, enabled := range []bool{true, false} {
for _, hasRuntimeClass := range []bool{true, false} {
tests = append(tests, testcase{
name: fmt.Sprintf("create feature:%t hasRC:%t", enabled, hasRuntimeClass),
featureEnabled: enabled,
pspSpec: pspGenerator(hasRuntimeClass),
expectRuntimeClass: enabled && hasRuntimeClass,
})
for _, hadRuntimeClass := range []bool{true, false} {
tests = append(tests, testcase{
name: fmt.Sprintf("update feature:%t hasRC:%t hadRC:%t", enabled, hasRuntimeClass, hadRuntimeClass),
featureEnabled: enabled,
pspSpec: pspGenerator(hasRuntimeClass),
oldPSPSpec: pspGenerator(hadRuntimeClass),
expectRuntimeClass: hasRuntimeClass && (enabled || hadRuntimeClass),
})
}
}
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RuntimeClass, test.featureEnabled)()
DropDisabledFields(test.pspSpec, test.oldPSPSpec)
if test.expectRuntimeClass {
assert.NotNil(t, test.pspSpec.RuntimeClass)
} else {
assert.Nil(t, test.pspSpec.RuntimeClass)
}
})
}
}

View File

@ -2819,8 +2819,7 @@ type PodSpec struct {
// to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.
// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
// empty definition that uses the default runtime handler.
// More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md
// This is a beta feature as of Kubernetes v1.14.
// More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class/README.md
// +optional
RuntimeClassName *string
// Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.

View File

@ -30,6 +30,7 @@ filegroup(
srcs = [
":package-srcs",
"//pkg/apis/node/install:all-srcs",
"//pkg/apis/node/v1:all-srcs",
"//pkg/apis/node/v1alpha1:all-srcs",
"//pkg/apis/node/v1beta1:all-srcs",
"//pkg/apis/node/validation:all-srcs",

View File

@ -8,6 +8,7 @@ go_library(
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/node:go_default_library",
"//pkg/apis/node/v1:go_default_library",
"//pkg/apis/node/v1alpha1:go_default_library",
"//pkg/apis/node/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",

View File

@ -23,6 +23,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/node"
v1 "k8s.io/kubernetes/pkg/apis/node/v1"
"k8s.io/kubernetes/pkg/apis/node/v1alpha1"
"k8s.io/kubernetes/pkg/apis/node/v1beta1"
)
@ -36,5 +37,13 @@ func Install(scheme *runtime.Scheme) {
utilruntime.Must(node.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(v1beta1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion))
utilruntime.Must(v1.AddToScheme(scheme))
// TODO (SergeyKanzhelev): priority should change after 1.21. See https://github.com/kubernetes/kubernetes/pull/95718#discussion_r520969477
// This is what controls the preferred serialization version. Add both v1beta1 and v1 here, and prefer v1beta1 over v1 until 1.21. See the comment on test/integration/etcd around serialized version.
//
// Details on why we can't advance the storage version for a release are at https://kubernetes.io/docs/reference/using-api/deprecation-policy/:
//
// > Rule #4b: The "preferred" API version and the "storage version" for a given group may not advance until after a release has been made that supports both the new version and the previous version
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion, v1.SchemeGroupVersion))
}

View File

@ -29,7 +29,7 @@ import (
// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is
// responsible for resolving the RuntimeClassName reference before running the
// pod. For more details, see
// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md
// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class/README.md
type RuntimeClass struct {
metav1.TypeMeta
// +optional

35
pkg/apis/node/v1/BUILD Normal file
View File

@ -0,0 +1,35 @@
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",
],
importpath = "k8s.io/kubernetes/pkg/apis/node/v1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/node:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/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"],
visibility = ["//visibility:public"],
)

22
pkg/apis/node/v1/doc.go Normal file
View File

@ -0,0 +1,22 @@
/*
Copyright 2020 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/node
// +k8s:conversion-gen-external-types=k8s.io/api/node/v1
// +groupName=node.k8s.io
package v1 // import "k8s.io/kubernetes/pkg/apis/node/v1"

View File

@ -0,0 +1,39 @@
/*
Copyright 2020 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 v1
import (
nodev1 "k8s.io/api/node/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName for node API
const GroupName = "node.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
localSchemeBuilder = &nodev1.SchemeBuilder
// AddToScheme node API registration
AddToScheme = localSchemeBuilder.AddToScheme
)

View File

@ -0,0 +1,172 @@
// +build !ignore_autogenerated
/*
Copyright 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.
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1
import (
unsafe "unsafe"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/node/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
core "k8s.io/kubernetes/pkg/apis/core"
node "k8s.io/kubernetes/pkg/apis/node"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1.Overhead)(nil), (*node.Overhead)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Overhead_To_node_Overhead(a.(*v1.Overhead), b.(*node.Overhead), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*node.Overhead)(nil), (*v1.Overhead)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_node_Overhead_To_v1_Overhead(a.(*node.Overhead), b.(*v1.Overhead), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.RuntimeClass)(nil), (*node.RuntimeClass)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_RuntimeClass_To_node_RuntimeClass(a.(*v1.RuntimeClass), b.(*node.RuntimeClass), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*node.RuntimeClass)(nil), (*v1.RuntimeClass)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_node_RuntimeClass_To_v1_RuntimeClass(a.(*node.RuntimeClass), b.(*v1.RuntimeClass), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.RuntimeClassList)(nil), (*node.RuntimeClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_RuntimeClassList_To_node_RuntimeClassList(a.(*v1.RuntimeClassList), b.(*node.RuntimeClassList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*node.RuntimeClassList)(nil), (*v1.RuntimeClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_node_RuntimeClassList_To_v1_RuntimeClassList(a.(*node.RuntimeClassList), b.(*v1.RuntimeClassList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.Scheduling)(nil), (*node.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Scheduling_To_node_Scheduling(a.(*v1.Scheduling), b.(*node.Scheduling), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*node.Scheduling)(nil), (*v1.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_node_Scheduling_To_v1_Scheduling(a.(*node.Scheduling), b.(*v1.Scheduling), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1_Overhead_To_node_Overhead(in *v1.Overhead, out *node.Overhead, s conversion.Scope) error {
out.PodFixed = *(*core.ResourceList)(unsafe.Pointer(&in.PodFixed))
return nil
}
// Convert_v1_Overhead_To_node_Overhead is an autogenerated conversion function.
func Convert_v1_Overhead_To_node_Overhead(in *v1.Overhead, out *node.Overhead, s conversion.Scope) error {
return autoConvert_v1_Overhead_To_node_Overhead(in, out, s)
}
func autoConvert_node_Overhead_To_v1_Overhead(in *node.Overhead, out *v1.Overhead, s conversion.Scope) error {
out.PodFixed = *(*corev1.ResourceList)(unsafe.Pointer(&in.PodFixed))
return nil
}
// Convert_node_Overhead_To_v1_Overhead is an autogenerated conversion function.
func Convert_node_Overhead_To_v1_Overhead(in *node.Overhead, out *v1.Overhead, s conversion.Scope) error {
return autoConvert_node_Overhead_To_v1_Overhead(in, out, s)
}
func autoConvert_v1_RuntimeClass_To_node_RuntimeClass(in *v1.RuntimeClass, out *node.RuntimeClass, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.Handler = in.Handler
out.Overhead = (*node.Overhead)(unsafe.Pointer(in.Overhead))
out.Scheduling = (*node.Scheduling)(unsafe.Pointer(in.Scheduling))
return nil
}
// Convert_v1_RuntimeClass_To_node_RuntimeClass is an autogenerated conversion function.
func Convert_v1_RuntimeClass_To_node_RuntimeClass(in *v1.RuntimeClass, out *node.RuntimeClass, s conversion.Scope) error {
return autoConvert_v1_RuntimeClass_To_node_RuntimeClass(in, out, s)
}
func autoConvert_node_RuntimeClass_To_v1_RuntimeClass(in *node.RuntimeClass, out *v1.RuntimeClass, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
out.Handler = in.Handler
out.Overhead = (*v1.Overhead)(unsafe.Pointer(in.Overhead))
out.Scheduling = (*v1.Scheduling)(unsafe.Pointer(in.Scheduling))
return nil
}
// Convert_node_RuntimeClass_To_v1_RuntimeClass is an autogenerated conversion function.
func Convert_node_RuntimeClass_To_v1_RuntimeClass(in *node.RuntimeClass, out *v1.RuntimeClass, s conversion.Scope) error {
return autoConvert_node_RuntimeClass_To_v1_RuntimeClass(in, out, s)
}
func autoConvert_v1_RuntimeClassList_To_node_RuntimeClassList(in *v1.RuntimeClassList, out *node.RuntimeClassList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]node.RuntimeClass)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_v1_RuntimeClassList_To_node_RuntimeClassList is an autogenerated conversion function.
func Convert_v1_RuntimeClassList_To_node_RuntimeClassList(in *v1.RuntimeClassList, out *node.RuntimeClassList, s conversion.Scope) error {
return autoConvert_v1_RuntimeClassList_To_node_RuntimeClassList(in, out, s)
}
func autoConvert_node_RuntimeClassList_To_v1_RuntimeClassList(in *node.RuntimeClassList, out *v1.RuntimeClassList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]v1.RuntimeClass)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_node_RuntimeClassList_To_v1_RuntimeClassList is an autogenerated conversion function.
func Convert_node_RuntimeClassList_To_v1_RuntimeClassList(in *node.RuntimeClassList, out *v1.RuntimeClassList, s conversion.Scope) error {
return autoConvert_node_RuntimeClassList_To_v1_RuntimeClassList(in, out, s)
}
func autoConvert_v1_Scheduling_To_node_Scheduling(in *v1.Scheduling, out *node.Scheduling, s conversion.Scope) error {
out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector))
out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations))
return nil
}
// Convert_v1_Scheduling_To_node_Scheduling is an autogenerated conversion function.
func Convert_v1_Scheduling_To_node_Scheduling(in *v1.Scheduling, out *node.Scheduling, s conversion.Scope) error {
return autoConvert_v1_Scheduling_To_node_Scheduling(in, out, s)
}
func autoConvert_node_Scheduling_To_v1_Scheduling(in *node.Scheduling, out *v1.Scheduling, s conversion.Scope) error {
out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector))
out.Tolerations = *(*[]corev1.Toleration)(unsafe.Pointer(&in.Tolerations))
return nil
}
// Convert_node_Scheduling_To_v1_Scheduling is an autogenerated conversion function.
func Convert_node_Scheduling_To_v1_Scheduling(in *node.Scheduling, out *v1.Scheduling, s conversion.Scope) error {
return autoConvert_node_Scheduling_To_v1_Scheduling(in, out, s)
}

View File

@ -96,6 +96,7 @@ go_library(
"//staging/src/k8s.io/api/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",

View File

@ -51,6 +51,7 @@ import (
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
networkingapiv1 "k8s.io/api/networking/v1"
networkingapiv1beta1 "k8s.io/api/networking/v1beta1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyapiv1beta1 "k8s.io/api/policy/v1beta1"
@ -676,6 +677,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
extensionsapiv1beta1.SchemeGroupVersion,
networkingapiv1.SchemeGroupVersion,
networkingapiv1beta1.SchemeGroupVersion,
nodev1.SchemeGroupVersion,
nodev1beta1.SchemeGroupVersion,
policyapiv1beta1.SchemeGroupVersion,
rbacv1.SchemeGroupVersion,

View File

@ -73,6 +73,7 @@ var GVRToStorageVersionHash = map[string]string{
"networking.k8s.io/v1beta1/ingressclasses": "l/iqIbDgFyQ=",
"networking.k8s.io/v1/ingresses": "ZOAfGflaKd0=",
"networking.k8s.io/v1/ingressclasses": "l/iqIbDgFyQ=",
"node.k8s.io/v1/runtimeclasses": "8nMHWqj34s0=",
"node.k8s.io/v1beta1/runtimeclasses": "8nMHWqj34s0=",
"policy/v1beta1/poddisruptionbudgets": "6BGBu0kpHtk=",
"policy/v1beta1/podsecuritypolicies": "khBLobUXkqA=",

View File

@ -306,6 +306,7 @@ const (
// owner: @tallclair
// alpha: v1.12
// beta: v1.14
// GA: v1.20
//
// Enables RuntimeClass, for selecting between multiple runtimes to run a pod.
RuntimeClass featuregate.Feature = "RuntimeClass"
@ -755,7 +756,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
CSIStorageCapacity: {Default: false, PreRelease: featuregate.Alpha},
GenericEphemeralVolume: {Default: false, PreRelease: featuregate.Alpha},
CSIVolumeFSGroupPolicy: {Default: false, PreRelease: featuregate.Alpha},
RuntimeClass: {Default: true, PreRelease: featuregate.Beta},
RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23
NodeLease: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
SCTPSupport: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22
VolumeSnapshotDataSource: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21

View File

@ -154,7 +154,7 @@ func DefaultOffAdmissionPlugins() sets.String {
storageobjectinuseprotection.PluginName, //StorageObjectInUseProtection
podpriority.PluginName, //PodPriority
nodetaint.PluginName, //TaintNodesByCondition
runtimeclass.PluginName, //RuntimeClass, gates internally on the feature
runtimeclass.PluginName, //RuntimeClass
certapproval.PluginName, // CertificateApproval
certsigning.PluginName, // CertificateSigning
certsubjectrestriction.PluginName, // CertificateSubjectRestriction

View File

@ -568,7 +568,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
klet.dockerLegacyService = kubeDeps.dockerLegacyService
klet.runtimeService = kubeDeps.RemoteRuntimeService
if utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) && kubeDeps.KubeClient != nil {
if kubeDeps.KubeClient != nil {
klet.runtimeClassManager = runtimeclass.NewManager(kubeDeps.KubeClient)
}

View File

@ -53,7 +53,7 @@ func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32
}
runtimeHandler := ""
if utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) && m.runtimeClassManager != nil {
if m.runtimeClassManager != nil {
runtimeHandler, err = m.runtimeClassManager.LookupRuntimeHandler(pod.Spec.RuntimeClassName)
if err != nil {
message := fmt.Sprintf("CreatePodSandbox for pod %q failed: %v", format.Pod(pod), err)

View File

@ -25,11 +25,8 @@ import (
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
apitest "k8s.io/cri-api/pkg/apis/testing"
"k8s.io/kubernetes/pkg/features"
containertest "k8s.io/kubernetes/pkg/kubelet/container/testing"
"k8s.io/kubernetes/pkg/kubelet/runtimeclass"
rctest "k8s.io/kubernetes/pkg/kubelet/runtimeclass/testing"
@ -103,8 +100,6 @@ func TestGeneratePodSandboxLinuxConfigSeccomp(t *testing.T) {
// TestCreatePodSandbox_RuntimeClass tests creating sandbox with RuntimeClasses enabled.
func TestCreatePodSandbox_RuntimeClass(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RuntimeClass, true)()
rcm := runtimeclass.NewManager(rctest.NewPopulatedClient())
defer rctest.StartManagerSync(rcm)()

View File

@ -9,7 +9,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/client-go/informers:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/listers/node/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/listers/node/v1:go_default_library",
],
)

View File

@ -22,13 +22,13 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/client-go/informers"
clientset "k8s.io/client-go/kubernetes"
nodev1beta1 "k8s.io/client-go/listers/node/v1beta1"
nodev1 "k8s.io/client-go/listers/node/v1"
)
// Manager caches RuntimeClass API objects, and provides accessors to the Kubelet.
type Manager struct {
informerFactory informers.SharedInformerFactory
lister nodev1beta1.RuntimeClassLister
lister nodev1.RuntimeClassLister
}
// NewManager returns a new RuntimeClass Manager. Run must be called before the manager can be used.
@ -36,7 +36,7 @@ func NewManager(client clientset.Interface) *Manager {
const resyncPeriod = 0
factory := informers.NewSharedInformerFactory(client, resyncPeriod)
lister := factory.Node().V1beta1().RuntimeClasses().Lister()
lister := factory.Node().V1().RuntimeClasses().Lister()
return &Manager{
informerFactory: factory,

View File

@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/kubelet/runtimeclass:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",

View File

@ -17,7 +17,7 @@ limitations under the License.
package testing
import (
nodev1beta1 "k8s.io/api/node/v1beta1"
nodev1 "k8s.io/api/node/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/fake"
@ -57,8 +57,8 @@ func StartManagerSync(m *runtimeclass.Manager) func() {
// NewRuntimeClass is a helper to generate a RuntimeClass resource with
// the given name & handler.
func NewRuntimeClass(name, handler string) *nodev1beta1.RuntimeClass {
return &nodev1beta1.RuntimeClass{
func NewRuntimeClass(name, handler string) *nodev1.RuntimeClass {
return &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},

View File

@ -9,6 +9,7 @@ go_library(
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/node:go_default_library",
"//pkg/registry/node/runtimeclass/storage:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/registry/generic:go_default_library",

View File

@ -17,6 +17,7 @@ limitations under the License.
package rest
import (
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
"k8s.io/apiserver/pkg/registry/generic"
@ -51,6 +52,14 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
}
}
if apiResourceConfigSource.VersionEnabled(nodev1.SchemeGroupVersion) {
if storageMap, err := p.v1Storage(apiResourceConfigSource, restOptionsGetter); err != nil {
return genericapiserver.APIGroupInfo{}, false, err
} else {
apiGroupInfo.VersionedResourcesStorageMap[nodev1.SchemeGroupVersion.Version] = storageMap
}
}
return apiGroupInfo, true, nil
}
@ -76,6 +85,17 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
return storage, err
}
func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
storage := map[string]rest.Storage{}
s, err := runtimeclassstorage.NewREST(restOptionsGetter)
if err != nil {
return storage, err
}
storage["runtimeclasses"] = s
return storage, err
}
// GroupName is the group name for the storage provider
func (p RESTStorageProvider) GroupName() string {
return nodeinternal.GroupName

View File

@ -8,10 +8,10 @@ go_library(
deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/node:go_default_library",
"//pkg/apis/node/v1beta1:go_default_library",
"//pkg/apis/node/v1:go_default_library",
"//pkg/features:go_default_library",
"//pkg/util/tolerations:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
@ -19,8 +19,8 @@ go_library(
"//staging/src/k8s.io/apiserver/pkg/admission/initializer:go_default_library",
"//staging/src/k8s.io/client-go/informers:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/listers/node/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1:go_default_library",
"//staging/src/k8s.io/client-go/listers/node/v1:go_default_library",
"//staging/src/k8s.io/component-base/featuregate:go_default_library",
],
)
@ -34,7 +34,7 @@ go_test(
"//pkg/controller:go_default_library",
"//pkg/features:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",

View File

@ -17,7 +17,7 @@ limitations under the License.
// Package runtimeclass contains an admission controller for modifying and validating new Pods to
// take RuntimeClass into account. For RuntimeClass definitions which describe an overhead associated
// with running a pod, this admission controller will set the pod.Spec.Overhead field accordingly. This
// field should only be set through this controller, so vaidation will be carried out to ensure the pod's
// field should only be set through this controller, so validation will be carried out to ensure the pod's
// value matches what is defined in the coresponding RuntimeClass.
package runtimeclass
@ -26,7 +26,7 @@ import (
"fmt"
"io"
v1beta1 "k8s.io/api/node/v1beta1"
nodev1 "k8s.io/api/node/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -34,12 +34,12 @@ import (
genericadmissioninitailizer "k8s.io/apiserver/pkg/admission/initializer"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
nodev1beta1client "k8s.io/client-go/kubernetes/typed/node/v1beta1"
nodev1beta1listers "k8s.io/client-go/listers/node/v1beta1"
nodev1client "k8s.io/client-go/kubernetes/typed/node/v1"
nodev1listers "k8s.io/client-go/listers/node/v1"
"k8s.io/component-base/featuregate"
api "k8s.io/kubernetes/pkg/apis/core"
node "k8s.io/kubernetes/pkg/apis/node"
nodev1beta1 "k8s.io/kubernetes/pkg/apis/node/v1beta1"
apinodev1 "k8s.io/kubernetes/pkg/apis/node/v1"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/util/tolerations"
)
@ -60,12 +60,11 @@ func Register(plugins *admission.Plugins) {
// not specified, the pod is rejected.
type RuntimeClass struct {
*admission.Handler
runtimeClassLister nodev1beta1listers.RuntimeClassLister
runtimeClassClient nodev1beta1client.RuntimeClassInterface
runtimeClassLister nodev1listers.RuntimeClassLister
runtimeClassClient nodev1client.RuntimeClassInterface
inspectedFeatures bool
runtimeClassEnabled bool
podOverheadEnabled bool
inspectedFeatures bool
podOverheadEnabled bool
}
var _ admission.MutationInterface = &RuntimeClass{}
@ -76,22 +75,18 @@ var _ genericadmissioninitailizer.WantsExternalKubeClientSet = &RuntimeClass{}
// SetExternalKubeClientSet sets the client for the plugin
func (r *RuntimeClass) SetExternalKubeClientSet(client kubernetes.Interface) {
r.runtimeClassClient = client.NodeV1beta1().RuntimeClasses()
r.runtimeClassClient = client.NodeV1().RuntimeClasses()
}
// InspectFeatureGates allows setting bools without taking a dep on a global variable
func (r *RuntimeClass) InspectFeatureGates(featureGates featuregate.FeatureGate) {
r.runtimeClassEnabled = featureGates.Enabled(features.RuntimeClass)
r.podOverheadEnabled = featureGates.Enabled(features.PodOverhead)
r.inspectedFeatures = true
}
// SetExternalKubeInformerFactory implements the WantsExternalKubeInformerFactory interface.
func (r *RuntimeClass) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) {
if !r.runtimeClassEnabled {
return
}
runtimeClassInformer := f.Node().V1beta1().RuntimeClasses()
runtimeClassInformer := f.Node().V1().RuntimeClasses()
r.SetReadyFunc(runtimeClassInformer.Informer().HasSynced)
r.runtimeClassLister = runtimeClassInformer.Lister()
}
@ -101,9 +96,6 @@ func (r *RuntimeClass) ValidateInitialization() error {
if !r.inspectedFeatures {
return fmt.Errorf("InspectFeatureGates was not called")
}
if !r.runtimeClassEnabled {
return nil
}
if r.runtimeClassLister == nil {
return fmt.Errorf("missing RuntimeClass lister")
}
@ -115,10 +107,6 @@ func (r *RuntimeClass) ValidateInitialization() error {
// Admit makes an admission decision based on the request attributes
func (r *RuntimeClass) Admit(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) error {
if !r.runtimeClassEnabled {
return nil
}
// Ignore all calls to subresources or resources other than pods.
if shouldIgnore(attributes) {
return nil
@ -143,10 +131,6 @@ func (r *RuntimeClass) Admit(ctx context.Context, attributes admission.Attribute
// Validate makes sure that pod adhere's to RuntimeClass's definition
func (r *RuntimeClass) Validate(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) error {
if !r.runtimeClassEnabled {
return nil
}
// Ignore all calls to subresources or resources other than pods.
if shouldIgnore(attributes) {
return nil
@ -173,7 +157,7 @@ func NewRuntimeClass() *RuntimeClass {
}
// prepareObjects returns pod and runtimeClass types from the given admission attributes
func (r *RuntimeClass) prepareObjects(ctx context.Context, attributes admission.Attributes) (pod *api.Pod, runtimeClass *v1beta1.RuntimeClass, err error) {
func (r *RuntimeClass) prepareObjects(ctx context.Context, attributes admission.Attributes) (pod *api.Pod, runtimeClass *nodev1.RuntimeClass, err error) {
pod, ok := attributes.GetObject().(*api.Pod)
if !ok {
return nil, nil, apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted")
@ -197,14 +181,14 @@ func (r *RuntimeClass) prepareObjects(ctx context.Context, attributes admission.
return pod, runtimeClass, err
}
func setOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *v1beta1.RuntimeClass) (err error) {
func setOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *nodev1.RuntimeClass) (err error) {
if runtimeClass == nil || runtimeClass.Overhead == nil {
return nil
}
// convert to internal type and assign to pod's Overhead
nodeOverhead := &node.Overhead{}
if err = nodev1beta1.Convert_v1beta1_Overhead_To_node_Overhead(runtimeClass.Overhead, nodeOverhead, nil); err != nil {
if err = apinodev1.Convert_v1_Overhead_To_node_Overhead(runtimeClass.Overhead, nodeOverhead, nil); err != nil {
return err
}
@ -218,14 +202,14 @@ func setOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *v1beta1.Run
return nil
}
func setScheduling(a admission.Attributes, pod *api.Pod, runtimeClass *v1beta1.RuntimeClass) (err error) {
func setScheduling(a admission.Attributes, pod *api.Pod, runtimeClass *nodev1.RuntimeClass) (err error) {
if runtimeClass == nil || runtimeClass.Scheduling == nil {
return nil
}
// convert to internal type and assign to pod's Scheduling
nodeScheduling := &node.Scheduling{}
if err = nodev1beta1.Convert_v1beta1_Scheduling_To_node_Scheduling(runtimeClass.Scheduling, nodeScheduling, nil); err != nil {
if err = apinodev1.Convert_v1_Scheduling_To_node_Scheduling(runtimeClass.Scheduling, nodeScheduling, nil); err != nil {
return err
}
@ -250,11 +234,11 @@ func setScheduling(a admission.Attributes, pod *api.Pod, runtimeClass *v1beta1.R
return nil
}
func validateOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *v1beta1.RuntimeClass) (err error) {
func validateOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *nodev1.RuntimeClass) (err error) {
if runtimeClass != nil && runtimeClass.Overhead != nil {
// If the Overhead set doesn't match what is provided in the RuntimeClass definition, reject the pod
nodeOverhead := &node.Overhead{}
if err := nodev1beta1.Convert_v1beta1_Overhead_To_node_Overhead(runtimeClass.Overhead, nodeOverhead, nil); err != nil {
if err := apinodev1.Convert_v1_Overhead_To_node_Overhead(runtimeClass.Overhead, nodeOverhead, nil); err != nil {
return err
}
if !apiequality.Semantic.DeepEqual(nodeOverhead.PodFixed, pod.Spec.Overhead) {

View File

@ -23,7 +23,7 @@ import (
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/api/node/v1beta1"
nodev1 "k8s.io/api/node/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@ -86,17 +86,17 @@ func getGuaranteedRequirements() core.ResourceRequirements {
func TestSetOverhead(t *testing.T) {
tests := []struct {
name string
runtimeClass *v1beta1.RuntimeClass
runtimeClass *nodev1.RuntimeClass
pod *core.Pod
expectError bool
expectedPod *core.Pod
}{
{
name: "overhead, no container requirements",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),
@ -109,10 +109,10 @@ func TestSetOverhead(t *testing.T) {
},
{
name: "overhead, guaranteed pod",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),
@ -125,10 +125,10 @@ func TestSetOverhead(t *testing.T) {
},
{
name: "overhead, pod with differing overhead already set",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("10"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("10G"),
@ -141,10 +141,10 @@ func TestSetOverhead(t *testing.T) {
},
{
name: "overhead, pod with same overhead already set",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),
@ -175,14 +175,14 @@ func TestSetOverhead(t *testing.T) {
func TestSetScheduling(t *testing.T) {
tests := []struct {
name string
runtimeClass *v1beta1.RuntimeClass
runtimeClass *nodev1.RuntimeClass
pod *core.Pod
expectError bool
expectedPod *core.Pod
}{
{
name: "scheduling, nil scheduling",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: nil,
@ -193,10 +193,10 @@ func TestSetScheduling(t *testing.T) {
},
{
name: "scheduling, conflict node selector",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: &v1beta1.Scheduling{
Scheduling: &nodev1.Scheduling{
NodeSelector: map[string]string{
"foo": "conflict",
},
@ -207,10 +207,10 @@ func TestSetScheduling(t *testing.T) {
},
{
name: "scheduling, nil node selector",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: &v1beta1.Scheduling{
Scheduling: &nodev1.Scheduling{
NodeSelector: map[string]string{
"foo": "bar",
},
@ -222,10 +222,10 @@ func TestSetScheduling(t *testing.T) {
},
{
name: "scheduling, node selector with the same key value",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: &v1beta1.Scheduling{
Scheduling: &nodev1.Scheduling{
NodeSelector: map[string]string{
"foo": "bar",
},
@ -237,10 +237,10 @@ func TestSetScheduling(t *testing.T) {
},
{
name: "scheduling, node selector with different key value",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: &v1beta1.Scheduling{
Scheduling: &nodev1.Scheduling{
NodeSelector: map[string]string{
"foo": "bar",
"fizz": "buzz",
@ -253,10 +253,10 @@ func TestSetScheduling(t *testing.T) {
},
{
name: "scheduling, multiple tolerations",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Scheduling: &v1beta1.Scheduling{
Scheduling: &nodev1.Scheduling{
Tolerations: []v1.Toleration{
{
Key: "foo",
@ -322,18 +322,17 @@ func NewObjectInterfacesForTest() admission.ObjectInterfaces {
return admission.NewObjectInterfacesFromScheme(scheme)
}
func newRuntimeClassForTest(runtimeClassEnabled bool,
func newRuntimeClassForTest(
featureInspection bool,
addLister bool,
listerObject *v1beta1.RuntimeClass,
listerObject *nodev1.RuntimeClass,
addClient bool,
clientObject *v1beta1.RuntimeClass) *RuntimeClass {
clientObject *nodev1.RuntimeClass) *RuntimeClass {
runtimeClass := NewRuntimeClass()
if featureInspection {
relevantFeatures := map[featuregate.Feature]featuregate.FeatureSpec{
features.RuntimeClass: {Default: runtimeClassEnabled},
features.PodOverhead: {Default: false},
features.PodOverhead: {Default: false},
}
fg := featuregate.NewFeatureGate()
fg.Add(relevantFeatures)
@ -344,7 +343,7 @@ func newRuntimeClassForTest(runtimeClassEnabled bool,
informerFactory := informers.NewSharedInformerFactory(nil, controller.NoResyncPeriodFunc())
runtimeClass.SetExternalKubeInformerFactory(informerFactory)
if listerObject != nil {
informerFactory.Node().V1beta1().RuntimeClasses().Informer().GetStore().Add(listerObject)
informerFactory.Node().V1().RuntimeClasses().Informer().GetStore().Add(listerObject)
}
}
@ -367,30 +366,25 @@ func TestValidateInitialization(t *testing.T) {
expectError bool
runtimeClass *RuntimeClass
}{
{
name: "runtimeClass disabled, success",
expectError: false,
runtimeClass: newRuntimeClassForTest(false, true, true, nil, true, nil),
},
{
name: "runtimeClass enabled, success",
expectError: false,
runtimeClass: newRuntimeClassForTest(true, true, true, nil, true, nil),
runtimeClass: newRuntimeClassForTest(true, true, nil, true, nil),
},
{
name: "runtimeClass enabled, no feature inspection",
expectError: true,
runtimeClass: newRuntimeClassForTest(true, false, true, nil, true, nil),
runtimeClass: newRuntimeClassForTest(false, true, nil, true, nil),
},
{
name: "runtimeClass enabled, no lister",
expectError: true,
runtimeClass: newRuntimeClassForTest(true, true, false, nil, true, nil),
runtimeClass: newRuntimeClassForTest(true, false, nil, true, nil),
},
{
name: "runtimeClass enabled, no client",
expectError: true,
runtimeClass: newRuntimeClassForTest(true, true, true, nil, false, nil),
runtimeClass: newRuntimeClassForTest(true, true, nil, false, nil),
},
}
@ -409,7 +403,7 @@ func TestValidateInitialization(t *testing.T) {
func TestAdmit(t *testing.T) {
runtimeClassName := "runtimeClassName"
rc := &v1beta1.RuntimeClass{
rc := &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: runtimeClassName},
}
@ -440,17 +434,17 @@ func TestAdmit(t *testing.T) {
{
name: "runtimeClass found by lister",
expectError: false,
runtimeClass: newRuntimeClassForTest(true, true, true, rc, true, nil),
runtimeClass: newRuntimeClassForTest(true, true, rc, true, nil),
},
{
name: "runtimeClass found by client",
expectError: false,
runtimeClass: newRuntimeClassForTest(true, true, true, nil, true, rc),
runtimeClass: newRuntimeClassForTest(true, true, nil, true, rc),
},
{
name: "runtimeClass not found by lister nor client",
expectError: true,
runtimeClass: newRuntimeClassForTest(true, true, true, nil, true, nil),
runtimeClass: newRuntimeClassForTest(true, true, nil, true, nil),
},
}
@ -469,13 +463,13 @@ func TestAdmit(t *testing.T) {
func TestValidate(t *testing.T) {
tests := []struct {
name string
runtimeClass *v1beta1.RuntimeClass
runtimeClass *nodev1.RuntimeClass
pod *core.Pod
expectError bool
}{
{
name: "No Overhead in RunntimeClass, Overhead set in pod",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
},
@ -484,10 +478,10 @@ func TestValidate(t *testing.T) {
},
{
name: "Non-matching Overheads",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("10"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("10G"),
@ -499,10 +493,10 @@ func TestValidate(t *testing.T) {
},
{
name: "Matching Overheads",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),
@ -514,7 +508,6 @@ func TestValidate(t *testing.T) {
},
}
rt := NewRuntimeClass()
rt.runtimeClassEnabled = true
rt.podOverheadEnabled = true
o := NewObjectInterfacesForTest()
for _, tc := range tests {
@ -535,16 +528,16 @@ func TestValidate(t *testing.T) {
func TestValidateOverhead(t *testing.T) {
tests := []struct {
name string
runtimeClass *v1beta1.RuntimeClass
runtimeClass *nodev1.RuntimeClass
pod *core.Pod
expectError bool
}{
{
name: "Overhead part of RuntimeClass, no Overhead defined in pod",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),
@ -556,7 +549,7 @@ func TestValidateOverhead(t *testing.T) {
},
{
name: "No Overhead in RunntimeClass, Overhead set in pod",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
},
@ -571,10 +564,10 @@ func TestValidateOverhead(t *testing.T) {
},
{
name: "Non-matching Overheads",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("10"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("10G"),
@ -586,10 +579,10 @@ func TestValidateOverhead(t *testing.T) {
},
{
name: "Matching Overheads",
runtimeClass: &v1beta1.RuntimeClass{
runtimeClass: &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Handler: "bar",
Overhead: &v1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceCPU): resource.MustParse("100m"),
corev1.ResourceName(corev1.ResourceMemory): resource.MustParse("1"),

View File

@ -175,9 +175,7 @@ func NodeRules() []rbacv1.PolicyRule {
}
// RuntimeClass
if utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) {
nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("get", "list", "watch").Groups("node.k8s.io").Resources("runtimeclasses").RuleOrDie())
}
nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("get", "list", "watch").Groups("node.k8s.io").Resources("runtimeclasses").RuleOrDie())
return nodePolicyRules
}

View File

@ -34,6 +34,7 @@ go_test(
"//staging/src/k8s.io/api/imagepolicy/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",
@ -98,6 +99,7 @@ filegroup(
"//staging/src/k8s.io/api/imagepolicy/v1alpha1:all-srcs",
"//staging/src/k8s.io/api/networking/v1:all-srcs",
"//staging/src/k8s.io/api/networking/v1beta1:all-srcs",
"//staging/src/k8s.io/api/node/v1:all-srcs",
"//staging/src/k8s.io/api/node/v1alpha1:all-srcs",
"//staging/src/k8s.io/api/node/v1beta1:all-srcs",
"//staging/src/k8s.io/api/policy/v1beta1:all-srcs",

View File

@ -0,0 +1,39 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"generated.pb.go",
"register.go",
"types.go",
"types_swagger_doc_generated.go",
"zz_generated.deepcopy.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/api/node/v1",
importpath = "k8s.io/api/node/v1",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/github.com/gogo/protobuf/sortkeys:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,23 @@
/*
Copyright 2020 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
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
// +groupName=node.k8s.io
package v1 // import "k8s.io/api/node/v1"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,109 @@
/*
Copyright 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 go-to-protobuf. Do not edit it manually!
syntax = "proto2";
package k8s.io.api.node.v1;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1";
// Overhead structure represents the resource overhead associated with running a pod.
message Overhead {
// PodFixed represents the fixed resource overhead associated with running a pod.
// +optional
map<string, k8s.io.apimachinery.pkg.api.resource.Quantity> podFixed = 1;
}
// RuntimeClass defines a class of container runtime supported in the cluster.
// The RuntimeClass is used to determine which container runtime is used to run
// all containers in a pod. RuntimeClasses are manually defined by a
// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is
// responsible for resolving the RuntimeClassName reference before running the
// pod. For more details, see
// https://kubernetes.io/docs/concepts/containers/runtime-class/
message RuntimeClass {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values
// are specific to the node & CRI configuration. It is assumed that all
// handlers are available on every node, and handlers of the same name are
// equivalent on every node.
// For example, a handler called "runc" might specify that the runc OCI
// runtime (using native Linux containers) will be used to run the containers
// in a pod.
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
optional string handler = 2;
// Overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see
// https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
// This field is in beta starting v1.18
// and is only honored by servers that enable the PodOverhead feature.
// +optional
optional Overhead overhead = 3;
// Scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes.
// +optional
optional Scheduling scheduling = 4;
}
// RuntimeClassList is a list of RuntimeClass objects.
message RuntimeClassList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of schema objects.
repeated RuntimeClass items = 2;
}
// Scheduling specifies the scheduling constraints for nodes supporting a
// RuntimeClass.
message Scheduling {
// nodeSelector lists labels that must be present on nodes that support this
// RuntimeClass. Pods using this RuntimeClass can only be scheduled to a
// node matched by this selector. The RuntimeClass nodeSelector is merged
// with a pod's existing nodeSelector. Any conflicts will cause the pod to
// be rejected in admission.
// +optional
map<string, string> nodeSelector = 1;
// tolerations are appended (excluding duplicates) to pods running with this
// RuntimeClass during admission, effectively unioning the set of nodes
// tolerated by the pod and the RuntimeClass.
// +optional
// +listType=atomic
repeated k8s.io.api.core.v1.Toleration tolerations = 2;
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2020 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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name use in this package
const GroupName = "node.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// addKnownTypes adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&RuntimeClass{},
&RuntimeClassList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@ -0,0 +1,107 @@
/*
Copyright 2020 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 v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// RuntimeClass defines a class of container runtime supported in the cluster.
// The RuntimeClass is used to determine which container runtime is used to run
// all containers in a pod. RuntimeClasses are manually defined by a
// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is
// responsible for resolving the RuntimeClassName reference before running the
// pod. For more details, see
// https://kubernetes.io/docs/concepts/containers/runtime-class/
type RuntimeClass struct {
metav1.TypeMeta `json:",inline"`
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values
// are specific to the node & CRI configuration. It is assumed that all
// handlers are available on every node, and handlers of the same name are
// equivalent on every node.
// For example, a handler called "runc" might specify that the runc OCI
// runtime (using native Linux containers) will be used to run the containers
// in a pod.
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
// Overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see
// https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
// This field is in beta starting v1.18
// and is only honored by servers that enable the PodOverhead feature.
// +optional
Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"`
// Scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes.
// +optional
Scheduling *Scheduling `json:"scheduling,omitempty" protobuf:"bytes,4,opt,name=scheduling"`
}
// Overhead structure represents the resource overhead associated with running a pod.
type Overhead struct {
// PodFixed represents the fixed resource overhead associated with running a pod.
// +optional
PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"`
}
// Scheduling specifies the scheduling constraints for nodes supporting a
// RuntimeClass.
type Scheduling struct {
// nodeSelector lists labels that must be present on nodes that support this
// RuntimeClass. Pods using this RuntimeClass can only be scheduled to a
// node matched by this selector. The RuntimeClass nodeSelector is merged
// with a pod's existing nodeSelector. Any conflicts will cause the pod to
// be rejected in admission.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,1,opt,name=nodeSelector"`
// tolerations are appended (excluding duplicates) to pods running with this
// RuntimeClass during admission, effectively unioning the set of nodes
// tolerated by the pod and the RuntimeClass.
// +optional
// +listType=atomic
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,2,rep,name=tolerations"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects.
Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"`
}

View File

@ -0,0 +1,71 @@
/*
Copyright 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 v1
// This file contains a collection of methods that can be used from go-restful to
// generate Swagger API documentation for its models. Please read this PR for more
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
//
// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
// they are on one line! For multiple line or blocks that you want to ignore use ---.
// Any context after a --- is ignored.
//
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
var map_Overhead = map[string]string{
"": "Overhead structure represents the resource overhead associated with running a pod.",
"podFixed": "PodFixed represents the fixed resource overhead associated with running a pod.",
}
func (Overhead) SwaggerDoc() map[string]string {
return map_Overhead
}
var map_RuntimeClass = map[string]string{
"": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/",
"metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
"handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.",
"overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see\n https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/\nThis field is in beta starting v1.18 and is only honored by servers that enable the PodOverhead feature.",
"scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.",
}
func (RuntimeClass) SwaggerDoc() map[string]string {
return map_RuntimeClass
}
var map_RuntimeClassList = map[string]string{
"": "RuntimeClassList is a list of RuntimeClass objects.",
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
"items": "Items is a list of schema objects.",
}
func (RuntimeClassList) SwaggerDoc() map[string]string {
return map_RuntimeClassList
}
var map_Scheduling = map[string]string{
"": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.",
"nodeSelector": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.",
"tolerations": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.",
}
func (Scheduling) SwaggerDoc() map[string]string {
return map_Scheduling
}
// AUTO-GENERATED FUNCTIONS END HERE

View File

@ -0,0 +1,148 @@
// +build !ignore_autogenerated
/*
Copyright 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.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1
import (
corev1 "k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Overhead) DeepCopyInto(out *Overhead) {
*out = *in
if in.PodFixed != nil {
in, out := &in.PodFixed, &out.PodFixed
*out = make(corev1.ResourceList, len(*in))
for key, val := range *in {
(*out)[key] = val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overhead.
func (in *Overhead) DeepCopy() *Overhead {
if in == nil {
return nil
}
out := new(Overhead)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeClass) DeepCopyInto(out *RuntimeClass) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Overhead != nil {
in, out := &in.Overhead, &out.Overhead
*out = new(Overhead)
(*in).DeepCopyInto(*out)
}
if in.Scheduling != nil {
in, out := &in.Scheduling, &out.Scheduling
*out = new(Scheduling)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeClass.
func (in *RuntimeClass) DeepCopy() *RuntimeClass {
if in == nil {
return nil
}
out := new(RuntimeClass)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *RuntimeClass) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeClassList) DeepCopyInto(out *RuntimeClassList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]RuntimeClass, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeClassList.
func (in *RuntimeClassList) DeepCopy() *RuntimeClassList {
if in == nil {
return nil
}
out := new(RuntimeClassList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *RuntimeClassList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Scheduling) DeepCopyInto(out *Scheduling) {
*out = *in
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Tolerations != nil {
in, out := &in.Tolerations, &out.Tolerations
*out = make([]corev1.Toleration, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduling.
func (in *Scheduling) DeepCopy() *Scheduling {
if in == nil {
return nil
}
out := new(Scheduling)
in.DeepCopyInto(out)
return out
}

View File

@ -49,6 +49,7 @@ import (
imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1"
networkingv1 "k8s.io/api/networking/v1"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@ -100,6 +101,7 @@ var groups = []runtime.SchemeBuilder{
imagepolicyv1alpha1.SchemeBuilder,
networkingv1.SchemeBuilder,
networkingv1beta1.SchemeBuilder,
nodev1.SchemeBuilder,
nodev1alpha1.SchemeBuilder,
nodev1beta1.SchemeBuilder,
policyv1beta1.SchemeBuilder,

View File

@ -0,0 +1,62 @@
{
"kind": "RuntimeClass",
"apiVersion": "node.k8s.io/v1",
"metadata": {
"name": "2",
"generateName": "3",
"namespace": "4",
"selfLink": "5",
"uid": "7",
"resourceVersion": "11042405498087606203",
"generation": 8071137005907523419,
"creationTimestamp": null,
"deletionGracePeriodSeconds": -4955867275792137171,
"labels": {
"7": "8"
},
"annotations": {
"9": "10"
},
"ownerReferences": [
{
"apiVersion": "11",
"kind": "12",
"name": "13",
"uid": "Dz廔ȇ{sŊƏp",
"controller": false,
"blockOwnerDeletion": true
}
],
"finalizers": [
"14"
],
"clusterName": "15",
"managedFields": [
{
"manager": "16",
"operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]",
"apiVersion": "17",
"fieldsType": "18"
}
]
},
"handler": "19",
"overhead": {
"podFixed": {
"qJ枊a8衍`Ĩ": "652"
}
},
"scheduling": {
"nodeSelector": {
"20": "21"
},
"tolerations": [
{
"key": "22",
"value": "23",
"effect": "6ċ",
"tolerationSeconds": -5658031457286093454
}
]
}
}

Binary file not shown.

View File

@ -0,0 +1,43 @@
apiVersion: node.k8s.io/v1
handler: "19"
kind: RuntimeClass
metadata:
annotations:
"9": "10"
clusterName: "15"
creationTimestamp: null
deletionGracePeriodSeconds: -4955867275792137171
finalizers:
- "14"
generateName: "3"
generation: 8071137005907523419
labels:
"7": "8"
managedFields:
- apiVersion: "17"
fieldsType: "18"
manager: "16"
operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]
name: "2"
namespace: "4"
ownerReferences:
- apiVersion: "11"
blockOwnerDeletion: true
controller: false
kind: "12"
name: "13"
uid: Dz廔ȇ{sŊƏp
resourceVersion: "11042405498087606203"
selfLink: "5"
uid: "7"
overhead:
podFixed:
qJ枊a8衍`Ĩ: "652"
scheduling:
nodeSelector:
"20": "21"
tolerations:
- effect:
key: "22"
tolerationSeconds: -5658031457286093454
value: "23"

View File

@ -51,6 +51,7 @@ filegroup(
"//staging/src/k8s.io/client-go/listers/imagepolicy/v1alpha1:all-srcs",
"//staging/src/k8s.io/client-go/listers/networking/v1:all-srcs",
"//staging/src/k8s.io/client-go/listers/networking/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/listers/node/v1:all-srcs",
"//staging/src/k8s.io/client-go/listers/node/v1alpha1:all-srcs",
"//staging/src/k8s.io/client-go/listers/node/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/listers/policy/v1beta1:all-srcs",

View File

@ -35,6 +35,7 @@ go_library(
"//staging/src/k8s.io/api/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",

View File

@ -46,6 +46,7 @@ import (
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
networkingv1 "k8s.io/api/networking/v1"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@ -260,6 +261,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case networkingv1beta1.SchemeGroupVersion.WithResource("ingressclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IngressClasses().Informer()}, nil
// Group=node.k8s.io, Version=v1
case nodev1.SchemeGroupVersion.WithResource("runtimeclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1().RuntimeClasses().Informer()}, nil
// Group=node.k8s.io, Version=v1alpha1
case nodev1alpha1.SchemeGroupVersion.WithResource("runtimeclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1alpha1().RuntimeClasses().Informer()}, nil

View File

@ -8,6 +8,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
"//staging/src/k8s.io/client-go/informers/node/v1:go_default_library",
"//staging/src/k8s.io/client-go/informers/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/client-go/informers/node/v1beta1:go_default_library",
],
@ -24,6 +25,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/client-go/informers/node/v1:all-srcs",
"//staging/src/k8s.io/client-go/informers/node/v1alpha1:all-srcs",
"//staging/src/k8s.io/client-go/informers/node/v1beta1:all-srcs",
],

View File

@ -20,12 +20,15 @@ package node
import (
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
v1 "k8s.io/client-go/informers/node/v1"
v1alpha1 "k8s.io/client-go/informers/node/v1alpha1"
v1beta1 "k8s.io/client-go/informers/node/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
@ -43,6 +46,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1 returns a new v1.Interface.
func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)

View File

@ -0,0 +1,36 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"interface.go",
"runtimeclass.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/node/v1",
importpath = "k8s.io/client-go/informers/node/v1",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/listers/node/v1:go_default_library",
"//staging/src/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"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,45 @@
/*
Copyright 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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1
import (
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// RuntimeClasses returns a RuntimeClassInformer.
RuntimeClasses() RuntimeClassInformer
}
type version struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// RuntimeClasses returns a RuntimeClassInformer.
func (v *version) RuntimeClasses() RuntimeClassInformer {
return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,89 @@
/*
Copyright 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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
nodev1 "k8s.io/api/node/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1 "k8s.io/client-go/listers/node/v1"
cache "k8s.io/client-go/tools/cache"
)
// RuntimeClassInformer provides access to a shared informer and lister for
// RuntimeClasses.
type RuntimeClassInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.RuntimeClassLister
}
type runtimeClassInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewRuntimeClassInformer constructs a new informer for RuntimeClass type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1().RuntimeClasses().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1().RuntimeClasses().Watch(context.TODO(), options)
},
},
&nodev1.RuntimeClass{},
resyncPeriod,
indexers,
)
}
func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredRuntimeClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&nodev1.RuntimeClass{}, f.defaultInformer)
}
func (f *runtimeClassInformer) Lister() v1.RuntimeClassLister {
return v1.NewRuntimeClassLister(f.Informer().GetIndexer())
}

View File

@ -41,6 +41,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1:go_default_library",
@ -100,6 +101,7 @@ filegroup(
"//staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1:all-srcs",

View File

@ -51,6 +51,7 @@ import (
flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1"
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1"
nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1"
policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
@ -98,6 +99,7 @@ type Interface interface {
FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface
NetworkingV1() networkingv1.NetworkingV1Interface
NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface
NodeV1() nodev1.NodeV1Interface
NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface
NodeV1beta1() nodev1beta1.NodeV1beta1Interface
PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface
@ -145,6 +147,7 @@ type Clientset struct {
flowcontrolV1alpha1 *flowcontrolv1alpha1.FlowcontrolV1alpha1Client
networkingV1 *networkingv1.NetworkingV1Client
networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client
nodeV1 *nodev1.NodeV1Client
nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client
nodeV1beta1 *nodev1beta1.NodeV1beta1Client
policyV1beta1 *policyv1beta1.PolicyV1beta1Client
@ -304,6 +307,11 @@ func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Inter
return c.networkingV1beta1
}
// NodeV1 retrieves the NodeV1Client
func (c *Clientset) NodeV1() nodev1.NodeV1Interface {
return c.nodeV1
}
// NodeV1alpha1 retrieves the NodeV1alpha1Client
func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface {
return c.nodeV1alpha1
@ -501,6 +509,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.nodeV1, err = nodev1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.nodeV1alpha1, err = nodev1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@ -590,6 +602,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.NewForConfigOrDie(c)
cs.networkingV1 = networkingv1.NewForConfigOrDie(c)
cs.networkingV1beta1 = networkingv1beta1.NewForConfigOrDie(c)
cs.nodeV1 = nodev1.NewForConfigOrDie(c)
cs.nodeV1alpha1 = nodev1alpha1.NewForConfigOrDie(c)
cs.nodeV1beta1 = nodev1beta1.NewForConfigOrDie(c)
cs.policyV1beta1 = policyv1beta1.NewForConfigOrDie(c)
@ -639,6 +652,7 @@ func New(c rest.Interface) *Clientset {
cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.New(c)
cs.networkingV1 = networkingv1.New(c)
cs.networkingV1beta1 = networkingv1beta1.New(c)
cs.nodeV1 = nodev1.New(c)
cs.nodeV1alpha1 = nodev1alpha1.New(c)
cs.nodeV1beta1 = nodev1beta1.New(c)
cs.policyV1beta1 = policyv1beta1.New(c)

View File

@ -40,6 +40,7 @@ go_library(
"//staging/src/k8s.io/api/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",
@ -119,6 +120,8 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1:go_default_library",

View File

@ -82,6 +82,8 @@ import (
fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake"
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
fakenetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake"
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
fakenodev1 "k8s.io/client-go/kubernetes/typed/node/v1/fake"
nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1"
fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake"
nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1"
@ -301,6 +303,11 @@ func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Inter
return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake}
}
// NodeV1 retrieves the NodeV1Client
func (c *Clientset) NodeV1() nodev1.NodeV1Interface {
return &fakenodev1.FakeNodeV1{Fake: &c.Fake}
}
// NodeV1alpha1 retrieves the NodeV1alpha1Client
func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface {
return &fakenodev1alpha1.FakeNodeV1alpha1{Fake: &c.Fake}

View File

@ -48,6 +48,7 @@ import (
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
networkingv1 "k8s.io/api/networking/v1"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@ -100,6 +101,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
flowcontrolv1alpha1.AddToScheme,
networkingv1.AddToScheme,
networkingv1beta1.AddToScheme,
nodev1.AddToScheme,
nodev1alpha1.AddToScheme,
nodev1beta1.AddToScheme,
policyv1beta1.AddToScheme,

View File

@ -39,6 +39,7 @@ go_library(
"//staging/src/k8s.io/api/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/networking/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",

View File

@ -48,6 +48,7 @@ import (
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
networkingv1 "k8s.io/api/networking/v1"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@ -100,6 +101,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
flowcontrolv1alpha1.AddToScheme,
networkingv1.AddToScheme,
networkingv1beta1.AddToScheme,
nodev1.AddToScheme,
nodev1alpha1.AddToScheme,
nodev1beta1.AddToScheme,
policyv1beta1.AddToScheme,

View File

@ -0,0 +1,39 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"generated_expansion.go",
"node_client.go",
"runtimeclass.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/node/v1",
importpath = "k8s.io/client-go/kubernetes/typed/node/v1",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/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",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1/fake:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,20 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1

View File

@ -0,0 +1,38 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"fake_node_client.go",
"fake_runtimeclass.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake",
importpath = "k8s.io/client-go/kubernetes/typed/node/v1/fake",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/node/v1:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/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"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,20 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -0,0 +1,40 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/client-go/kubernetes/typed/node/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeNodeV1 struct {
*testing.Fake
}
func (c *FakeNodeV1) RuntimeClasses() v1.RuntimeClassInterface {
return &FakeRuntimeClasses{c}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeNodeV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -0,0 +1,122 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
nodev1 "k8s.io/api/node/v1"
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"
)
// FakeRuntimeClasses implements RuntimeClassInterface
type FakeRuntimeClasses struct {
Fake *FakeNodeV1
}
var runtimeclassesResource = schema.GroupVersionResource{Group: "node.k8s.io", Version: "v1", Resource: "runtimeclasses"}
var runtimeclassesKind = schema.GroupVersionKind{Group: "node.k8s.io", Version: "v1", Kind: "RuntimeClass"}
// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any.
func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *nodev1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(runtimeclassesResource, name), &nodev1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*nodev1.RuntimeClass), err
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *nodev1.RuntimeClassList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), &nodev1.RuntimeClassList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &nodev1.RuntimeClassList{ListMeta: obj.(*nodev1.RuntimeClassList).ListMeta}
for _, item := range obj.(*nodev1.RuntimeClassList).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 runtimeClasses.
func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts))
}
// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *nodev1.RuntimeClass, opts v1.CreateOptions) (result *nodev1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), &nodev1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*nodev1.RuntimeClass), err
}
// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *nodev1.RuntimeClass, opts v1.UpdateOptions) (result *nodev1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), &nodev1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*nodev1.RuntimeClass), err
}
// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs.
func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(runtimeclassesResource, name), &nodev1.RuntimeClass{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts)
_, err := c.Fake.Invokes(action, &nodev1.RuntimeClassList{})
return err
}
// Patch applies the patch and returns the patched runtimeClass.
func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nodev1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), &nodev1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*nodev1.RuntimeClass), err
}

View File

@ -0,0 +1,21 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
type RuntimeClassExpansion interface{}

View File

@ -0,0 +1,89 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
import (
v1 "k8s.io/api/node/v1"
"k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
type NodeV1Interface interface {
RESTClient() rest.Interface
RuntimeClassesGetter
}
// NodeV1Client is used to interact with features provided by the node.k8s.io group.
type NodeV1Client struct {
restClient rest.Interface
}
func (c *NodeV1Client) RuntimeClasses() RuntimeClassInterface {
return newRuntimeClasses(c)
}
// NewForConfig creates a new NodeV1Client for the given config.
func NewForConfig(c *rest.Config) (*NodeV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &NodeV1Client{client}, nil
}
// NewForConfigOrDie creates a new NodeV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *NodeV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new NodeV1Client for the given RESTClient.
func New(c rest.Interface) *NodeV1Client {
return &NodeV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
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 *NodeV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -0,0 +1,168 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
import (
"context"
"time"
v1 "k8s.io/api/node/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// RuntimeClassesGetter has a method to return a RuntimeClassInterface.
// A group's client should implement this interface.
type RuntimeClassesGetter interface {
RuntimeClasses() RuntimeClassInterface
}
// RuntimeClassInterface has methods to work with RuntimeClass resources.
type RuntimeClassInterface interface {
Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (*v1.RuntimeClass, error)
Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (*v1.RuntimeClass, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RuntimeClass, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error)
RuntimeClassExpansion
}
// runtimeClasses implements RuntimeClassInterface
type runtimeClasses struct {
client rest.Interface
}
// newRuntimeClasses returns a RuntimeClasses
func newRuntimeClasses(c *NodeV1Client) *runtimeClasses {
return &runtimeClasses{
client: c.RESTClient(),
}
}
// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any.
func (c *runtimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) {
result = &v1.RuntimeClass{}
err = c.client.Get().
Resource("runtimeclasses").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.RuntimeClassList{}
err = c.client.Get().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested runtimeClasses.
func (c *runtimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) {
result = &v1.RuntimeClass{}
err = c.client.Post().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Body(runtimeClass).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) {
result = &v1.RuntimeClass{}
err = c.client.Put().
Resource("runtimeclasses").
Name(runtimeClass.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(runtimeClass).
Do(ctx).
Into(result)
return
}
// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs.
func (c *runtimeClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("runtimeclasses").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("runtimeclasses").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched runtimeClass.
func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) {
result = &v1.RuntimeClass{}
err = c.client.Patch(pt).
Resource("runtimeclasses").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -0,0 +1,32 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"expansion_generated.go",
"runtimeclass.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/listers/node/v1",
importpath = "k8s.io/client-go/listers/node/v1",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/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"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,23 @@
/*
Copyright 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.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1
// RuntimeClassListerExpansion allows custom methods to be added to
// RuntimeClassLister.
type RuntimeClassListerExpansion interface{}

View File

@ -0,0 +1,68 @@
/*
Copyright 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.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1
import (
v1 "k8s.io/api/node/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// RuntimeClassLister helps list RuntimeClasses.
// All objects returned here must be treated as read-only.
type RuntimeClassLister interface {
// List lists all RuntimeClasses in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.RuntimeClass, err error)
// Get retrieves the RuntimeClass from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.RuntimeClass, error)
RuntimeClassListerExpansion
}
// runtimeClassLister implements the RuntimeClassLister interface.
type runtimeClassLister struct {
indexer cache.Indexer
}
// NewRuntimeClassLister returns a new RuntimeClassLister.
func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister {
return &runtimeClassLister{indexer: indexer}
}
// List lists all RuntimeClasses in the indexer.
func (s *runtimeClassLister) List(selector labels.Selector) (ret []*v1.RuntimeClass, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.RuntimeClass))
})
return ret, err
}
// Get retrieves the RuntimeClass from the index for a given name.
func (s *runtimeClassLister) Get(name string) (*v1.RuntimeClass, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("runtimeclass"), name)
}
return obj.(*v1.RuntimeClass), nil
}

View File

@ -63,7 +63,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
ginkgo.It("should reject a Pod requesting a deleted RuntimeClass [NodeFeature:RuntimeHandler]", func() {
rcName := createRuntimeClass(f, "delete-me", "runc")
rcClient := f.ClientSet.NodeV1beta1().RuntimeClasses()
rcClient := f.ClientSet.NodeV1().RuntimeClasses()
ginkgo.By("Deleting RuntimeClass "+rcName, func() {
err := rcClient.Delete(context.TODO(), rcName, metav1.DeleteOptions{})
@ -91,7 +91,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
func createRuntimeClass(f *framework.Framework, name, handler string) string {
uniqueName := fmt.Sprintf("%s-%s", f.Namespace.Name, name)
rc := runtimeclasstest.NewRuntimeClass(uniqueName, handler)
rc, err := f.ClientSet.NodeV1beta1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
rc, err := f.ClientSet.NodeV1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
return rc.GetName()
}

View File

@ -30,7 +30,7 @@ go_library(
"//pkg/util/slice:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",

View File

@ -21,7 +21,7 @@ import (
"fmt"
v1 "k8s.io/api/core/v1"
nodev1beta1 "k8s.io/api/node/v1beta1"
nodev1 "k8s.io/api/node/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
@ -41,7 +41,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
ginkgo.It("should reject a Pod requesting a RuntimeClass with conflicting node selector", func() {
labelFooName := "foo-" + string(uuid.NewUUID())
scheduling := &nodev1beta1.Scheduling{
scheduling := &nodev1.Scheduling{
NodeSelector: map[string]string{
labelFooName: "conflict",
},
@ -49,7 +49,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
runtimeClass := newRuntimeClass(f.Namespace.Name, "conflict-runtimeclass", framework.TestContext.ContainerRuntime)
runtimeClass.Scheduling = scheduling
rc, err := f.ClientSet.NodeV1beta1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
rc, err := f.ClientSet.NodeV1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
pod := e2enode.NewRuntimeClassPod(rc.GetName())
@ -78,7 +78,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
Effect: v1.TaintEffectNoSchedule,
},
}
scheduling := &nodev1beta1.Scheduling{
scheduling := &nodev1.Scheduling{
NodeSelector: nodeSelector,
Tolerations: tolerations,
}
@ -103,7 +103,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
ginkgo.By("Trying to create runtimeclass and pod")
runtimeClass := newRuntimeClass(f.Namespace.Name, "non-conflict-runtimeclass", framework.TestContext.ContainerRuntime)
runtimeClass.Scheduling = scheduling
rc, err := f.ClientSet.NodeV1beta1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
rc, err := f.ClientSet.NodeV1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
pod := e2enode.NewRuntimeClassPod(rc.GetName())
@ -131,7 +131,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
labelFooName: "bar",
labelFizzName: "buzz",
}
scheduling := &nodev1beta1.Scheduling{
scheduling := &nodev1.Scheduling{
NodeSelector: nodeSelector,
}
@ -145,7 +145,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
ginkgo.By("Trying to create runtimeclass and pod")
runtimeClass := newRuntimeClass(f.Namespace.Name, "non-conflict-runtimeclass", framework.TestContext.ContainerRuntime)
runtimeClass.Scheduling = scheduling
rc, err := f.ClientSet.NodeV1beta1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
rc, err := f.ClientSet.NodeV1().RuntimeClasses().Create(context.TODO(), runtimeClass, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
pod := e2enode.NewRuntimeClassPod(rc.GetName())
@ -165,7 +165,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() {
})
// newRuntimeClass returns a test runtime class.
func newRuntimeClass(namespace, name, handler string) *nodev1beta1.RuntimeClass {
func newRuntimeClass(namespace, name, handler string) *nodev1.RuntimeClass {
uniqueName := fmt.Sprintf("%s-%s", namespace, name)
return runtimeclasstest.NewRuntimeClass(uniqueName, e2enode.PreconfiguredRuntimeClassHandler(handler))
}

View File

@ -23,7 +23,7 @@ go_library(
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/scheduling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",

View File

@ -22,7 +22,7 @@ import (
"time"
v1 "k8s.io/api/core/v1"
nodev1beta1 "k8s.io/api/node/v1beta1"
nodev1 "k8s.io/api/node/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
@ -233,16 +233,16 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
// Register a runtimeClass with overhead set as 25% of the available beard-seconds
handler = e2enode.PreconfiguredRuntimeClassHandler(framework.TestContext.ContainerRuntime)
rc := &nodev1beta1.RuntimeClass{
rc := &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: handler},
Handler: handler,
Overhead: &nodev1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: v1.ResourceList{
beardsecond: resource.MustParse("250"),
},
},
}
_, err = cs.NodeV1beta1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
_, err = cs.NodeV1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
})

View File

@ -177,7 +177,7 @@ go_test(
"//pkg/volume/util/fsquota:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/scheduling/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",

View File

@ -21,8 +21,8 @@ import (
"path/filepath"
"strings"
"k8s.io/api/core/v1"
nodev1beta1 "k8s.io/api/node/v1beta1"
v1 "k8s.io/api/core/v1"
nodev1 "k8s.io/api/node/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/kubelet/cm"
"k8s.io/kubernetes/test/e2e/framework"
@ -105,14 +105,14 @@ var _ = framework.KubeDescribe("Kubelet PodOverhead handling [LinuxOnly]", func(
)
ginkgo.By("Creating a RuntimeClass with Overhead definied", func() {
handler = e2enode.PreconfiguredRuntimeClassHandler(framework.TestContext.ContainerRuntime)
rc := &nodev1beta1.RuntimeClass{
rc := &nodev1.RuntimeClass{
ObjectMeta: metav1.ObjectMeta{Name: handler},
Handler: handler,
Overhead: &nodev1beta1.Overhead{
Overhead: &nodev1.Overhead{
PodFixed: getResourceList("200m", "140Mi"),
},
}
_, err := f.ClientSet.NodeV1beta1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
_, err := f.ClientSet.NodeV1().RuntimeClasses().Create(context.TODO(), rc, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create RuntimeClass resource")
})
ginkgo.By("Creating a Guaranteed pod with which has Overhead defined", func() {

View File

@ -38,7 +38,9 @@ go_test(
"//staging/src/k8s.io/api/discovery/v1beta1:go_default_library",
"//staging/src/k8s.io/api/extensions/v1beta1:go_default_library",
"//staging/src/k8s.io/api/flowcontrol/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/api/rbac/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/scheduling/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1alpha1:go_default_library",

View File

@ -33,7 +33,9 @@ import (
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
schedulerapi "k8s.io/api/scheduling/v1"
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
@ -169,7 +171,9 @@ func TestServerSidePrint(t *testing.T) {
schedulerapi.SchemeGroupVersion,
storagev1alpha1.SchemeGroupVersion,
extensionsv1beta1.SchemeGroupVersion,
nodev1.SchemeGroupVersion,
nodev1alpha1.SchemeGroupVersion,
nodev1beta1.SchemeGroupVersion,
flowcontrolv1alpha1.SchemeGroupVersion,
apiserverinternalv1alpha1.SchemeGroupVersion,
},

View File

@ -502,6 +502,16 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
},
// --
// k8s.io/kubernetes/pkg/apis/node/v1
gvr("node.k8s.io", "v1", "runtimeclasses"): {
Stub: `{"metadata": {"name": "rc3"}, "handler": "h3"}`,
ExpectedEtcdPath: "/registry/runtimeclasses/rc3",
// TODO (SergeyKanzhelev): in 1.21 this should be switched to v1. See https://github.com/kubernetes/kubernetes/pull/95718/files#r520967927
// this has to stay at v1beta1 for a release, otherwise a 1.19 API server won't be able to read the data persisted in etcd and will break during a multi-server upgrade
ExpectedGVK: gvkP("node.k8s.io", "v1beta1", "RuntimeClass"),
},
// --
// k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1
gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"): {
Stub: `{"metadata":{"name":"sv1.test"},"spec":{}}`,

5
vendor/modules.txt vendored
View File

@ -1610,6 +1610,7 @@ k8s.io/api/flowcontrol/v1alpha1
k8s.io/api/imagepolicy/v1alpha1
k8s.io/api/networking/v1
k8s.io/api/networking/v1beta1
k8s.io/api/node/v1
k8s.io/api/node/v1alpha1
k8s.io/api/node/v1beta1
k8s.io/api/policy/v1beta1
@ -1954,6 +1955,7 @@ k8s.io/client-go/informers/networking
k8s.io/client-go/informers/networking/v1
k8s.io/client-go/informers/networking/v1beta1
k8s.io/client-go/informers/node
k8s.io/client-go/informers/node/v1
k8s.io/client-go/informers/node/v1alpha1
k8s.io/client-go/informers/node/v1beta1
k8s.io/client-go/informers/policy
@ -2031,6 +2033,8 @@ k8s.io/client-go/kubernetes/typed/networking/v1
k8s.io/client-go/kubernetes/typed/networking/v1/fake
k8s.io/client-go/kubernetes/typed/networking/v1beta1
k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake
k8s.io/client-go/kubernetes/typed/node/v1
k8s.io/client-go/kubernetes/typed/node/v1/fake
k8s.io/client-go/kubernetes/typed/node/v1alpha1
k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake
k8s.io/client-go/kubernetes/typed/node/v1beta1
@ -2080,6 +2084,7 @@ k8s.io/client-go/listers/extensions/v1beta1
k8s.io/client-go/listers/flowcontrol/v1alpha1
k8s.io/client-go/listers/networking/v1
k8s.io/client-go/listers/networking/v1beta1
k8s.io/client-go/listers/node/v1
k8s.io/client-go/listers/node/v1alpha1
k8s.io/client-go/listers/node/v1beta1
k8s.io/client-go/listers/policy/v1beta1