diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json
index 5bd24a9b834..c85d9179d97 100644
--- a/api/openapi-spec/swagger.json
+++ b/api/openapi-spec/swagger.json
@@ -41309,6 +41309,1158 @@
}
]
},
+ "/apis/autoscaling/v2beta2/": {
+ "get": {
+ "description": "get available resources",
+ "consumes": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "getAutoscalingV2beta2APIResources",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ }
+ },
+ "/apis/autoscaling/v2beta2/horizontalpodautoscalers": {
+ "get": {
+ "description": "list or watch objects of kind HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "listAutoscalingV2beta2HorizontalPodAutoscalerForAllNamespaces",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerList"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "list",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers": {
+ "get": {
+ "description": "list or watch objects of kind HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "listAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerList"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "list",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "post": {
+ "description": "create a HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "createAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "201": {
+ "description": "Created",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "202": {
+ "description": "Accepted",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "post",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "delete": {
+ "description": "delete collection of HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "deleteAutoscalingV2beta2CollectionNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "deletecollection",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}": {
+ "get": {
+ "description": "read the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "readAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.",
+ "name": "exact",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Should this value be exported. Export strips fields that a user can not specify.",
+ "name": "export",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "get",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "put": {
+ "description": "replace the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "replaceAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "201": {
+ "description": "Created",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "put",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "delete": {
+ "description": "delete a HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "deleteAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
+ }
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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",
+ "name": "dryRun",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
+ "name": "gracePeriodSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
+ "name": "orphanDependents",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. 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.",
+ "name": "propagationPolicy",
+ "in": "query"
+ }
+ ],
+ "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"
+ }
+ },
+ "x-kubernetes-action": "delete",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "patch": {
+ "description": "partially update the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "patchAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "patch",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the HorizontalPodAutoscaler",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status": {
+ "get": {
+ "description": "read status of the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "readAutoscalingV2beta2NamespacedHorizontalPodAutoscalerStatus",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "get",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "put": {
+ "description": "replace status of the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "replaceAutoscalingV2beta2NamespacedHorizontalPodAutoscalerStatus",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "201": {
+ "description": "Created",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "put",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "patch": {
+ "description": "partially update status of the specified HorizontalPodAutoscaler",
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "patchAutoscalingV2beta2NamespacedHorizontalPodAutoscalerStatus",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "patch",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the HorizontalPodAutoscaler",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers": {
+ "get": {
+ "description": "watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead.",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "watchAutoscalingV2beta2HorizontalPodAutoscalerListForAllNamespaces",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "watchlist",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers": {
+ "get": {
+ "description": "watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead.",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "watchAutoscalingV2beta2NamespacedHorizontalPodAutoscalerList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "watchlist",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}": {
+ "get": {
+ "description": "watch changes to an object of kind HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "autoscaling_v2beta2"
+ ],
+ "operationId": "watchAutoscalingV2beta2NamespacedHorizontalPodAutoscaler",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "watch",
+ "x-kubernetes-group-version-kind": {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "name": "continue",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "If true, partially initialized resources are included in the response.",
+ "name": "includeUninitialized",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "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.",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the HorizontalPodAutoscaler",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
"/apis/batch/": {
"get": {
"description": "get information of a group",
@@ -77326,7 +78478,6 @@
"required": [
"currentReplicas",
"desiredReplicas",
- "currentMetrics",
"conditions"
],
"properties": {
@@ -77429,10 +78580,18 @@
"targetValue"
],
"properties": {
+ "averageValue": {
+ "description": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ },
"metricName": {
"description": "metricName is the name of the metric in question.",
"type": "string"
},
+ "selector": {
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
+ },
"target": {
"description": "target is the described Kubernetes object.",
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference"
@@ -77451,6 +78610,10 @@
"currentValue"
],
"properties": {
+ "averageValue": {
+ "description": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ },
"currentValue": {
"description": "currentValue is the current value of the metric (as a quantity).",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
@@ -77459,6 +78622,10 @@
"description": "metricName is the name of the metric in question.",
"type": "string"
},
+ "selector": {
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
+ },
"target": {
"description": "target is the described Kubernetes object.",
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference"
@@ -77476,6 +78643,10 @@
"description": "metricName is the name of the metric in question",
"type": "string"
},
+ "selector": {
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
+ },
"targetAverageValue": {
"description": "targetAverageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
@@ -77496,6 +78667,10 @@
"metricName": {
"description": "metricName is the name of the metric in question",
"type": "string"
+ },
+ "selector": {
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
}
}
},
@@ -77542,6 +78717,459 @@
}
}
},
+ "io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference": {
+ "description": "CrossVersionObjectReference contains enough information to let you identify the referred resource.",
+ "required": [
+ "kind",
+ "name"
+ ],
+ "properties": {
+ "apiVersion": {
+ "description": "API version of the referent",
+ "type": "string"
+ },
+ "kind": {
+ "description": "Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\"",
+ "type": "string"
+ },
+ "name": {
+ "description": "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names",
+ "type": "string"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ExternalMetricSource": {
+ "description": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+ "required": [
+ "metric",
+ "target"
+ ],
+ "properties": {
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ },
+ "target": {
+ "description": "target specifies the target value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricTarget"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus": {
+ "description": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.",
+ "required": [
+ "metric",
+ "current"
+ ],
+ "properties": {
+ "current": {
+ "description": "current contains the current value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricValueStatus"
+ },
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler": {
+ "description": "HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.",
+ "properties": {
+ "apiVersion": {
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
+ "type": "string"
+ },
+ "kind": {
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
+ },
+ "spec": {
+ "description": "spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec"
+ },
+ "status": {
+ "description": "status is the current information about the autoscaler.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus"
+ }
+ },
+ "x-kubernetes-group-version-kind": [
+ {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscaler",
+ "version": "v2beta2"
+ }
+ ]
+ },
+ "io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition": {
+ "description": "HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.",
+ "required": [
+ "type",
+ "status"
+ ],
+ "properties": {
+ "lastTransitionTime": {
+ "description": "lastTransitionTime is the last time the condition transitioned from one status to another",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
+ },
+ "message": {
+ "description": "message is a human-readable explanation containing details about the transition",
+ "type": "string"
+ },
+ "reason": {
+ "description": "reason is the reason for the condition's last transition.",
+ "type": "string"
+ },
+ "status": {
+ "description": "status is the status of the condition (True, False, Unknown)",
+ "type": "string"
+ },
+ "type": {
+ "description": "type describes the current condition",
+ "type": "string"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerList": {
+ "description": "HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.",
+ "required": [
+ "items"
+ ],
+ "properties": {
+ "apiVersion": {
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
+ "type": "string"
+ },
+ "items": {
+ "description": "items is the list of horizontal pod autoscaler objects.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"
+ }
+ },
+ "kind": {
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "metadata is the standard list metadata.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
+ }
+ },
+ "x-kubernetes-group-version-kind": [
+ {
+ "group": "autoscaling",
+ "kind": "HorizontalPodAutoscalerList",
+ "version": "v2beta2"
+ }
+ ]
+ },
+ "io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec": {
+ "description": "HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.",
+ "required": [
+ "scaleTargetRef",
+ "maxReplicas"
+ ],
+ "properties": {
+ "maxReplicas": {
+ "description": "maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "metrics": {
+ "description": "metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricSpec"
+ }
+ },
+ "minReplicas": {
+ "description": "minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "scaleTargetRef": {
+ "description": "scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus": {
+ "description": "HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.",
+ "required": [
+ "currentReplicas",
+ "desiredReplicas",
+ "conditions"
+ ],
+ "properties": {
+ "conditions": {
+ "description": "conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition"
+ }
+ },
+ "currentMetrics": {
+ "description": "currentMetrics is the last read state of the metrics used by this autoscaler.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricStatus"
+ }
+ },
+ "currentReplicas": {
+ "description": "currentReplicas is current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "desiredReplicas": {
+ "description": "desiredReplicas is the desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "lastScaleTime": {
+ "description": "lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
+ },
+ "observedGeneration": {
+ "description": "observedGeneration is the most recent generation observed by this autoscaler.",
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.MetricIdentifier": {
+ "description": "MetricIdentifier defines the name and optionally selector for a metric",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "description": "name is the name of the given metric",
+ "type": "string"
+ },
+ "selector": {
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.MetricSpec": {
+ "description": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "external": {
+ "description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ExternalMetricSource"
+ },
+ "object": {
+ "description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ObjectMetricSource"
+ },
+ "pods": {
+ "description": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.PodsMetricSource"
+ },
+ "resource": {
+ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ResourceMetricSource"
+ },
+ "type": {
+ "description": "type is the type of metric source. It should be one of \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.",
+ "type": "string"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.MetricStatus": {
+ "description": "MetricStatus describes the last-read state of a single metric.",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "external": {
+ "description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus"
+ },
+ "object": {
+ "description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus"
+ },
+ "pods": {
+ "description": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.PodsMetricStatus"
+ },
+ "resource": {
+ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus"
+ },
+ "type": {
+ "description": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.",
+ "type": "string"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.MetricTarget": {
+ "description": "MetricTarget defines the target value, average value, or average utilization of a specific metric",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "averageUtilization": {
+ "description": "averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type",
+ "type": "integer",
+ "format": "int32"
+ },
+ "averageValue": {
+ "description": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ },
+ "type": {
+ "description": "type represents whether the metric type is Utilization, Value, or AverageValue",
+ "type": "string"
+ },
+ "value": {
+ "description": "value is the target value of the metric (as a quantity).",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.MetricValueStatus": {
+ "description": "MetricValueStatus holds the current value for a metric",
+ "required": [
+ "value",
+ "averageValue",
+ "averageUtilization"
+ ],
+ "properties": {
+ "averageUtilization": {
+ "description": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "averageValue": {
+ "description": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ },
+ "value": {
+ "description": "value is the current value of the metric (as a quantity).",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ObjectMetricSource": {
+ "description": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "required": [
+ "describedObject",
+ "target",
+ "metric"
+ ],
+ "properties": {
+ "describedObject": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference"
+ },
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ },
+ "target": {
+ "description": "target specifies the target value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricTarget"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus": {
+ "description": "ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "required": [
+ "metric",
+ "current",
+ "describedObject"
+ ],
+ "properties": {
+ "current": {
+ "description": "current contains the current value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricValueStatus"
+ },
+ "describedObject": {
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference"
+ },
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.PodsMetricSource": {
+ "description": "PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "required": [
+ "metric",
+ "target"
+ ],
+ "properties": {
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ },
+ "target": {
+ "description": "target specifies the target value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricTarget"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.PodsMetricStatus": {
+ "description": "PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).",
+ "required": [
+ "metric",
+ "current"
+ ],
+ "properties": {
+ "current": {
+ "description": "current contains the current value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricValueStatus"
+ },
+ "metric": {
+ "description": "metric identifies the target metric by name and selector",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricIdentifier"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ResourceMetricSource": {
+ "description": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.",
+ "required": [
+ "name",
+ "target"
+ ],
+ "properties": {
+ "name": {
+ "description": "name is the name of the resource in question.",
+ "type": "string"
+ },
+ "target": {
+ "description": "target specifies the target value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricTarget"
+ }
+ }
+ },
+ "io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus": {
+ "description": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "required": [
+ "name",
+ "current"
+ ],
+ "properties": {
+ "current": {
+ "description": "current contains the current value for the given metric",
+ "$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricValueStatus"
+ },
+ "name": {
+ "description": "Name is the name of the resource in question.",
+ "type": "string"
+ }
+ }
+ },
"io.k8s.api.batch.v1.Job": {
"description": "Job represents the configuration of a single job.",
"properties": {
@@ -88115,6 +89743,11 @@
"kind": "DeleteOptions",
"version": "v2beta1"
},
+ {
+ "group": "autoscaling",
+ "kind": "DeleteOptions",
+ "version": "v2beta2"
+ },
{
"group": "batch",
"kind": "DeleteOptions",
@@ -88675,6 +90308,11 @@
"kind": "WatchEvent",
"version": "v2beta1"
},
+ {
+ "group": "autoscaling",
+ "kind": "WatchEvent",
+ "version": "v2beta2"
+ },
{
"group": "batch",
"kind": "WatchEvent",
diff --git a/api/swagger-spec/autoscaling_v2beta1.json b/api/swagger-spec/autoscaling_v2beta1.json
index da121684edd..60121d1b8af 100644
--- a/api/swagger-spec/autoscaling_v2beta1.json
+++ b/api/swagger-spec/autoscaling_v2beta1.json
@@ -1600,6 +1600,56 @@
"targetValue": {
"type": "string",
"description": "targetValue is the target value of the metric (as a quantity)."
+ },
+ "selector": {
+ "$ref": "v1.LabelSelector",
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics."
+ },
+ "averageValue": {
+ "type": "string",
+ "description": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)"
+ }
+ }
+ },
+ "v1.LabelSelector": {
+ "id": "v1.LabelSelector",
+ "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
+ "properties": {
+ "matchLabels": {
+ "type": "object",
+ "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
+ },
+ "matchExpressions": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.LabelSelectorRequirement"
+ },
+ "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
+ }
+ }
+ },
+ "v1.LabelSelectorRequirement": {
+ "id": "v1.LabelSelectorRequirement",
+ "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
+ "required": [
+ "key",
+ "operator"
+ ],
+ "properties": {
+ "key": {
+ "type": "string",
+ "description": "key is the label key that the selector applies to."
+ },
+ "operator": {
+ "type": "string",
+ "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist."
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch."
}
}
},
@@ -1618,6 +1668,10 @@
"targetAverageValue": {
"type": "string",
"description": "targetAverageValue is the target value of the average of the metric across all relevant pods (as a quantity)"
+ },
+ "selector": {
+ "$ref": "v1.LabelSelector",
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics."
}
}
},
@@ -1668,48 +1722,6 @@
}
}
},
- "v1.LabelSelector": {
- "id": "v1.LabelSelector",
- "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
- "properties": {
- "matchLabels": {
- "type": "object",
- "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
- },
- "matchExpressions": {
- "type": "array",
- "items": {
- "$ref": "v1.LabelSelectorRequirement"
- },
- "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
- }
- }
- },
- "v1.LabelSelectorRequirement": {
- "id": "v1.LabelSelectorRequirement",
- "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
- "required": [
- "key",
- "operator"
- ],
- "properties": {
- "key": {
- "type": "string",
- "description": "key is the label key that the selector applies to."
- },
- "operator": {
- "type": "string",
- "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist."
- },
- "values": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch."
- }
- }
- },
"v2beta1.HorizontalPodAutoscalerStatus": {
"id": "v2beta1.HorizontalPodAutoscalerStatus",
"description": "HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.",
@@ -1804,6 +1816,14 @@
"currentValue": {
"type": "string",
"description": "currentValue is the current value of the metric (as a quantity)."
+ },
+ "selector": {
+ "$ref": "v1.LabelSelector",
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics."
+ },
+ "averageValue": {
+ "type": "string",
+ "description": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)"
}
}
},
@@ -1822,6 +1842,10 @@
"currentAverageValue": {
"type": "string",
"description": "currentAverageValue is the current value of the average of the metric across all relevant pods (as a quantity)"
+ },
+ "selector": {
+ "$ref": "v1.LabelSelector",
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics."
}
}
},
diff --git a/api/swagger-spec/autoscaling_v2beta2.json b/api/swagger-spec/autoscaling_v2beta2.json
new file mode 100644
index 00000000000..2fd14abf66f
--- /dev/null
+++ b/api/swagger-spec/autoscaling_v2beta2.json
@@ -0,0 +1,2112 @@
+{
+ "swaggerVersion": "1.2",
+ "apiVersion": "autoscaling/v2beta2",
+ "basePath": "https://10.10.10.10:6443",
+ "resourcePath": "/apis/autoscaling/v2beta2",
+ "info": {
+ "title": "",
+ "description": ""
+ },
+ "apis": [
+ {
+ "path": "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v2beta2.HorizontalPodAutoscalerList",
+ "method": "GET",
+ "summary": "list or watch objects of kind HorizontalPodAutoscaler",
+ "nickname": "listNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscalerList"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "POST",
+ "summary": "create a HorizontalPodAutoscaler",
+ "nickname": "createNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ },
+ {
+ "code": 201,
+ "message": "Created",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ },
+ {
+ "code": 202,
+ "message": "Accepted",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1.Status",
+ "method": "DELETE",
+ "summary": "delete collection of HorizontalPodAutoscaler",
+ "nickname": "deletecollectionNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v1.WatchEvent",
+ "method": "GET",
+ "summary": "watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead.",
+ "nickname": "watchNamespacedHorizontalPodAutoscalerList",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.WatchEvent"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "GET",
+ "summary": "read the specified HorizontalPodAutoscaler",
+ "nickname": "readNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "export",
+ "description": "Should this value be exported. Export strips fields that a user can not specify.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "exact",
+ "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "PUT",
+ "summary": "replace the specified HorizontalPodAutoscaler",
+ "nickname": "replaceNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ },
+ {
+ "code": 201,
+ "message": "Created",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "PATCH",
+ "summary": "partially update the specified HorizontalPodAutoscaler",
+ "nickname": "patchNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ },
+ {
+ "type": "v1.Status",
+ "method": "DELETE",
+ "summary": "delete a HorizontalPodAutoscaler",
+ "nickname": "deleteNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.DeleteOptions",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "gracePeriodSeconds",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "orphanDependents",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "propagationPolicy",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "dryRun",
+ "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",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.Status"
+ },
+ {
+ "code": 202,
+ "message": "Accepted",
+ "responseModel": "v1.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v1.WatchEvent",
+ "method": "GET",
+ "summary": "watch changes to an object of kind HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.",
+ "nickname": "watchNamespacedHorizontalPodAutoscaler",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.WatchEvent"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/horizontalpodautoscalers",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v2beta2.HorizontalPodAutoscalerList",
+ "method": "GET",
+ "summary": "list or watch objects of kind HorizontalPodAutoscaler",
+ "nickname": "listHorizontalPodAutoscalerForAllNamespaces",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscalerList"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v1.WatchEvent",
+ "method": "GET",
+ "summary": "watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the 'watch' parameter with a list operation instead.",
+ "nickname": "watchHorizontalPodAutoscalerListForAllNamespaces",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "labelSelector",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "fieldSelector",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "includeUninitialized",
+ "description": "If true, partially initialized resources are included in the response.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "boolean",
+ "paramType": "query",
+ "name": "watch",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "resourceVersion",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "timeoutSeconds",
+ "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "integer",
+ "paramType": "query",
+ "name": "limit",
+ "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "continue",
+ "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 indicating the client must restart their list without the continue field. This 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.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.WatchEvent"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "GET",
+ "summary": "read status of the specified HorizontalPodAutoscaler",
+ "nickname": "readNamespacedHorizontalPodAutoscalerStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "PUT",
+ "summary": "replace status of the specified HorizontalPodAutoscaler",
+ "nickname": "replaceNamespacedHorizontalPodAutoscalerStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ },
+ {
+ "code": 201,
+ "message": "Created",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v2beta2.HorizontalPodAutoscaler",
+ "method": "PATCH",
+ "summary": "partially update status of the specified HorizontalPodAutoscaler",
+ "nickname": "patchNamespacedHorizontalPodAutoscalerStatus",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the HorizontalPodAutoscaler",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v2beta2.HorizontalPodAutoscaler"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/autoscaling/v2beta2",
+ "description": "API at /apis/autoscaling/v2beta2",
+ "operations": [
+ {
+ "type": "v1.APIResourceList",
+ "method": "GET",
+ "summary": "get available resources",
+ "nickname": "getAPIResources",
+ "parameters": [],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "v2beta2.HorizontalPodAutoscalerList": {
+ "id": "v2beta2.HorizontalPodAutoscalerList",
+ "description": "HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.",
+ "required": [
+ "items"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ListMeta",
+ "description": "metadata is the standard list metadata."
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "v2beta2.HorizontalPodAutoscaler"
+ },
+ "description": "items is the list of horizontal pod autoscaler objects."
+ }
+ }
+ },
+ "v1.ListMeta": {
+ "id": "v1.ListMeta",
+ "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.",
+ "properties": {
+ "selfLink": {
+ "type": "string",
+ "description": "selfLink is a URL representing this object. Populated by the system. Read-only."
+ },
+ "resourceVersion": {
+ "type": "string",
+ "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
+ },
+ "continue": {
+ "type": "string",
+ "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response."
+ }
+ }
+ },
+ "v2beta2.HorizontalPodAutoscaler": {
+ "id": "v2beta2.HorizontalPodAutoscaler",
+ "description": "HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ObjectMeta",
+ "description": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"
+ },
+ "spec": {
+ "$ref": "v2beta2.HorizontalPodAutoscalerSpec",
+ "description": "spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status."
+ },
+ "status": {
+ "$ref": "v2beta2.HorizontalPodAutoscalerStatus",
+ "description": "status is the current information about the autoscaler."
+ }
+ }
+ },
+ "v1.ObjectMeta": {
+ "id": "v1.ObjectMeta",
+ "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
+ },
+ "generateName": {
+ "type": "string",
+ "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency"
+ },
+ "namespace": {
+ "type": "string",
+ "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "SelfLink is a URL representing this object. Populated by the system. Read-only."
+ },
+ "uid": {
+ "type": "string",
+ "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
+ },
+ "resourceVersion": {
+ "type": "string",
+ "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
+ },
+ "generation": {
+ "type": "integer",
+ "format": "int64",
+ "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only."
+ },
+ "creationTimestamp": {
+ "type": "string",
+ "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"
+ },
+ "deletionTimestamp": {
+ "type": "string",
+ "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"
+ },
+ "deletionGracePeriodSeconds": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only."
+ },
+ "labels": {
+ "type": "object",
+ "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels"
+ },
+ "annotations": {
+ "type": "object",
+ "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations"
+ },
+ "ownerReferences": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.OwnerReference"
+ },
+ "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller."
+ },
+ "initializers": {
+ "$ref": "v1.Initializers",
+ "description": "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user."
+ },
+ "finalizers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed."
+ },
+ "clusterName": {
+ "type": "string",
+ "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request."
+ }
+ }
+ },
+ "v1.OwnerReference": {
+ "id": "v1.OwnerReference",
+ "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.",
+ "required": [
+ "apiVersion",
+ "kind",
+ "name",
+ "uid"
+ ],
+ "properties": {
+ "apiVersion": {
+ "type": "string",
+ "description": "API version of the referent."
+ },
+ "kind": {
+ "type": "string",
+ "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"
+ },
+ "uid": {
+ "type": "string",
+ "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
+ },
+ "controller": {
+ "type": "boolean",
+ "description": "If true, this reference points to the managing controller."
+ },
+ "blockOwnerDeletion": {
+ "type": "boolean",
+ "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned."
+ }
+ }
+ },
+ "v1.Initializers": {
+ "id": "v1.Initializers",
+ "description": "Initializers tracks the progress of initialization.",
+ "required": [
+ "pending"
+ ],
+ "properties": {
+ "pending": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.Initializer"
+ },
+ "description": "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients."
+ },
+ "result": {
+ "$ref": "v1.Status",
+ "description": "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion."
+ }
+ }
+ },
+ "v1.Initializer": {
+ "id": "v1.Initializer",
+ "description": "Initializer is information about an initializer that has not yet completed.",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the process that is responsible for initializing this object."
+ }
+ }
+ },
+ "v1.Status": {
+ "id": "v1.Status",
+ "description": "Status is a return value for calls that don't return other objects.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ListMeta",
+ "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status"
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the status of this operation."
+ },
+ "reason": {
+ "type": "string",
+ "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it."
+ },
+ "details": {
+ "$ref": "v1.StatusDetails",
+ "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type."
+ },
+ "code": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Suggested HTTP return code for this status, 0 if not set."
+ }
+ }
+ },
+ "v1.StatusDetails": {
+ "id": "v1.StatusDetails",
+ "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)."
+ },
+ "group": {
+ "type": "string",
+ "description": "The group attribute of the resource associated with the status StatusReason."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "uid": {
+ "type": "string",
+ "description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
+ },
+ "causes": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.StatusCause"
+ },
+ "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes."
+ },
+ "retryAfterSeconds": {
+ "type": "integer",
+ "format": "int32",
+ "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action."
+ }
+ }
+ },
+ "v1.StatusCause": {
+ "id": "v1.StatusCause",
+ "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.",
+ "properties": {
+ "reason": {
+ "type": "string",
+ "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader."
+ },
+ "field": {
+ "type": "string",
+ "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\""
+ }
+ }
+ },
+ "v2beta2.HorizontalPodAutoscalerSpec": {
+ "id": "v2beta2.HorizontalPodAutoscalerSpec",
+ "description": "HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.",
+ "required": [
+ "scaleTargetRef",
+ "maxReplicas"
+ ],
+ "properties": {
+ "scaleTargetRef": {
+ "$ref": "v2beta2.CrossVersionObjectReference",
+ "description": "scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count."
+ },
+ "minReplicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod."
+ },
+ "maxReplicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas."
+ },
+ "metrics": {
+ "type": "array",
+ "items": {
+ "$ref": "v2beta2.MetricSpec"
+ },
+ "description": "metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization."
+ }
+ }
+ },
+ "v2beta2.CrossVersionObjectReference": {
+ "id": "v2beta2.CrossVersionObjectReference",
+ "description": "CrossVersionObjectReference contains enough information to let you identify the referred resource.",
+ "required": [
+ "kind",
+ "name"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\""
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "API version of the referent"
+ }
+ }
+ },
+ "v2beta2.MetricSpec": {
+ "id": "v2beta2.MetricSpec",
+ "description": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "type is the type of metric source. It should be one of \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object."
+ },
+ "object": {
+ "$ref": "v2beta2.ObjectMetricSource",
+ "description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object)."
+ },
+ "pods": {
+ "$ref": "v2beta2.PodsMetricSource",
+ "description": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value."
+ },
+ "resource": {
+ "$ref": "v2beta2.ResourceMetricSource",
+ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
+ },
+ "external": {
+ "$ref": "v2beta2.ExternalMetricSource",
+ "description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
+ }
+ }
+ },
+ "v2beta2.ObjectMetricSource": {
+ "id": "v2beta2.ObjectMetricSource",
+ "description": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "required": [
+ "describedObject",
+ "target",
+ "metric"
+ ],
+ "properties": {
+ "describedObject": {
+ "$ref": "v2beta2.CrossVersionObjectReference"
+ },
+ "target": {
+ "$ref": "v2beta2.MetricTarget",
+ "description": "target specifies the target value for the given metric"
+ },
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ }
+ }
+ },
+ "v2beta2.MetricTarget": {
+ "id": "v2beta2.MetricTarget",
+ "description": "MetricTarget defines the target value, average value, or average utilization of a specific metric",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "type represents whether the metric type is Utilization, Value, or AverageValue"
+ },
+ "value": {
+ "type": "string",
+ "description": "value is the target value of the metric (as a quantity)."
+ },
+ "averageValue": {
+ "type": "string",
+ "description": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)"
+ },
+ "averageUtilization": {
+ "type": "integer",
+ "format": "int32",
+ "description": "averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type"
+ }
+ }
+ },
+ "v2beta2.MetricIdentifier": {
+ "id": "v2beta2.MetricIdentifier",
+ "description": "MetricIdentifier defines the name and optionally selector for a metric",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name is the name of the given metric"
+ },
+ "selector": {
+ "$ref": "v1.LabelSelector",
+ "description": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics."
+ }
+ }
+ },
+ "v1.LabelSelector": {
+ "id": "v1.LabelSelector",
+ "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
+ "properties": {
+ "matchLabels": {
+ "type": "object",
+ "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
+ },
+ "matchExpressions": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.LabelSelectorRequirement"
+ },
+ "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
+ }
+ }
+ },
+ "v1.LabelSelectorRequirement": {
+ "id": "v1.LabelSelectorRequirement",
+ "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
+ "required": [
+ "key",
+ "operator"
+ ],
+ "properties": {
+ "key": {
+ "type": "string",
+ "description": "key is the label key that the selector applies to."
+ },
+ "operator": {
+ "type": "string",
+ "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist."
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch."
+ }
+ }
+ },
+ "v2beta2.PodsMetricSource": {
+ "id": "v2beta2.PodsMetricSource",
+ "description": "PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "required": [
+ "metric",
+ "target"
+ ],
+ "properties": {
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ },
+ "target": {
+ "$ref": "v2beta2.MetricTarget",
+ "description": "target specifies the target value for the given metric"
+ }
+ }
+ },
+ "v2beta2.ResourceMetricSource": {
+ "id": "v2beta2.ResourceMetricSource",
+ "description": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.",
+ "required": [
+ "name",
+ "target"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name is the name of the resource in question."
+ },
+ "target": {
+ "$ref": "v2beta2.MetricTarget",
+ "description": "target specifies the target value for the given metric"
+ }
+ }
+ },
+ "v2beta2.ExternalMetricSource": {
+ "id": "v2beta2.ExternalMetricSource",
+ "description": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+ "required": [
+ "metric",
+ "target"
+ ],
+ "properties": {
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ },
+ "target": {
+ "$ref": "v2beta2.MetricTarget",
+ "description": "target specifies the target value for the given metric"
+ }
+ }
+ },
+ "v2beta2.HorizontalPodAutoscalerStatus": {
+ "id": "v2beta2.HorizontalPodAutoscalerStatus",
+ "description": "HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.",
+ "required": [
+ "currentReplicas",
+ "desiredReplicas",
+ "currentMetrics",
+ "conditions"
+ ],
+ "properties": {
+ "observedGeneration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "observedGeneration is the most recent generation observed by this autoscaler."
+ },
+ "lastScaleTime": {
+ "type": "string",
+ "description": "lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed."
+ },
+ "currentReplicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "currentReplicas is current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler."
+ },
+ "desiredReplicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "desiredReplicas is the desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler."
+ },
+ "currentMetrics": {
+ "type": "array",
+ "items": {
+ "$ref": "v2beta2.MetricStatus"
+ },
+ "description": "currentMetrics is the last read state of the metrics used by this autoscaler."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "$ref": "v2beta2.HorizontalPodAutoscalerCondition"
+ },
+ "description": "conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met."
+ }
+ }
+ },
+ "v2beta2.MetricStatus": {
+ "id": "v2beta2.MetricStatus",
+ "description": "MetricStatus describes the last-read state of a single metric.",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object."
+ },
+ "object": {
+ "$ref": "v2beta2.ObjectMetricStatus",
+ "description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object)."
+ },
+ "pods": {
+ "$ref": "v2beta2.PodsMetricStatus",
+ "description": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value."
+ },
+ "resource": {
+ "$ref": "v2beta2.ResourceMetricStatus",
+ "description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
+ },
+ "external": {
+ "$ref": "v2beta2.ExternalMetricStatus",
+ "description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
+ }
+ }
+ },
+ "v2beta2.ObjectMetricStatus": {
+ "id": "v2beta2.ObjectMetricStatus",
+ "description": "ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "required": [
+ "metric",
+ "current",
+ "describedObject"
+ ],
+ "properties": {
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ },
+ "current": {
+ "$ref": "v2beta2.MetricValueStatus",
+ "description": "current contains the current value for the given metric"
+ },
+ "describedObject": {
+ "$ref": "v2beta2.CrossVersionObjectReference"
+ }
+ }
+ },
+ "v2beta2.MetricValueStatus": {
+ "id": "v2beta2.MetricValueStatus",
+ "description": "MetricValueStatus holds the current value for a metric",
+ "required": [
+ "value",
+ "averageValue",
+ "averageUtilization"
+ ],
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "value is the current value of the metric (as a quantity)."
+ },
+ "averageValue": {
+ "type": "string",
+ "description": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)"
+ },
+ "averageUtilization": {
+ "type": "integer",
+ "format": "int32",
+ "description": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods."
+ }
+ }
+ },
+ "v2beta2.PodsMetricStatus": {
+ "id": "v2beta2.PodsMetricStatus",
+ "description": "PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).",
+ "required": [
+ "metric",
+ "current"
+ ],
+ "properties": {
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ },
+ "current": {
+ "$ref": "v2beta2.MetricValueStatus",
+ "description": "current contains the current value for the given metric"
+ }
+ }
+ },
+ "v2beta2.ResourceMetricStatus": {
+ "id": "v2beta2.ResourceMetricStatus",
+ "description": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "required": [
+ "name",
+ "current"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name is the name of the resource in question."
+ },
+ "current": {
+ "$ref": "v2beta2.MetricValueStatus",
+ "description": "current contains the current value for the given metric"
+ }
+ }
+ },
+ "v2beta2.ExternalMetricStatus": {
+ "id": "v2beta2.ExternalMetricStatus",
+ "description": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.",
+ "required": [
+ "metric",
+ "current"
+ ],
+ "properties": {
+ "metric": {
+ "$ref": "v2beta2.MetricIdentifier",
+ "description": "metric identifies the target metric by name and selector"
+ },
+ "current": {
+ "$ref": "v2beta2.MetricValueStatus",
+ "description": "current contains the current value for the given metric"
+ }
+ }
+ },
+ "v2beta2.HorizontalPodAutoscalerCondition": {
+ "id": "v2beta2.HorizontalPodAutoscalerCondition",
+ "description": "HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.",
+ "required": [
+ "type",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "type describes the current condition"
+ },
+ "status": {
+ "type": "string",
+ "description": "status is the status of the condition (True, False, Unknown)"
+ },
+ "lastTransitionTime": {
+ "type": "string",
+ "description": "lastTransitionTime is the last time the condition transitioned from one status to another"
+ },
+ "reason": {
+ "type": "string",
+ "description": "reason is the reason for the condition's last transition."
+ },
+ "message": {
+ "type": "string",
+ "description": "message is a human-readable explanation containing details about the transition"
+ }
+ }
+ },
+ "v1.WatchEvent": {
+ "id": "v1.WatchEvent",
+ "required": [
+ "type",
+ "object"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "object": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.Patch": {
+ "id": "v1.Patch",
+ "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.",
+ "properties": {}
+ },
+ "v1.DeleteOptions": {
+ "id": "v1.DeleteOptions",
+ "description": "DeleteOptions may be provided when deleting an API object.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
+ },
+ "gracePeriodSeconds": {
+ "type": "integer",
+ "format": "int64",
+ "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."
+ },
+ "preconditions": {
+ "$ref": "v1.Preconditions",
+ "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
+ },
+ "orphanDependents": {
+ "type": "boolean",
+ "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both."
+ },
+ "propagationPolicy": {
+ "$ref": "v1.DeletionPropagation",
+ "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."
+ },
+ "dryRun": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "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"
+ }
+ }
+ },
+ "v1.Preconditions": {
+ "id": "v1.Preconditions",
+ "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
+ "properties": {
+ "uid": {
+ "$ref": "types.UID",
+ "description": "Specifies the target UID."
+ }
+ }
+ },
+ "types.UID": {
+ "id": "types.UID",
+ "properties": {}
+ },
+ "v1.DeletionPropagation": {
+ "id": "v1.DeletionPropagation",
+ "properties": {}
+ },
+ "v1.APIResourceList": {
+ "id": "v1.APIResourceList",
+ "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",
+ "required": [
+ "groupVersion",
+ "resources"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ },
+ "apiVersion": {
+ "type": "string",
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
+ },
+ "groupVersion": {
+ "type": "string",
+ "description": "groupVersion is the group and version this APIResourceList is for."
+ },
+ "resources": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.APIResource"
+ },
+ "description": "resources contains the name of the resources and if they are namespaced."
+ }
+ }
+ },
+ "v1.APIResource": {
+ "id": "v1.APIResource",
+ "description": "APIResource specifies the name of a resource and whether it is namespaced.",
+ "required": [
+ "name",
+ "singularName",
+ "namespaced",
+ "kind",
+ "verbs"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name is the plural name of the resource."
+ },
+ "singularName": {
+ "type": "string",
+ "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface."
+ },
+ "namespaced": {
+ "type": "boolean",
+ "description": "namespaced indicates if a resource is namespaced or not."
+ },
+ "group": {
+ "type": "string",
+ "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\"."
+ },
+ "version": {
+ "type": "string",
+ "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\"."
+ },
+ "kind": {
+ "type": "string",
+ "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')"
+ },
+ "verbs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
+ },
+ "shortNames": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "shortNames is a list of suggested short names of the resource."
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')"
+ }
+ }
+ }
+ }
+ }
diff --git a/api/swagger-spec/resourceListing.json b/api/swagger-spec/resourceListing.json
index 39d28933345..cc35fcef299 100644
--- a/api/swagger-spec/resourceListing.json
+++ b/api/swagger-spec/resourceListing.json
@@ -53,6 +53,10 @@
"path": "/apis/autoscaling/v2beta1",
"description": "API at /apis/autoscaling/v2beta1"
},
+ {
+ "path": "/apis/autoscaling/v2beta2",
+ "description": "API at /apis/autoscaling/v2beta2"
+ },
{
"path": "/apis/autoscaling",
"description": "get information of a group"
diff --git a/cmd/kube-apiserver/app/aggregator.go b/cmd/kube-apiserver/app/aggregator.go
index e4251c440b0..4ff4726a4a3 100644
--- a/cmd/kube-apiserver/app/aggregator.go
+++ b/cmd/kube-apiserver/app/aggregator.go
@@ -249,6 +249,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
{Group: "authorization.k8s.io", Version: "v1beta1"}: {group: 17600, version: 9},
{Group: "autoscaling", Version: "v1"}: {group: 17500, version: 15},
{Group: "autoscaling", Version: "v2beta1"}: {group: 17500, version: 9},
+ {Group: "autoscaling", Version: "v2beta2"}: {group: 17500, version: 1},
{Group: "batch", Version: "v1"}: {group: 17400, version: 15},
{Group: "batch", Version: "v1beta1"}: {group: 17400, version: 9},
{Group: "batch", Version: "v2alpha1"}: {group: 17400, version: 9},
diff --git a/docs/api-reference/autoscaling/v2beta1/definitions.html b/docs/api-reference/autoscaling/v2beta1/definitions.html
index 24a46a35b87..61d802e9337 100755
--- a/docs/api-reference/autoscaling/v2beta1/definitions.html
+++ b/docs/api-reference/autoscaling/v2beta1/definitions.html
@@ -1034,6 +1034,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
string |
|
+
+selector |
+selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. |
+false |
+v1.LabelSelector |
+ |
+
@@ -1306,6 +1313,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
string |
|
+
+selector |
+selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics. |
+false |
+v1.LabelSelector |
+ |
+
@@ -2012,6 +2026,20 @@ Examples:
string |
|
+
+selector |
+selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics. |
+false |
+v1.LabelSelector |
+ |
+
+
+averageValue |
+averageValue is the target value of the average of the metric across all relevant pods (as a quantity) |
+false |
+string |
+ |
+
@@ -2122,6 +2150,20 @@ Examples:
string |
|
+
+selector |
+selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. |
+false |
+v1.LabelSelector |
+ |
+
+
+averageValue |
+averageValue is the current value of the average of the metric across all relevant pods (as a quantity) |
+false |
+string |
+ |
+
diff --git a/docs/api-reference/autoscaling/v2beta2/definitions.html b/docs/api-reference/autoscaling/v2beta2/definitions.html
new file mode 100755
index 00000000000..1d417824d71
--- /dev/null
+++ b/docs/api-reference/autoscaling/v2beta2/definitions.html
@@ -0,0 +1,2308 @@
+
+
+
+
+
+
+Top Level API Objects
+
+
+
+
+
+
+
Top Level API Objects
+
+
+
+
Definitions
+
+
+
v1.APIResourceList
+
+
APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+kind |
+Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+apiVersion |
+APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+groupVersion |
+groupVersion is the group and version this APIResourceList is for. |
+true |
+string |
+ |
+
+
+resources |
+resources contains the name of the resources and if they are namespaced. |
+true |
+v1.APIResource array |
+ |
+
+
+
+
+
+
+
+
+
ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+selfLink |
+selfLink is a URL representing this object. Populated by the system. Read-only. |
+false |
+string |
+ |
+
+
+resourceVersion |
+String that identifies the server’s internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency |
+false |
+string |
+ |
+
+
+continue |
+continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response. |
+false |
+string |
+ |
+
+
+
+
+
+
+
v1.Preconditions
+
+
Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+uid |
+Specifies the target UID. |
+false |
+types.UID |
+ |
+
+
+
+
+
+
+
v1.Initializers
+
+
Initializers tracks the progress of initialization.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+pending |
+Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients. |
+true |
+v1.Initializer array |
+ |
+
+
+result |
+If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion. |
+false |
+v1.Status |
+ |
+
+
+
+
+
+
+
v2beta2.HorizontalPodAutoscalerCondition
+
+
HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+type describes the current condition |
+true |
+string |
+ |
+
+
+status |
+status is the status of the condition (True, False, Unknown) |
+true |
+string |
+ |
+
+
+lastTransitionTime |
+lastTransitionTime is the last time the condition transitioned from one status to another |
+false |
+string |
+ |
+
+
+reason |
+reason is the reason for the condition’s last transition. |
+false |
+string |
+ |
+
+
+message |
+message is a human-readable explanation containing details about the transition |
+false |
+string |
+ |
+
+
+
+
+
+
+
v1.Status
+
+
Status is a return value for calls that don’t return other objects.
+
+
+
+
+
+
v2beta2.MetricTarget
+
+
MetricTarget defines the target value, average value, or average utilization of a specific metric
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+type represents whether the metric type is Utilization, Value, or AverageValue |
+true |
+string |
+ |
+
+
+value |
+value is the target value of the metric (as a quantity). |
+false |
+string |
+ |
+
+
+averageValue |
+averageValue is the target value of the average of the metric across all relevant pods (as a quantity) |
+false |
+string |
+ |
+
+
+averageUtilization |
+averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
v2beta2.PodsMetricStatus
+
+
PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+metric |
+metric identifies the target metric by name and selector |
+true |
+v2beta2.MetricIdentifier |
+ |
+
+
+current |
+current contains the current value for the given metric |
+true |
+v2beta2.MetricValueStatus |
+ |
+
+
+
+
+
+
+
v1.WatchEvent
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+ |
+true |
+string |
+ |
+
+
+object |
+ |
+true |
+string |
+ |
+
+
+
+
+
+
+
v1.LabelSelector
+
+
A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+matchLabels |
+matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. |
+false |
+object |
+ |
+
+
+matchExpressions |
+matchExpressions is a list of label selector requirements. The requirements are ANDed. |
+false |
+v1.LabelSelectorRequirement array |
+ |
+
+
+
+
+
+
+
v2beta2.ObjectMetricStatus
+
+
ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
+
+
+
+
+
+
v1.LabelSelectorRequirement
+
+
A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+key |
+key is the label key that the selector applies to. |
+true |
+string |
+ |
+
+
+operator |
+operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. |
+true |
+string |
+ |
+
+
+values |
+values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
+false |
+string array |
+ |
+
+
+
+
+
+
+
v2beta2.MetricValueStatus
+
+
MetricValueStatus holds the current value for a metric
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+value |
+value is the current value of the metric (as a quantity). |
+true |
+string |
+ |
+
+
+averageValue |
+averageValue is the current value of the average of the metric across all relevant pods (as a quantity) |
+true |
+string |
+ |
+
+
+averageUtilization |
+currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. |
+true |
+integer (int32) |
+ |
+
+
+
+
+
+
+
v1.DeletionPropagation
+
+
+
+
v1.Patch
+
+
Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
+
+
+
+
v1.DeleteOptions
+
+
DeleteOptions may be provided when deleting an API object.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+kind |
+Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+apiVersion |
+APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+gracePeriodSeconds |
+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. |
+false |
+integer (int64) |
+ |
+
+
+preconditions |
+Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. |
+false |
+v1.Preconditions |
+ |
+
+
+orphanDependents |
+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. |
+false |
+boolean |
+false |
+
+
+propagationPolicy |
+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. |
+false |
+v1.DeletionPropagation |
+ |
+
+
+dryRun |
+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 |
+false |
+string array |
+ |
+
+
+
+
+
+
+
v2beta2.MetricIdentifier
+
+
MetricIdentifier defines the name and optionally selector for a metric
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name is the name of the given metric |
+true |
+string |
+ |
+
+
+selector |
+selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. |
+false |
+v1.LabelSelector |
+ |
+
+
+
+
+
+
+
v2beta2.MetricSpec
+
+
MetricSpec specifies how to scale based on a single metric (only type
and one other matching field should be set at once).
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+type is the type of metric source. It should be one of "Object", "Pods" or "Resource", each mapping to a matching field in the object. |
+true |
+string |
+ |
+
+
+object |
+object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object). |
+false |
+v2beta2.ObjectMetricSource |
+ |
+
+
+pods |
+pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. |
+false |
+v2beta2.PodsMetricSource |
+ |
+
+
+resource |
+resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. |
+false |
+v2beta2.ResourceMetricSource |
+ |
+
+
+external |
+external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). |
+false |
+v2beta2.ExternalMetricSource |
+ |
+
+
+
+
+
+
+
v1.StatusDetails
+
+
StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). |
+false |
+string |
+ |
+
+
+group |
+The group attribute of the resource associated with the status StatusReason. |
+false |
+string |
+ |
+
+
+kind |
+The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds |
+false |
+string |
+ |
+
+
+uid |
+UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
+false |
+string |
+ |
+
+
+causes |
+The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. |
+false |
+v1.StatusCause array |
+ |
+
+
+retryAfterSeconds |
+If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
v2beta2.HorizontalPodAutoscalerList
+
+
HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
+
+
+
+
+
+
v2beta2.MetricStatus
+
+
MetricStatus describes the last-read state of a single metric.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+type is the type of metric source. It will be one of "Object", "Pods" or "Resource", each corresponds to a matching field in the object. |
+true |
+string |
+ |
+
+
+object |
+object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object). |
+false |
+v2beta2.ObjectMetricStatus |
+ |
+
+
+pods |
+pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. |
+false |
+v2beta2.PodsMetricStatus |
+ |
+
+
+resource |
+resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. |
+false |
+v2beta2.ResourceMetricStatus |
+ |
+
+
+external |
+external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). |
+false |
+v2beta2.ExternalMetricStatus |
+ |
+
+
+
+
+
+
+
v1.Initializer
+
+
Initializer is information about an initializer that has not yet completed.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name of the process that is responsible for initializing this object. |
+true |
+string |
+ |
+
+
+
+
+
+
+
v2beta2.HorizontalPodAutoscalerSpec
+
+
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+scaleTargetRef |
+scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count. |
+true |
+v2beta2.CrossVersionObjectReference |
+ |
+
+
+minReplicas |
+minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. |
+false |
+integer (int32) |
+ |
+
+
+maxReplicas |
+maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas. |
+true |
+integer (int32) |
+ |
+
+
+metrics |
+metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization. |
+false |
+v2beta2.MetricSpec array |
+ |
+
+
+
+
+
+
+
v2beta2.ObjectMetricSource
+
+
ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
+
+
+
+
+
+
v2beta2.ResourceMetricStatus
+
+
ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+Name is the name of the resource in question. |
+true |
+string |
+ |
+
+
+current |
+current contains the current value for the given metric |
+true |
+v2beta2.MetricValueStatus |
+ |
+
+
+
+
+
+
+
v1.OwnerReference
+
+
OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+apiVersion |
+API version of the referent. |
+true |
+string |
+ |
+
+
+kind |
+Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds |
+true |
+string |
+ |
+
+
+name |
+Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names |
+true |
+string |
+ |
+
+
+uid |
+UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
+true |
+string |
+ |
+
+
+controller |
+If true, this reference points to the managing controller. |
+false |
+boolean |
+false |
+
+
+blockOwnerDeletion |
+If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. |
+false |
+boolean |
+false |
+
+
+
+
+
+
+
+
+
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names |
+false |
+string |
+ |
+
+
+generateName |
+GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
+
+If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
+
+Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency |
+false |
+string |
+ |
+
+
+namespace |
+Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
+
+Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces |
+false |
+string |
+ |
+
+
+selfLink |
+SelfLink is a URL representing this object. Populated by the system. Read-only. |
+false |
+string |
+ |
+
+
+uid |
+UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
+
+Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
+false |
+string |
+ |
+
+
+resourceVersion |
+An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
+
+Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency |
+false |
+string |
+ |
+
+
+generation |
+A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. |
+false |
+integer (int64) |
+ |
+
+
+creationTimestamp |
+CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
+
+Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata |
+false |
+string |
+ |
+
+
+deletionTimestamp |
+DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.
+
+Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata |
+false |
+string |
+ |
+
+
+deletionGracePeriodSeconds |
+Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. |
+false |
+integer (int64) |
+ |
+
+
+labels |
+Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels |
+false |
+object |
+ |
+
+
+annotations |
+Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations |
+false |
+object |
+ |
+
+
+ownerReferences |
+List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. |
+false |
+v1.OwnerReference array |
+ |
+
+
+initializers |
+An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven’t explicitly asked to observe uninitialized objects.
+
+When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user. |
+false |
+v1.Initializers |
+ |
+
+
+finalizers |
+Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. |
+false |
+string array |
+ |
+
+
+clusterName |
+The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. |
+false |
+string |
+ |
+
+
+
+
+
+
+
v2beta2.ResourceMetricSource
+
+
ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. Only one "target" type should be set.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name is the name of the resource in question. |
+true |
+string |
+ |
+
+
+target |
+target specifies the target value for the given metric |
+true |
+v2beta2.MetricTarget |
+ |
+
+
+
+
+
+
+
v1.APIResource
+
+
APIResource specifies the name of a resource and whether it is namespaced.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name is the plural name of the resource. |
+true |
+string |
+ |
+
+
+singularName |
+singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. |
+true |
+string |
+ |
+
+
+namespaced |
+namespaced indicates if a resource is namespaced or not. |
+true |
+boolean |
+false |
+
+
+group |
+group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale". |
+false |
+string |
+ |
+
+
+version |
+version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource’s group)". |
+false |
+string |
+ |
+
+
+kind |
+kind is the kind for the resource (e.g. Foo is the kind for a resource foo) |
+true |
+string |
+ |
+
+
+verbs |
+verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) |
+true |
+string array |
+ |
+
+
+shortNames |
+shortNames is a list of suggested short names of the resource. |
+false |
+string array |
+ |
+
+
+categories |
+categories is a list of the grouped resources this resource belongs to (e.g. all) |
+false |
+string array |
+ |
+
+
+
+
+
+
+
types.UID
+
+
+
+
v2beta2.ExternalMetricStatus
+
+
ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+metric |
+metric identifies the target metric by name and selector |
+true |
+v2beta2.MetricIdentifier |
+ |
+
+
+current |
+current contains the current value for the given metric |
+true |
+v2beta2.MetricValueStatus |
+ |
+
+
+
+
+
+
+
v2beta2.HorizontalPodAutoscaler
+
+
HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.
+
+
+
+
+
+
v2beta2.ExternalMetricSource
+
+
ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+metric |
+metric identifies the target metric by name and selector |
+true |
+v2beta2.MetricIdentifier |
+ |
+
+
+target |
+target specifies the target value for the given metric |
+true |
+v2beta2.MetricTarget |
+ |
+
+
+
+
+
+
+
v2beta2.CrossVersionObjectReference
+
+
CrossVersionObjectReference contains enough information to let you identify the referred resource.
+
+
+
+
+
+
v1.StatusCause
+
+
StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+reason |
+A machine-readable description of the cause of the error. If this value is empty there is no information available. |
+false |
+string |
+ |
+
+
+message |
+A human-readable description of the cause of the error. This field may be presented as-is to a reader. |
+false |
+string |
+ |
+
+
+field |
+The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
+
+Examples:
+ "name" - the field "name" on the current resource
+ "items[0].name" - the field "name" on the first array entry in "items" |
+false |
+string |
+ |
+
+
+
+
+
+
+
v2beta2.HorizontalPodAutoscalerStatus
+
+
HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+observedGeneration |
+observedGeneration is the most recent generation observed by this autoscaler. |
+false |
+integer (int64) |
+ |
+
+
+lastScaleTime |
+lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed. |
+false |
+string |
+ |
+
+
+currentReplicas |
+currentReplicas is current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler. |
+true |
+integer (int32) |
+ |
+
+
+desiredReplicas |
+desiredReplicas is the desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler. |
+true |
+integer (int32) |
+ |
+
+
+currentMetrics |
+currentMetrics is the last read state of the metrics used by this autoscaler. |
+true |
+v2beta2.MetricStatus array |
+ |
+
+
+conditions |
+conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met. |
+true |
+v2beta2.HorizontalPodAutoscalerCondition array |
+ |
+
+
+
+
+
+
+
v2beta2.PodsMetricSource
+
+
PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+metric |
+metric identifies the target metric by name and selector |
+true |
+v2beta2.MetricIdentifier |
+ |
+
+
+target |
+target specifies the target value for the given metric |
+true |
+v2beta2.MetricTarget |
+ |
+
+
+
+
+
+
+
any
+
+
Represents an untyped JSON map - see the description of the field for more info about the structure of this object.
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/api-reference/autoscaling/v2beta2/operations.html b/docs/api-reference/autoscaling/v2beta2/operations.html
new file mode 100755
index 00000000000..fb07c5e0fd2
--- /dev/null
+++ b/docs/api-reference/autoscaling/v2beta2/operations.html
@@ -0,0 +1,2609 @@
+
+
+
+
+
+
+Operations
+
+
+
+
+
+
+
Operations
+
+
+
get available resources
+
+
+
GET /apis/autoscaling/v2beta2
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+default |
+success |
+v1.APIResourceList |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
list or watch objects of kind HorizontalPodAutoscaler
+
+
+
GET /apis/autoscaling/v2beta2/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
list or watch objects of kind HorizontalPodAutoscaler
+
+
+
GET /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
delete collection of HorizontalPodAutoscaler
+
+
+
DELETE /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.Status |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
create a HorizontalPodAutoscaler
+
+
+
POST /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v2beta2.HorizontalPodAutoscaler |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
read the specified HorizontalPodAutoscaler
+
+
+
GET /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+export |
+Should this value be exported. Export strips fields that a user can not specify. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+exact |
+Should the export be exact. Exact export maintains cluster-specific fields like Namespace. |
+false |
+boolean |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
replace the specified HorizontalPodAutoscaler
+
+
+
PUT /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v2beta2.HorizontalPodAutoscaler |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
delete a HorizontalPodAutoscaler
+
+
+
DELETE /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.DeleteOptions |
+ |
+
+
+QueryParameter |
+gracePeriodSeconds |
+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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+orphanDependents |
+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. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+propagationPolicy |
+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. |
+false |
+string |
+ |
+
+
+QueryParameter |
+dryRun |
+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 |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+202 |
+Accepted |
+v1.Status |
+
+
+200 |
+success |
+v1.Status |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
partially update the specified HorizontalPodAutoscaler
+
+
+
PATCH /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.Patch |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
Consumes
+
+
+-
+
application/json-patch+json
+
+-
+
application/merge-patch+json
+
+-
+
application/strategic-merge-patch+json
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
read status of the specified HorizontalPodAutoscaler
+
+
+
GET /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
replace status of the specified HorizontalPodAutoscaler
+
+
+
PUT /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v2beta2.HorizontalPodAutoscaler |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
partially update status of the specified HorizontalPodAutoscaler
+
+
+
PATCH /apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.Patch |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
+
Consumes
+
+
+-
+
application/json-patch+json
+
+-
+
application/merge-patch+json
+
+-
+
application/strategic-merge-patch+json
+
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the watch parameter with a list operation instead.
+
+
+
GET /apis/autoscaling/v2beta2/watch/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.WatchEvent |
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
watch individual changes to a list of HorizontalPodAutoscaler. deprecated: use the watch parameter with a list operation instead.
+
+
+
GET /apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.WatchEvent |
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
watch changes to an object of kind HorizontalPodAutoscaler. deprecated: use the watch parameter with a list operation instead, filtered to a single item with the fieldSelector parameter.
+
+
+
GET /apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+limit |
+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.
+ The 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. |
+false |
+integer (int32) |
+ |
+
+
+QueryParameter |
+continue |
+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 indicating the client must restart their list without the continue field. This 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. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the HorizontalPodAutoscaler |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.WatchEvent |
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisautoscalingv2beta2
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hack/.golint_failures b/hack/.golint_failures
index 46426eb91a5..6eaa15a435d 100644
--- a/hack/.golint_failures
+++ b/hack/.golint_failures
@@ -46,6 +46,7 @@ pkg/apis/authorization/validation
pkg/apis/autoscaling
pkg/apis/autoscaling/v1
pkg/apis/autoscaling/v2beta1
+pkg/apis/autoscaling/v2beta2
pkg/apis/autoscaling/validation
pkg/apis/batch
pkg/apis/batch/v1
@@ -461,6 +462,7 @@ staging/src/k8s.io/api/authorization/v1
staging/src/k8s.io/api/authorization/v1beta1
staging/src/k8s.io/api/autoscaling/v1
staging/src/k8s.io/api/autoscaling/v2beta1
+staging/src/k8s.io/api/autoscaling/v2beta2
staging/src/k8s.io/api/batch/v1
staging/src/k8s.io/api/batch/v1beta1
staging/src/k8s.io/api/batch/v2alpha1
@@ -705,6 +707,7 @@ staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd
staging/src/k8s.io/metrics/pkg/apis/custom_metrics
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1
+staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2
staging/src/k8s.io/metrics/pkg/apis/external_metrics
staging/src/k8s.io/metrics/pkg/apis/external_metrics/v1beta1
staging/src/k8s.io/metrics/pkg/apis/metrics
@@ -712,6 +715,7 @@ staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1
staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1
staging/src/k8s.io/metrics/pkg/client/custom_metrics
staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake
+staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme
staging/src/k8s.io/metrics/pkg/client/external_metrics
staging/src/k8s.io/metrics/pkg/client/external_metrics/fake
staging/src/k8s.io/sample-apiserver/pkg/admission/plugin/banflunder
diff --git a/hack/lib/init.sh b/hack/lib/init.sh
index e97b34fe8db..a9ef8415f41 100755
--- a/hack/lib/init.sh
+++ b/hack/lib/init.sh
@@ -68,6 +68,7 @@ authorization.k8s.io/v1 \
authorization.k8s.io/v1beta1 \
autoscaling/v1 \
autoscaling/v2beta1 \
+autoscaling/v2beta2 \
batch/v1 \
batch/v1beta1 \
batch/v2alpha1 \
diff --git a/hack/update-generated-protobuf-dockerized.sh b/hack/update-generated-protobuf-dockerized.sh
index 6acbb386d5f..798f832fc81 100755
--- a/hack/update-generated-protobuf-dockerized.sh
+++ b/hack/update-generated-protobuf-dockerized.sh
@@ -52,6 +52,7 @@ PACKAGES=(
k8s.io/api/autoscaling/v1
k8s.io/api/authorization/v1
k8s.io/api/autoscaling/v2beta1
+ k8s.io/api/autoscaling/v2beta2
k8s.io/api/authorization/v1beta1
k8s.io/api/batch/v1
k8s.io/api/batch/v1beta1
@@ -81,6 +82,7 @@ PACKAGES=(
k8s.io/metrics/pkg/apis/metrics/v1alpha1
k8s.io/metrics/pkg/apis/metrics/v1beta1
k8s.io/metrics/pkg/apis/custom_metrics/v1beta1
+ k8s.io/metrics/pkg/apis/custom_metrics/v1beta2
k8s.io/metrics/pkg/apis/external_metrics/v1beta1
k8s.io/apiserver/pkg/apis/audit/v1alpha1
k8s.io/apiserver/pkg/apis/audit/v1beta1
diff --git a/pkg/apis/autoscaling/BUILD b/pkg/apis/autoscaling/BUILD
index ad9b54b402f..5fed7730d8a 100644
--- a/pkg/apis/autoscaling/BUILD
+++ b/pkg/apis/autoscaling/BUILD
@@ -39,6 +39,7 @@ filegroup(
"//pkg/apis/autoscaling/install:all-srcs",
"//pkg/apis/autoscaling/v1:all-srcs",
"//pkg/apis/autoscaling/v2beta1:all-srcs",
+ "//pkg/apis/autoscaling/v2beta2:all-srcs",
"//pkg/apis/autoscaling/validation:all-srcs",
],
tags = ["automanaged"],
diff --git a/pkg/apis/autoscaling/fuzzer/fuzzer.go b/pkg/apis/autoscaling/fuzzer/fuzzer.go
index 2c1ea0608ca..8322057d288 100644
--- a/pkg/apis/autoscaling/fuzzer/fuzzer.go
+++ b/pkg/apis/autoscaling/fuzzer/fuzzer.go
@@ -52,19 +52,28 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
}
targetUtilization := int32(c.RandUint64())
+ averageValue := randomQuantity()
s.Metrics = []autoscaling.MetricSpec{
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: c.RandString(),
- TargetAverageValue: randomQuantity(),
+ Metric: autoscaling.MetricIdentifier{
+ Name: c.RandString(),
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: &averageValue,
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilization,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilization,
+ },
},
},
}
@@ -78,20 +87,28 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
_ = q.String()
return q
}
+ averageValue := randomQuantity()
currentUtilization := int32(c.RandUint64())
s.CurrentMetrics = []autoscaling.MetricStatus{
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricStatus{
- MetricName: c.RandString(),
- CurrentAverageValue: randomQuantity(),
+ Metric: autoscaling.MetricIdentifier{
+ Name: c.RandString(),
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: &averageValue,
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
Name: api.ResourceCPU,
- CurrentAverageUtilization: ¤tUtilization,
+ Current: autoscaling.MetricValueStatus{
+ AverageUtilization: ¤tUtilization,
+ AverageValue: &averageValue,
+ },
},
},
}
diff --git a/pkg/apis/autoscaling/install/BUILD b/pkg/apis/autoscaling/install/BUILD
index 74b65a14697..31b1a56184f 100644
--- a/pkg/apis/autoscaling/install/BUILD
+++ b/pkg/apis/autoscaling/install/BUILD
@@ -1,19 +1,16 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["install.go"],
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/install",
+ visibility = ["//visibility:public"],
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/autoscaling/v1:go_default_library",
"//pkg/apis/autoscaling/v2beta1:go_default_library",
+ "//pkg/apis/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
],
@@ -30,4 +27,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/pkg/apis/autoscaling/install/install.go b/pkg/apis/autoscaling/install/install.go
index 62236a0c779..b2c52ed7cc0 100644
--- a/pkg/apis/autoscaling/install/install.go
+++ b/pkg/apis/autoscaling/install/install.go
@@ -25,6 +25,7 @@ import (
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/autoscaling/v1"
"k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1"
+ "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2"
)
func init() {
@@ -34,7 +35,8 @@ func init() {
// Install registers the API group and adds types to a scheme
func Install(scheme *runtime.Scheme) {
utilruntime.Must(autoscaling.AddToScheme(scheme))
+ utilruntime.Must(v2beta2.AddToScheme(scheme))
utilruntime.Must(v2beta1.AddToScheme(scheme))
utilruntime.Must(v1.AddToScheme(scheme))
- utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion, v2beta1.SchemeGroupVersion))
+ utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion, v2beta1.SchemeGroupVersion, v2beta2.SchemeGroupVersion))
}
diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go
index 5489742db90..4ab6f8aff55 100644
--- a/pkg/apis/autoscaling/types.go
+++ b/pkg/apis/autoscaling/types.go
@@ -154,13 +154,9 @@ type MetricSpec struct {
// ObjectMetricSource indicates how to scale on a metric describing a
// kubernetes object (for example, hits-per-second on an Ingress object).
type ObjectMetricSource struct {
- // Target is the described Kubernetes object.
- Target CrossVersionObjectReference
-
- // MetricName is the name of the metric in question.
- MetricName string
- // TargetValue is the target value of the metric (as a quantity).
- TargetValue resource.Quantity
+ DescribedObject CrossVersionObjectReference
+ Target MetricTarget
+ Metric MetricIdentifier
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -168,11 +164,10 @@ type ObjectMetricSource struct {
// The values will be averaged together before being compared to the target
// value.
type PodsMetricSource struct {
- // MetricName is the name of the metric in question
- MetricName string
- // TargetAverageValue is the target value of the average of the
- // metric across all relevant pods (as a quantity)
- TargetAverageValue resource.Quantity
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier
+ // target specifies the target value for the given metric
+ Target MetricTarget
}
// ResourceMetricSource indicates how to scale on a resource metric known to
@@ -185,38 +180,57 @@ type PodsMetricSource struct {
type ResourceMetricSource struct {
// Name is the name of the resource in question.
Name api.ResourceName
- // TargetAverageUtilization is the target value of the average of the
- // resource metric across all relevant pods, represented as a percentage of
- // the requested value of the resource for the pods.
- // +optional
- TargetAverageUtilization *int32
- // TargetAverageValue is the target value of the average of the
- // resource metric across all relevant pods, as a raw value (instead of as
- // a percentage of the request), similar to the "pods" metric source type.
- // +optional
- TargetAverageValue *resource.Quantity
+ // Target specifies the target value for the given metric
+ Target MetricTarget
}
// ExternalMetricSource indicates how to scale on a metric not associated with
// any Kubernetes object (for example length of queue in cloud
// messaging service, or QPS from loadbalancer running outside of cluster).
type ExternalMetricSource struct {
- // metricName is the name of the metric in question.
- MetricName string
- // MetricSelector is used to identify a specific time series
- // within a given metric.
- // +optional
- MetricSelector *metav1.LabelSelector
- // TargetValue is the target value of the metric (as a quantity).
- // Mutually exclusive with TargetAverageValue.
- // +optional
- TargetValue *resource.Quantity
- // TargetAverageValue is the target per-pod value of global metric (as a quantity).
- // Mutually exclusive with TargetValue.
- // +optional
- TargetAverageValue *resource.Quantity
+ // Metric identifies the target metric by name and selector
+ Metric MetricIdentifier
+ // Target specifies the target value for the given metric
+ Target MetricTarget
}
+// MetricIdentifier defines the name and optionally selector for a metric
+type MetricIdentifier struct {
+ // Name is the name of the given metric
+ Name string
+ // Selector is the selector for the given metric
+ // it is the string-encoded form of a standard kubernetes label selector
+ // +optional
+ Selector *metav1.LabelSelector
+}
+
+// MetricTarget defines the target value, average value, or average utilization of a specific metric
+type MetricTarget struct {
+ // Type represents whether the metric type is Utilization, Value, or AverageValue
+ Type MetricTargetType
+ // Value is the target value of the metric (as a quantity).
+ Value *resource.Quantity
+ // TargetAverageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ AverageValue *resource.Quantity
+
+ // AverageUtilization is the target value of the average of the
+ // resource metric across all relevant pods, represented as a percentage of
+ // the requested value of the resource for the pods.
+ // Currently only valid for Resource metric source type
+ AverageUtilization *int32
+}
+
+// MetricTargetType specifies the type of metric being targeted, and should be either
+// "Value", "AverageValue", or "Utilization"
+type MetricTargetType string
+
+var (
+ UtilizationMetricType MetricTargetType = "Utilization"
+ ValueMetricType MetricTargetType = "Value"
+ AverageValueMetricType MetricTargetType = "AverageValue"
+)
+
// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
type HorizontalPodAutoscalerStatus struct {
// ObservedGeneration is the most recent generation observed by this autoscaler.
@@ -237,6 +251,7 @@ type HorizontalPodAutoscalerStatus struct {
DesiredReplicas int32
// CurrentMetrics is the last read state of the metrics used by this autoscaler.
+ // +optional
CurrentMetrics []MetricStatus
// Conditions is the set of conditions required for this autoscaler to scale its target,
@@ -327,23 +342,17 @@ type MetricStatus struct {
// ObjectMetricStatus indicates the current value of a metric describing a
// kubernetes object (for example, hits-per-second on an Ingress object).
type ObjectMetricStatus struct {
- // Target is the described Kubernetes object.
- Target CrossVersionObjectReference
+ Metric MetricIdentifier
+ Current MetricValueStatus
- // MetricName is the name of the metric in question.
- MetricName string
- // CurrentValue is the current value of the metric (as a quantity).
- CurrentValue resource.Quantity
+ DescribedObject CrossVersionObjectReference
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
// the current scale target (for example, transactions-processed-per-second).
type PodsMetricStatus struct {
- // MetricName is the name of the metric in question
- MetricName string
- // CurrentAverageValue is the current value of the average of the
- // metric across all relevant pods (as a quantity)
- CurrentAverageValue resource.Quantity
+ Metric MetricIdentifier
+ Current MetricValueStatus
}
// ResourceMetricStatus indicates the current value of a resource metric known to
@@ -353,36 +362,21 @@ type PodsMetricStatus struct {
// normal per-pod metrics using the "pods" source.
type ResourceMetricStatus struct {
// Name is the name of the resource in question.
- Name api.ResourceName
- // CurrentAverageUtilization is the current value of the average of the
- // resource metric across all relevant pods, represented as a percentage of
- // the requested value of the resource for the pods. It will only be
- // present if `targetAverageValue` was set in the corresponding metric
- // specification.
- // +optional
- CurrentAverageUtilization *int32
- // CurrentAverageValue is the current value of the average of the
- // resource metric across all relevant pods, as a raw value (instead of as
- // a percentage of the request), similar to the "pods" metric source type.
- // It will always be set, regardless of the corresponding metric specification.
- CurrentAverageValue resource.Quantity
+ Name api.ResourceName
+ Current MetricValueStatus
}
// ExternalMetricStatus indicates the current value of a global metric
// not associated with any Kubernetes object.
type ExternalMetricStatus struct {
- // MetricName is the name of a metric used for autoscaling in
- // metric system.
- MetricName string
- // MetricSelector is used to identify a specific time series
- // within a given metric.
- // +optional
- MetricSelector *metav1.LabelSelector
- // CurrentValue is the current value of the metric (as a quantity)
- CurrentValue resource.Quantity
- // CurrentAverageValue is the current value of metric averaged over autoscaled pods.
- // +optional
- CurrentAverageValue *resource.Quantity
+ Metric MetricIdentifier
+ Current MetricValueStatus
+}
+
+type MetricValueStatus struct {
+ Value *resource.Quantity
+ AverageValue *resource.Quantity
+ AverageUtilization *int32
}
// +genclient
diff --git a/pkg/apis/autoscaling/v1/BUILD b/pkg/apis/autoscaling/v1/BUILD
index bfd9fb1087b..0360cbfa5f5 100644
--- a/pkg/apis/autoscaling/v1/BUILD
+++ b/pkg/apis/autoscaling/v1/BUILD
@@ -1,10 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
- "go_test",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
@@ -17,12 +11,12 @@ go_library(
"zz_generated.defaults.go",
],
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v1",
+ visibility = ["//visibility:public"],
deps = [
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//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/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -55,4 +49,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/pkg/apis/autoscaling/v1/conversion.go b/pkg/apis/autoscaling/v1/conversion.go
index 599fa7622d5..1fb3c343cb7 100644
--- a/pkg/apis/autoscaling/v1/conversion.go
+++ b/pkg/apis/autoscaling/v1/conversion.go
@@ -21,10 +21,12 @@ import (
autoscalingv1 "k8s.io/api/autoscaling/v1"
+ v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/apis/autoscaling"
api "k8s.io/kubernetes/pkg/apis/core"
+ core "k8s.io/kubernetes/pkg/apis/core"
)
func addConversionFuncs(scheme *runtime.Scheme) error {
@@ -36,6 +38,22 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,
Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus,
+ Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource,
+ Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
+ Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource,
+ Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
+ Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource,
+ Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource,
+ Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus,
+ Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
+ Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus,
+ Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
+ Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus,
+ Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
+ Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference,
+ Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget,
+ Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus,
+ Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
)
if err != nil {
return err
@@ -44,6 +62,234 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
return nil
}
+func Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(in *autoscaling.MetricTarget, out *autoscalingv1.CrossVersionObjectReference, s conversion.Scope) error {
+ return nil
+}
+
+func Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(in *autoscalingv1.CrossVersionObjectReference, out *autoscaling.MetricTarget, s conversion.Scope) error {
+ return nil
+}
+
+func Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *autoscalingv1.ExternalMetricSource, s conversion.Scope) error {
+ out.MetricName = in.Metric.Name
+ out.TargetValue = in.Target.Value
+ out.TargetAverageValue = in.Target.AverageValue
+ out.MetricSelector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *autoscalingv1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
+ value := in.TargetValue
+ averageValue := in.TargetAverageValue
+ var metricType autoscaling.MetricTargetType
+ if value == nil {
+ metricType = autoscaling.AverageValueMetricType
+ } else {
+ metricType = autoscaling.ValueMetricType
+ }
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ Value: value,
+ AverageValue: averageValue,
+ }
+
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.MetricSelector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *autoscalingv1.ObjectMetricSource, s conversion.Scope) error {
+ if in.Target.Value != nil {
+ out.TargetValue = *in.Target.Value
+ }
+ out.AverageValue = in.Target.AverageValue
+ out.Target = autoscalingv1.CrossVersionObjectReference{
+ Kind: in.DescribedObject.Kind,
+ Name: in.DescribedObject.Name,
+ APIVersion: in.DescribedObject.APIVersion,
+ }
+ out.MetricName = in.Metric.Name
+ return nil
+}
+
+func Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *autoscalingv1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
+ var metricType autoscaling.MetricTargetType
+ if in.AverageValue == nil {
+ metricType = autoscaling.ValueMetricType
+ } else {
+ metricType = autoscaling.AverageValueMetricType
+ }
+
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ Value: &in.TargetValue,
+ AverageValue: in.AverageValue,
+ }
+ out.DescribedObject = autoscaling.CrossVersionObjectReference{
+ Kind: in.Target.Kind,
+ Name: in.Target.Name,
+ APIVersion: in.Target.APIVersion,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *autoscalingv1.PodsMetricSource, s conversion.Scope) error {
+ if in.Target.AverageValue != nil {
+ out.TargetAverageValue = *in.Target.AverageValue
+ }
+
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *autoscalingv1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
+ var metricType autoscaling.MetricTargetType
+ metricType = autoscaling.AverageValueMetricType
+
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ AverageValue: &in.TargetAverageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *autoscalingv1.ExternalMetricStatus, s conversion.Scope) error {
+ out.MetricName = in.Metric.Name
+ if in.Current.Value != nil {
+ out.CurrentValue = *in.Current.Value
+ }
+ if in.Current.AverageValue != nil {
+ out.CurrentAverageValue = in.Current.AverageValue
+ }
+ out.MetricSelector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *autoscalingv1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
+ value := in.CurrentValue
+ averageValue := in.CurrentAverageValue
+ out.Current = autoscaling.MetricValueStatus{
+ Value: &value,
+ AverageValue: averageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.MetricSelector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *autoscalingv1.ObjectMetricStatus, s conversion.Scope) error {
+ if in.Current.Value != nil {
+ out.CurrentValue = *in.Current.Value
+ }
+ if in.Current.AverageValue != nil {
+ currentAverageValue := *in.Current.AverageValue
+ out.AverageValue = ¤tAverageValue
+ }
+ out.Target = autoscalingv1.CrossVersionObjectReference{
+ Kind: in.DescribedObject.Kind,
+ Name: in.DescribedObject.Name,
+ APIVersion: in.DescribedObject.APIVersion,
+ }
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *autoscalingv1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
+ out.Current = autoscaling.MetricValueStatus{
+ Value: &in.CurrentValue,
+ AverageValue: in.AverageValue,
+ }
+ out.DescribedObject = autoscaling.CrossVersionObjectReference{
+ Kind: in.Target.Kind,
+ Name: in.Target.Name,
+ APIVersion: in.Target.APIVersion,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *autoscalingv1.PodsMetricStatus, s conversion.Scope) error {
+ if in.Current.AverageValue != nil {
+ out.CurrentAverageValue = *in.Current.AverageValue
+ }
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *autoscalingv1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
+ out.Current = autoscaling.MetricValueStatus{
+ AverageValue: &in.CurrentAverageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *autoscalingv1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
+ out.Name = core.ResourceName(in.Name)
+ utilization := in.TargetAverageUtilization
+ averageValue := in.TargetAverageValue
+ var metricType autoscaling.MetricTargetType
+ if utilization == nil {
+ metricType = autoscaling.AverageValueMetricType
+ } else {
+ metricType = autoscaling.UtilizationMetricType
+ }
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ AverageValue: averageValue,
+ AverageUtilization: utilization,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *autoscalingv1.ResourceMetricSource, s conversion.Scope) error {
+ out.Name = v1.ResourceName(in.Name)
+ out.TargetAverageUtilization = in.Target.AverageUtilization
+ out.TargetAverageValue = in.Target.AverageValue
+ return nil
+}
+
+func Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *autoscalingv1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
+ out.Name = core.ResourceName(in.Name)
+ utilization := in.CurrentAverageUtilization
+ averageValue := &in.CurrentAverageValue
+ out.Current = autoscaling.MetricValueStatus{
+ AverageValue: averageValue,
+ AverageUtilization: utilization,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *autoscalingv1.ResourceMetricStatus, s conversion.Scope) error {
+ out.Name = v1.ResourceName(in.Name)
+ out.CurrentAverageUtilization = in.Current.AverageUtilization
+ if in.Current.AverageValue != nil {
+ out.CurrentAverageValue = *in.Current.AverageValue
+ }
+ return nil
+}
+
func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *autoscalingv1.HorizontalPodAutoscaler, s conversion.Scope) error {
if err := autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in, out, s); err != nil {
return err
@@ -51,7 +297,7 @@ func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(i
otherMetrics := make([]autoscalingv1.MetricSpec, 0, len(in.Spec.Metrics))
for _, metric := range in.Spec.Metrics {
- if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU && metric.Resource.TargetAverageUtilization != nil {
+ if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU && metric.Resource.Target.AverageUtilization != nil {
continue
}
@@ -165,11 +411,14 @@ func Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(i
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ },
},
},
}
- out.Spec.Metrics[0].Resource.TargetAverageUtilization = new(int32)
- *out.Spec.Metrics[0].Resource.TargetAverageUtilization = autoscaling.DefaultCPUUtilization
+ out.Spec.Metrics[0].Resource.Target.AverageUtilization = new(int32)
+ *out.Spec.Metrics[0].Resource.Target.AverageUtilization = autoscaling.DefaultCPUUtilization
}
if currentConditionsEnc, hasCurrentConditions := out.Annotations[autoscaling.HorizontalPodAutoscalerConditionsAnnotation]; hasCurrentConditions {
@@ -200,9 +449,9 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscal
for _, metric := range in.Metrics {
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU {
- if metric.Resource.TargetAverageUtilization != nil {
+ if metric.Resource.Target.AverageUtilization != nil {
out.TargetCPUUtilizationPercentage = new(int32)
- *out.TargetCPUUtilizationPercentage = *metric.Resource.TargetAverageUtilization
+ *out.TargetCPUUtilizationPercentage = *metric.Resource.Target.AverageUtilization
}
break
}
@@ -225,11 +474,14 @@ func Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscal
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ },
},
},
}
- out.Metrics[0].Resource.TargetAverageUtilization = new(int32)
- *out.Metrics[0].Resource.TargetAverageUtilization = *in.TargetCPUUtilizationPercentage
+ out.Metrics[0].Resource.Target.AverageUtilization = new(int32)
+ *out.Metrics[0].Resource.Target.AverageUtilization = *in.TargetCPUUtilizationPercentage
}
return nil
@@ -244,10 +496,10 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutosc
for _, metric := range in.CurrentMetrics {
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU {
- if metric.Resource.CurrentAverageUtilization != nil {
+ if metric.Resource.Current.AverageUtilization != nil {
out.CurrentCPUUtilizationPercentage = new(int32)
- *out.CurrentCPUUtilizationPercentage = *metric.Resource.CurrentAverageUtilization
+ *out.CurrentCPUUtilizationPercentage = *metric.Resource.Current.AverageUtilization
}
}
}
@@ -270,8 +522,8 @@ func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutosc
},
},
}
- out.CurrentMetrics[0].Resource.CurrentAverageUtilization = new(int32)
- *out.CurrentMetrics[0].Resource.CurrentAverageUtilization = *in.CurrentCPUUtilizationPercentage
+ out.CurrentMetrics[0].Resource.Current.AverageUtilization = new(int32)
+ *out.CurrentMetrics[0].Resource.Current.AverageUtilization = *in.CurrentCPUUtilizationPercentage
}
return nil
}
diff --git a/pkg/apis/autoscaling/v1/zz_generated.conversion.go b/pkg/apis/autoscaling/v1/zz_generated.conversion.go
index 9109ca51b54..93dfa7b7dac 100644
--- a/pkg/apis/autoscaling/v1/zz_generated.conversion.go
+++ b/pkg/apis/autoscaling/v1/zz_generated.conversion.go
@@ -25,7 +25,6 @@ import (
v1 "k8s.io/api/autoscaling/v1"
corev1 "k8s.io/api/core/v1"
- resource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
@@ -230,6 +229,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v1.ExternalMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v1.ExternalMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddConversionFunc((*autoscaling.HorizontalPodAutoscalerSpec)(nil), (*v1.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(a.(*autoscaling.HorizontalPodAutoscalerSpec), b.(*v1.HorizontalPodAutoscalerSpec), scope)
}); err != nil {
@@ -245,6 +254,56 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddConversionFunc((*autoscaling.MetricTarget)(nil), (*v1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(a.(*autoscaling.MetricTarget), b.(*v1.CrossVersionObjectReference), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v1.ObjectMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v1.ObjectMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v1.PodsMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v1.PodsMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v1.ResourceMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v1.ResourceMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.CrossVersionObjectReference)(nil), (*autoscaling.MetricTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(a.(*v1.CrossVersionObjectReference), b.(*autoscaling.MetricTarget), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddConversionFunc((*v1.HorizontalPodAutoscalerSpec)(nil), (*autoscaling.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(a.(*v1.HorizontalPodAutoscalerSpec), b.(*autoscaling.HorizontalPodAutoscalerSpec), scope)
}); err != nil {
@@ -260,6 +319,36 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddConversionFunc((*v1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
return nil
}
@@ -288,57 +377,33 @@ func Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectRef
}
func autoConvert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource is an autogenerated conversion function.
-func Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
- return autoConvert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v1.ExternalMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v1.ExternalMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in, out, s)
-}
-
func autoConvert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.CurrentValue = in.CurrentValue
- out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus is an autogenerated conversion function.
-func Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
- return autoConvert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v1.ExternalMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.CurrentValue = in.CurrentValue
- out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v1.ExternalMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in, out, s)
-}
-
func autoConvert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *v1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
@@ -472,10 +537,42 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAu
func autoConvert_v1_MetricSpec_To_autoscaling_MetricSpec(in *v1.MetricSpec, out *autoscaling.MetricSpec, s conversion.Scope) error {
out.Type = autoscaling.MetricSourceType(in.Type)
- out.Object = (*autoscaling.ObjectMetricSource)(unsafe.Pointer(in.Object))
- out.Pods = (*autoscaling.PodsMetricSource)(unsafe.Pointer(in.Pods))
- out.Resource = (*autoscaling.ResourceMetricSource)(unsafe.Pointer(in.Resource))
- out.External = (*autoscaling.ExternalMetricSource)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(autoscaling.ObjectMetricSource)
+ if err := Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(autoscaling.PodsMetricSource)
+ if err := Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(autoscaling.ResourceMetricSource)
+ if err := Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(autoscaling.ExternalMetricSource)
+ if err := Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -486,10 +583,42 @@ func Convert_v1_MetricSpec_To_autoscaling_MetricSpec(in *v1.MetricSpec, out *aut
func autoConvert_autoscaling_MetricSpec_To_v1_MetricSpec(in *autoscaling.MetricSpec, out *v1.MetricSpec, s conversion.Scope) error {
out.Type = v1.MetricSourceType(in.Type)
- out.Object = (*v1.ObjectMetricSource)(unsafe.Pointer(in.Object))
- out.Pods = (*v1.PodsMetricSource)(unsafe.Pointer(in.Pods))
- out.Resource = (*v1.ResourceMetricSource)(unsafe.Pointer(in.Resource))
- out.External = (*v1.ExternalMetricSource)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(v1.ObjectMetricSource)
+ if err := Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(v1.PodsMetricSource)
+ if err := Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(v1.ResourceMetricSource)
+ if err := Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(v1.ExternalMetricSource)
+ if err := Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -500,10 +629,42 @@ func Convert_autoscaling_MetricSpec_To_v1_MetricSpec(in *autoscaling.MetricSpec,
func autoConvert_v1_MetricStatus_To_autoscaling_MetricStatus(in *v1.MetricStatus, out *autoscaling.MetricStatus, s conversion.Scope) error {
out.Type = autoscaling.MetricSourceType(in.Type)
- out.Object = (*autoscaling.ObjectMetricStatus)(unsafe.Pointer(in.Object))
- out.Pods = (*autoscaling.PodsMetricStatus)(unsafe.Pointer(in.Pods))
- out.Resource = (*autoscaling.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
- out.External = (*autoscaling.ExternalMetricStatus)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(autoscaling.ObjectMetricStatus)
+ if err := Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(autoscaling.PodsMetricStatus)
+ if err := Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(autoscaling.ResourceMetricStatus)
+ if err := Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(autoscaling.ExternalMetricStatus)
+ if err := Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -514,10 +675,42 @@ func Convert_v1_MetricStatus_To_autoscaling_MetricStatus(in *v1.MetricStatus, ou
func autoConvert_autoscaling_MetricStatus_To_v1_MetricStatus(in *autoscaling.MetricStatus, out *v1.MetricStatus, s conversion.Scope) error {
out.Type = v1.MetricSourceType(in.Type)
- out.Object = (*v1.ObjectMetricStatus)(unsafe.Pointer(in.Object))
- out.Pods = (*v1.PodsMetricStatus)(unsafe.Pointer(in.Pods))
- out.Resource = (*v1.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
- out.External = (*v1.ExternalMetricStatus)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(v1.ObjectMetricStatus)
+ if err := Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(v1.PodsMetricStatus)
+ if err := Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(v1.ResourceMetricStatus)
+ if err := Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(v1.ExternalMetricStatus)
+ if err := Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -527,153 +720,93 @@ func Convert_autoscaling_MetricStatus_To_v1_MetricStatus(in *autoscaling.MetricS
}
func autoConvert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
- if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
+ if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(&in.Target, &out.Target, s); err != nil {
return err
}
- out.MetricName = in.MetricName
- out.TargetValue = in.TargetValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
+ // WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource is an autogenerated conversion function.
-func Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
- return autoConvert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v1.ObjectMetricSource, s conversion.Scope) error {
- if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
+ // WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
+ if err := Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
return err
}
- out.MetricName = in.MetricName
- out.TargetValue = in.TargetValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v1.ObjectMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in, out, s)
-}
-
func autoConvert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
- if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
- return err
- }
- out.MetricName = in.MetricName
- out.CurrentValue = in.CurrentValue
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
+ // WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus is an autogenerated conversion function.
-func Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
- return autoConvert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v1.ObjectMetricStatus, s conversion.Scope) error {
- if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
- return err
- }
- out.MetricName = in.MetricName
- out.CurrentValue = in.CurrentValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
+ // WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v1.ObjectMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in, out, s)
-}
-
func autoConvert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.TargetAverageValue = in.TargetAverageValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource is an autogenerated conversion function.
-func Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
- return autoConvert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v1.PodsMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.TargetAverageValue = in.TargetAverageValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v1.PodsMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in, out, s)
-}
-
func autoConvert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus is an autogenerated conversion function.
-func Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
- return autoConvert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v1.PodsMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v1.PodsMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in, out, s)
-}
-
func autoConvert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
out.Name = core.ResourceName(in.Name)
- out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.TargetAverageUtilization requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource is an autogenerated conversion function.
-func Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
- return autoConvert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v1.ResourceMetricSource, s conversion.Scope) error {
out.Name = corev1.ResourceName(in.Name)
- out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v1.ResourceMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in, out, s)
-}
-
func autoConvert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
out.Name = core.ResourceName(in.Name)
- out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.CurrentAverageUtilization requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus is an autogenerated conversion function.
-func Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
- return autoConvert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v1.ResourceMetricStatus, s conversion.Scope) error {
out.Name = corev1.ResourceName(in.Name)
- out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v1.ResourceMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in, out, s)
-}
-
func autoConvert_v1_Scale_To_autoscaling_Scale(in *v1.Scale, out *autoscaling.Scale, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
diff --git a/pkg/apis/autoscaling/v2beta1/BUILD b/pkg/apis/autoscaling/v2beta1/BUILD
index c7c346918ed..47d21ddb94e 100644
--- a/pkg/apis/autoscaling/v2beta1/BUILD
+++ b/pkg/apis/autoscaling/v2beta1/BUILD
@@ -1,14 +1,9 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
- "go_test",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
+ "conversion.go",
"defaults.go",
"doc.go",
"register.go",
@@ -16,12 +11,12 @@ go_library(
"zz_generated.defaults.go",
],
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1",
+ visibility = ["//visibility:public"],
deps = [
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
"//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/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -29,19 +24,6 @@ go_library(
],
)
-filegroup(
- name = "package-srcs",
- srcs = glob(["**"]),
- tags = ["automanaged"],
- visibility = ["//visibility:private"],
-)
-
-filegroup(
- name = "all-srcs",
- srcs = [":package-srcs"],
- tags = ["automanaged"],
-)
-
go_test(
name = "go_default_test",
srcs = ["defaults_test.go"],
@@ -58,3 +40,17 @@ go_test(
"//vendor/k8s.io/utils/pointer: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"],
+)
diff --git a/pkg/apis/autoscaling/v2beta1/conversion.go b/pkg/apis/autoscaling/v2beta1/conversion.go
new file mode 100644
index 00000000000..289aab878d8
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta1/conversion.go
@@ -0,0 +1,410 @@
+/*
+Copyright 2018 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 v2beta1
+
+import (
+ "encoding/json"
+
+ autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
+
+ v1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/conversion"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/kubernetes/pkg/apis/autoscaling"
+ core "k8s.io/kubernetes/pkg/apis/core"
+)
+
+func addConversionFuncs(scheme *runtime.Scheme) error {
+ // Add non-generated conversion functions
+ err := scheme.AddConversionFuncs(
+ Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource,
+ Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
+ Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource,
+ Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
+ Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource,
+ Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource,
+ Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus,
+ Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
+ Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus,
+ Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
+ Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus,
+ Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
+ Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource,
+ Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource,
+ Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference,
+ Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget,
+ Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus,
+ Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
+ Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler,
+ Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler,
+ )
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(in *autoscaling.MetricTarget, out *autoscalingv2beta1.CrossVersionObjectReference, s conversion.Scope) error {
+ return nil
+}
+
+func Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(in *autoscalingv2beta1.CrossVersionObjectReference, out *autoscaling.MetricTarget, s conversion.Scope) error {
+ return nil
+}
+
+func Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *autoscalingv2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
+ out.Name = core.ResourceName(in.Name)
+ utilization := in.CurrentAverageUtilization
+ averageValue := in.CurrentAverageValue
+ out.Current = autoscaling.MetricValueStatus{
+ AverageValue: &averageValue,
+ AverageUtilization: utilization,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *autoscalingv2beta1.ResourceMetricStatus, s conversion.Scope) error {
+ out.Name = v1.ResourceName(in.Name)
+ out.CurrentAverageUtilization = in.Current.AverageUtilization
+ if in.Current.AverageValue != nil {
+ out.CurrentAverageValue = *in.Current.AverageValue
+ }
+ return nil
+}
+
+func Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *autoscalingv2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
+ out.Name = core.ResourceName(in.Name)
+ utilization := in.TargetAverageUtilization
+ averageValue := in.TargetAverageValue
+
+ var metricType autoscaling.MetricTargetType
+ if utilization == nil {
+ metricType = autoscaling.AverageValueMetricType
+ } else {
+ metricType = autoscaling.UtilizationMetricType
+ }
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ AverageValue: averageValue,
+ AverageUtilization: utilization,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *autoscalingv2beta1.ResourceMetricSource, s conversion.Scope) error {
+ out.Name = v1.ResourceName(in.Name)
+ out.TargetAverageUtilization = in.Target.AverageUtilization
+ out.TargetAverageValue = in.Target.AverageValue
+ return nil
+}
+
+func Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *autoscalingv2beta1.ExternalMetricSource, s conversion.Scope) error {
+ out.MetricName = in.Metric.Name
+ out.TargetValue = in.Target.Value
+ out.TargetAverageValue = in.Target.AverageValue
+ out.MetricSelector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *autoscalingv2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
+ value := in.TargetValue
+ averageValue := in.TargetAverageValue
+
+ var metricType autoscaling.MetricTargetType
+ if value == nil {
+ metricType = autoscaling.AverageValueMetricType
+ } else {
+ metricType = autoscaling.ValueMetricType
+ }
+
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ Value: value,
+ AverageValue: averageValue,
+ }
+
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.MetricSelector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *autoscalingv2beta1.ObjectMetricSource, s conversion.Scope) error {
+ if in.Target.Value != nil {
+ out.TargetValue = *in.Target.Value
+ }
+ out.AverageValue = in.Target.AverageValue
+
+ out.Target = autoscalingv2beta1.CrossVersionObjectReference{
+ Kind: in.DescribedObject.Kind,
+ Name: in.DescribedObject.Name,
+ APIVersion: in.DescribedObject.APIVersion,
+ }
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+
+ return nil
+}
+
+func Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *autoscalingv2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
+ var metricType autoscaling.MetricTargetType
+ if in.AverageValue == nil {
+ metricType = autoscaling.ValueMetricType
+ } else {
+ metricType = autoscaling.AverageValueMetricType
+ }
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ Value: &in.TargetValue,
+ AverageValue: in.AverageValue,
+ }
+ out.DescribedObject = autoscaling.CrossVersionObjectReference{
+ Kind: in.Target.Kind,
+ Name: in.Target.Name,
+ APIVersion: in.Target.APIVersion,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *autoscalingv2beta1.PodsMetricSource, s conversion.Scope) error {
+ targetAverageValue := *in.Target.AverageValue
+ out.TargetAverageValue = targetAverageValue
+
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+
+ return nil
+}
+
+func Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *autoscalingv2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
+ targetAverageValue := &in.TargetAverageValue
+ var metricType autoscaling.MetricTargetType
+ metricType = autoscaling.AverageValueMetricType
+
+ out.Target = autoscaling.MetricTarget{
+ Type: metricType,
+ AverageValue: targetAverageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *autoscalingv2beta1.ExternalMetricStatus, s conversion.Scope) error {
+ if &in.Current.AverageValue != nil {
+ out.CurrentAverageValue = in.Current.AverageValue
+ }
+ out.MetricName = in.Metric.Name
+ if in.Current.Value != nil {
+ out.CurrentValue = *in.Current.Value
+ }
+ out.MetricSelector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *autoscalingv2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
+ value := in.CurrentValue
+ averageValue := in.CurrentAverageValue
+ out.Current = autoscaling.MetricValueStatus{
+ Value: &value,
+ AverageValue: averageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.MetricSelector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *autoscalingv2beta1.ObjectMetricStatus, s conversion.Scope) error {
+ if in.Current.Value != nil {
+ out.CurrentValue = *in.Current.Value
+ }
+ out.Target = autoscalingv2beta1.CrossVersionObjectReference{
+ Kind: in.DescribedObject.Kind,
+ Name: in.DescribedObject.Name,
+ APIVersion: in.DescribedObject.APIVersion,
+ }
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ currentAverageValue := *in.Current.AverageValue
+ out.AverageValue = ¤tAverageValue
+ return nil
+}
+
+func Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *autoscalingv2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
+ out.Current = autoscaling.MetricValueStatus{
+ Value: &in.CurrentValue,
+ AverageValue: in.AverageValue,
+ }
+ out.DescribedObject = autoscaling.CrossVersionObjectReference{
+ Kind: in.Target.Kind,
+ Name: in.Target.Name,
+ APIVersion: in.Target.APIVersion,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *autoscalingv2beta1.PodsMetricStatus, s conversion.Scope) error {
+ if in.Current.AverageValue != nil {
+ out.CurrentAverageValue = *in.Current.AverageValue
+ }
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ return nil
+}
+
+func Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *autoscalingv2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
+ out.Current = autoscaling.MetricValueStatus{
+ AverageValue: &in.CurrentAverageValue,
+ }
+ out.Metric = autoscaling.MetricIdentifier{
+ Name: in.MetricName,
+ Selector: in.Selector,
+ }
+ return nil
+}
+
+func Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *autoscalingv2beta1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
+ if err := autoConvert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in, out, s); err != nil {
+ return err
+ }
+ if selectorMetricsEnc, hasOtherMetrics := out.Annotations[autoscaling.MetricSpecsAnnotation]; hasOtherMetrics {
+ var selectorMetrics []autoscalingv2beta1.MetricSpec
+ if err := json.Unmarshal([]byte(selectorMetricsEnc), &selectorMetrics); err != nil {
+ return err
+ }
+
+ convMetrics := make([]autoscaling.MetricSpec, len(selectorMetrics))
+ for i, metric := range selectorMetrics {
+ if err := Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(&metric, &convMetrics[i], s); err != nil {
+ return err
+ }
+ }
+
+ outMetrics := make([]autoscaling.MetricSpec, 0, len(selectorMetrics)+len(out.Spec.Metrics))
+ for _, convMetric := range convMetrics {
+ outMetrics = append(outMetrics, convMetric)
+ }
+
+ for _, metric := range out.Spec.Metrics {
+ outMetrics = append(outMetrics, metric)
+ }
+
+ out.Spec.Metrics = outMetrics
+ delete(out.Annotations, autoscaling.MetricSpecsAnnotation)
+ }
+
+ if currentMetricsEnc, hasCurrentMetrics := out.Annotations[autoscaling.MetricStatusesAnnotation]; hasCurrentMetrics {
+ var currentMetrics []autoscalingv2beta1.MetricStatus
+ if err := json.Unmarshal([]byte(currentMetricsEnc), ¤tMetrics); err != nil {
+ return err
+ }
+
+ outCurrentMetrics := make([]autoscaling.MetricStatus, 0, len(currentMetrics)+len(out.Status.CurrentMetrics))
+ for i, currentMetric := range currentMetrics {
+ if err := Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(¤tMetric, &out.Status.CurrentMetrics[i], s); err != nil {
+ return err
+ }
+ }
+
+ for _, currentMetric := range out.Status.CurrentMetrics {
+ outCurrentMetrics = append(outCurrentMetrics, currentMetric)
+ }
+
+ out.Status.CurrentMetrics = outCurrentMetrics
+ delete(out.Annotations, autoscaling.MetricStatusesAnnotation)
+ }
+ return nil
+}
+
+func Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *autoscalingv2beta1.HorizontalPodAutoscaler, s conversion.Scope) error {
+ if err := autoConvert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(in, out, s); err != nil {
+ return err
+ }
+
+ selectorMetrics := make([]autoscalingv2beta1.MetricSpec, 0, len(in.Spec.Metrics))
+ for _, metric := range in.Spec.Metrics {
+ if (metric.Object != nil && metric.Object.Metric.Selector == nil) ||
+ (metric.Pods != nil && metric.Pods.Metric.Selector == nil) ||
+ (metric.External != nil && metric.External.Metric.Selector == nil) ||
+ (metric.Resource != nil) {
+ continue
+ }
+
+ convMetric := autoscalingv2beta1.MetricSpec{}
+ if err := Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(&metric, &convMetric, s); err != nil {
+ return err
+ }
+ selectorMetrics = append(selectorMetrics, convMetric)
+ }
+
+ currentMetrics := make([]autoscalingv2beta1.MetricStatus, 0, len(in.Status.CurrentMetrics))
+ for _, currentMetric := range in.Status.CurrentMetrics {
+ if (currentMetric.Object != nil && currentMetric.Object.Metric.Selector == nil) ||
+ (currentMetric.Pods != nil && currentMetric.Pods.Metric.Selector == nil) ||
+ (currentMetric.External != nil && currentMetric.External.Metric.Selector == nil) ||
+ (currentMetric.Resource != nil) {
+ continue
+ }
+ convMetric := autoscalingv2beta1.MetricStatus{}
+ if err := Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(¤tMetric, &convMetric, s); err != nil {
+ return err
+ }
+ currentMetrics = append(currentMetrics, convMetric)
+ }
+
+ if len(selectorMetrics) > 0 || len(currentMetrics) > 0 {
+ old := out.Annotations
+ out.Annotations = make(map[string]string, len(old)+2)
+ if old != nil {
+ for k, v := range old {
+ out.Annotations[k] = v
+ }
+ }
+ }
+
+ if len(selectorMetrics) > 0 {
+ selectorMetricsEnc, err := json.Marshal(selectorMetrics)
+ if err != nil {
+ return err
+ }
+ out.Annotations[autoscaling.MetricSpecsAnnotation] = string(selectorMetricsEnc)
+ }
+
+ if len(currentMetrics) > 0 {
+ currentMetricsEnc, err := json.Marshal(currentMetrics)
+ if err != nil {
+ return err
+ }
+ out.Annotations[autoscaling.MetricSpecsAnnotation] = string(currentMetricsEnc)
+ }
+
+ return nil
+}
diff --git a/pkg/apis/autoscaling/v2beta1/register.go b/pkg/apis/autoscaling/v2beta1/register.go
index b2433d34cf8..da80b2bef79 100644
--- a/pkg/apis/autoscaling/v2beta1/register.go
+++ b/pkg/apis/autoscaling/v2beta1/register.go
@@ -41,5 +41,5 @@ func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
- localSchemeBuilder.Register(addDefaultingFuncs)
+ localSchemeBuilder.Register(addDefaultingFuncs, addConversionFuncs)
}
diff --git a/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go b/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go
index 3714e264b9c..989a97741c2 100644
--- a/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go
+++ b/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go
@@ -24,9 +24,8 @@ import (
unsafe "unsafe"
v2beta1 "k8s.io/api/autoscaling/v2beta1"
- corev1 "k8s.io/api/core/v1"
- resource "k8s.io/apimachinery/pkg/api/resource"
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
@@ -200,6 +199,106 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v2beta1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v2beta1.ExternalMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v2beta1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v2beta1.ExternalMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.HorizontalPodAutoscaler)(nil), (*v2beta1.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(a.(*autoscaling.HorizontalPodAutoscaler), b.(*v2beta1.HorizontalPodAutoscaler), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.MetricTarget)(nil), (*v2beta1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(a.(*autoscaling.MetricTarget), b.(*v2beta1.CrossVersionObjectReference), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v2beta1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v2beta1.ObjectMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v2beta1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v2beta1.ObjectMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v2beta1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v2beta1.PodsMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v2beta1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v2beta1.PodsMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v2beta1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v2beta1.ResourceMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v2beta1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v2beta1.ResourceMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.CrossVersionObjectReference)(nil), (*autoscaling.MetricTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(a.(*v2beta1.CrossVersionObjectReference), b.(*autoscaling.MetricTarget), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v2beta1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v2beta1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.HorizontalPodAutoscaler)(nil), (*autoscaling.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(a.(*v2beta1.HorizontalPodAutoscaler), b.(*autoscaling.HorizontalPodAutoscaler), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v2beta1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v2beta1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v2beta1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v2beta1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v2beta1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*v2beta1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v2beta1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
+ }); err != nil {
+ return err
+ }
return nil
}
@@ -228,57 +327,33 @@ func Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObje
}
func autoConvert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource is an autogenerated conversion function.
-func Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
- return autoConvert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v2beta1.ExternalMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v2beta1.ExternalMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in, out, s)
-}
-
func autoConvert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.CurrentValue = in.CurrentValue
- out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus is an autogenerated conversion function.
-func Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
- return autoConvert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v2beta1.ExternalMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
- out.CurrentValue = in.CurrentValue
- out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v2beta1.ExternalMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in, out, s)
-}
-
func autoConvert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *v2beta1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
@@ -290,11 +365,6 @@ func autoConvert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAut
return nil
}
-// Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler is an autogenerated conversion function.
-func Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *v2beta1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
- return autoConvert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in, out, s)
-}
-
func autoConvert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *v2beta1.HorizontalPodAutoscaler, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
@@ -306,11 +376,6 @@ func autoConvert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAut
return nil
}
-// Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler is an autogenerated conversion function.
-func Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *v2beta1.HorizontalPodAutoscaler, s conversion.Scope) error {
- return autoConvert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(in, out, s)
-}
-
func autoConvert_v2beta1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAutoscalerCondition(in *v2beta1.HorizontalPodAutoscalerCondition, out *autoscaling.HorizontalPodAutoscalerCondition, s conversion.Scope) error {
out.Type = autoscaling.HorizontalPodAutoscalerConditionType(in.Type)
out.Status = autoscaling.ConditionStatus(in.Status)
@@ -327,7 +392,7 @@ func Convert_v2beta1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalP
func autoConvert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalPodAutoscalerCondition(in *autoscaling.HorizontalPodAutoscalerCondition, out *v2beta1.HorizontalPodAutoscalerCondition, s conversion.Scope) error {
out.Type = v2beta1.HorizontalPodAutoscalerConditionType(in.Type)
- out.Status = corev1.ConditionStatus(in.Status)
+ out.Status = v1.ConditionStatus(in.Status)
out.LastTransitionTime = in.LastTransitionTime
out.Reason = in.Reason
out.Message = in.Message
@@ -341,7 +406,17 @@ func Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalP
func autoConvert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *v2beta1.HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]autoscaling.HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items))
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]autoscaling.HorizontalPodAutoscaler, len(*in))
+ for i := range *in {
+ if err := Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Items = nil
+ }
return nil
}
@@ -352,7 +427,17 @@ func Convert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAut
func autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v2beta1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *v2beta1.HorizontalPodAutoscalerList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]v2beta1.HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items))
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]v2beta1.HorizontalPodAutoscaler, len(*in))
+ for i := range *in {
+ if err := Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Items = nil
+ }
return nil
}
@@ -367,7 +452,17 @@ func autoConvert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPo
}
out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
out.MaxReplicas = in.MaxReplicas
- out.Metrics = *(*[]autoscaling.MetricSpec)(unsafe.Pointer(&in.Metrics))
+ if in.Metrics != nil {
+ in, out := &in.Metrics, &out.Metrics
+ *out = make([]autoscaling.MetricSpec, len(*in))
+ for i := range *in {
+ if err := Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Metrics = nil
+ }
return nil
}
@@ -382,7 +477,17 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPo
}
out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
out.MaxReplicas = in.MaxReplicas
- out.Metrics = *(*[]v2beta1.MetricSpec)(unsafe.Pointer(&in.Metrics))
+ if in.Metrics != nil {
+ in, out := &in.Metrics, &out.Metrics
+ *out = make([]v2beta1.MetricSpec, len(*in))
+ for i := range *in {
+ if err := Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Metrics = nil
+ }
return nil
}
@@ -393,10 +498,20 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPodAut
func autoConvert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *v2beta1.HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
- out.LastScaleTime = (*v1.Time)(unsafe.Pointer(in.LastScaleTime))
+ out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
out.CurrentReplicas = in.CurrentReplicas
out.DesiredReplicas = in.DesiredReplicas
- out.CurrentMetrics = *(*[]autoscaling.MetricStatus)(unsafe.Pointer(&in.CurrentMetrics))
+ if in.CurrentMetrics != nil {
+ in, out := &in.CurrentMetrics, &out.CurrentMetrics
+ *out = make([]autoscaling.MetricStatus, len(*in))
+ for i := range *in {
+ if err := Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.CurrentMetrics = nil
+ }
out.Conditions = *(*[]autoscaling.HorizontalPodAutoscalerCondition)(unsafe.Pointer(&in.Conditions))
return nil
}
@@ -408,10 +523,20 @@ func Convert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodA
func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *v2beta1.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
- out.LastScaleTime = (*v1.Time)(unsafe.Pointer(in.LastScaleTime))
+ out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
out.CurrentReplicas = in.CurrentReplicas
out.DesiredReplicas = in.DesiredReplicas
- out.CurrentMetrics = *(*[]v2beta1.MetricStatus)(unsafe.Pointer(&in.CurrentMetrics))
+ if in.CurrentMetrics != nil {
+ in, out := &in.CurrentMetrics, &out.CurrentMetrics
+ *out = make([]v2beta1.MetricStatus, len(*in))
+ for i := range *in {
+ if err := Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.CurrentMetrics = nil
+ }
out.Conditions = *(*[]v2beta1.HorizontalPodAutoscalerCondition)(unsafe.Pointer(&in.Conditions))
return nil
}
@@ -423,10 +548,42 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodA
func autoConvert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(in *v2beta1.MetricSpec, out *autoscaling.MetricSpec, s conversion.Scope) error {
out.Type = autoscaling.MetricSourceType(in.Type)
- out.Object = (*autoscaling.ObjectMetricSource)(unsafe.Pointer(in.Object))
- out.Pods = (*autoscaling.PodsMetricSource)(unsafe.Pointer(in.Pods))
- out.Resource = (*autoscaling.ResourceMetricSource)(unsafe.Pointer(in.Resource))
- out.External = (*autoscaling.ExternalMetricSource)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(autoscaling.ObjectMetricSource)
+ if err := Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(autoscaling.PodsMetricSource)
+ if err := Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(autoscaling.ResourceMetricSource)
+ if err := Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(autoscaling.ExternalMetricSource)
+ if err := Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -437,10 +594,42 @@ func Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(in *v2beta1.MetricSpec
func autoConvert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(in *autoscaling.MetricSpec, out *v2beta1.MetricSpec, s conversion.Scope) error {
out.Type = v2beta1.MetricSourceType(in.Type)
- out.Object = (*v2beta1.ObjectMetricSource)(unsafe.Pointer(in.Object))
- out.Pods = (*v2beta1.PodsMetricSource)(unsafe.Pointer(in.Pods))
- out.Resource = (*v2beta1.ResourceMetricSource)(unsafe.Pointer(in.Resource))
- out.External = (*v2beta1.ExternalMetricSource)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(v2beta1.ObjectMetricSource)
+ if err := Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(v2beta1.PodsMetricSource)
+ if err := Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(v2beta1.ResourceMetricSource)
+ if err := Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(v2beta1.ExternalMetricSource)
+ if err := Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -451,10 +640,42 @@ func Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(in *autoscaling.Metric
func autoConvert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(in *v2beta1.MetricStatus, out *autoscaling.MetricStatus, s conversion.Scope) error {
out.Type = autoscaling.MetricSourceType(in.Type)
- out.Object = (*autoscaling.ObjectMetricStatus)(unsafe.Pointer(in.Object))
- out.Pods = (*autoscaling.PodsMetricStatus)(unsafe.Pointer(in.Pods))
- out.Resource = (*autoscaling.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
- out.External = (*autoscaling.ExternalMetricStatus)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(autoscaling.ObjectMetricStatus)
+ if err := Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(autoscaling.PodsMetricStatus)
+ if err := Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(autoscaling.ResourceMetricStatus)
+ if err := Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(autoscaling.ExternalMetricStatus)
+ if err := Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -465,10 +686,42 @@ func Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(in *v2beta1.Metric
func autoConvert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(in *autoscaling.MetricStatus, out *v2beta1.MetricStatus, s conversion.Scope) error {
out.Type = v2beta1.MetricSourceType(in.Type)
- out.Object = (*v2beta1.ObjectMetricStatus)(unsafe.Pointer(in.Object))
- out.Pods = (*v2beta1.PodsMetricStatus)(unsafe.Pointer(in.Pods))
- out.Resource = (*v2beta1.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
- out.External = (*v2beta1.ExternalMetricStatus)(unsafe.Pointer(in.External))
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(v2beta1.ObjectMetricStatus)
+ if err := Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Object = nil
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(v2beta1.PodsMetricStatus)
+ if err := Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Pods = nil
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(v2beta1.ResourceMetricStatus)
+ if err := Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.Resource = nil
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(v2beta1.ExternalMetricStatus)
+ if err := Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(*in, *out, s); err != nil {
+ return err
+ }
+ } else {
+ out.External = nil
+ }
return nil
}
@@ -478,149 +731,89 @@ func Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(in *autoscaling.Me
}
func autoConvert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
- if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
+ if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(&in.Target, &out.Target, s); err != nil {
return err
}
- out.MetricName = in.MetricName
- out.TargetValue = in.TargetValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
+ // WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource is an autogenerated conversion function.
-func Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
- return autoConvert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v2beta1.ObjectMetricSource, s conversion.Scope) error {
- if err := Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
+ // WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
+ if err := Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
return err
}
- out.MetricName = in.MetricName
- out.TargetValue = in.TargetValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v2beta1.ObjectMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in, out, s)
-}
-
func autoConvert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
- if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
- return err
- }
- out.MetricName = in.MetricName
- out.CurrentValue = in.CurrentValue
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
+ // WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus is an autogenerated conversion function.
-func Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
- return autoConvert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v2beta1.ObjectMetricStatus, s conversion.Scope) error {
- if err := Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
- return err
- }
- out.MetricName = in.MetricName
- out.CurrentValue = in.CurrentValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
+ // WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v2beta1.ObjectMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in, out, s)
-}
-
func autoConvert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.TargetAverageValue = in.TargetAverageValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource is an autogenerated conversion function.
-func Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
- return autoConvert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v2beta1.PodsMetricSource, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.TargetAverageValue = in.TargetAverageValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v2beta1.PodsMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in, out, s)
-}
-
func autoConvert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus is an autogenerated conversion function.
-func Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
- return autoConvert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v2beta1.PodsMetricStatus, s conversion.Scope) error {
- out.MetricName = in.MetricName
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v2beta1.PodsMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in, out, s)
-}
-
func autoConvert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
out.Name = core.ResourceName(in.Name)
- out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ // WARNING: in.TargetAverageUtilization requires manual conversion: does not exist in peer-type
+ // WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource is an autogenerated conversion function.
-func Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
- return autoConvert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in, out, s)
-}
-
func autoConvert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v2beta1.ResourceMetricSource, s conversion.Scope) error {
- out.Name = corev1.ResourceName(in.Name)
- out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
- out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
+ out.Name = v1.ResourceName(in.Name)
+ // WARNING: in.Target requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource is an autogenerated conversion function.
-func Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v2beta1.ResourceMetricSource, s conversion.Scope) error {
- return autoConvert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in, out, s)
-}
-
func autoConvert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
out.Name = core.ResourceName(in.Name)
- out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
- out.CurrentAverageValue = in.CurrentAverageValue
+ // WARNING: in.CurrentAverageUtilization requires manual conversion: does not exist in peer-type
+ // WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus is an autogenerated conversion function.
-func Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
- return autoConvert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in, out, s)
-}
-
func autoConvert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v2beta1.ResourceMetricStatus, s conversion.Scope) error {
- out.Name = corev1.ResourceName(in.Name)
- out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
- out.CurrentAverageValue = in.CurrentAverageValue
+ out.Name = v1.ResourceName(in.Name)
+ // WARNING: in.Current requires manual conversion: does not exist in peer-type
return nil
}
-
-// Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus is an autogenerated conversion function.
-func Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v2beta1.ResourceMetricStatus, s conversion.Scope) error {
- return autoConvert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in, out, s)
-}
diff --git a/pkg/apis/autoscaling/v2beta2/BUILD b/pkg/apis/autoscaling/v2beta2/BUILD
new file mode 100644
index 00000000000..04a183d724f
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/BUILD
@@ -0,0 +1,35 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "defaults.go",
+ "doc.go",
+ "register.go",
+ "zz_generated.conversion.go",
+ "zz_generated.defaults.go",
+ ],
+ importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//pkg/apis/autoscaling:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
+ "//staging/src/k8s.io/api/core/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",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/pkg/apis/autoscaling/v2beta2/defaults.go b/pkg/apis/autoscaling/v2beta2/defaults.go
new file mode 100644
index 00000000000..a3a061ce259
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/defaults.go
@@ -0,0 +1,51 @@
+/*
+Copyright 2018 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 v2beta2
+
+import (
+ autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
+ "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/kubernetes/pkg/apis/autoscaling"
+)
+
+func addDefaultingFuncs(scheme *runtime.Scheme) error {
+ return RegisterDefaults(scheme)
+}
+
+func SetDefaults_HorizontalPodAutoscaler(obj *autoscalingv2beta2.HorizontalPodAutoscaler) {
+ if obj.Spec.MinReplicas == nil {
+ minReplicas := int32(1)
+ obj.Spec.MinReplicas = &minReplicas
+ }
+
+ if len(obj.Spec.Metrics) == 0 {
+ utilizationDefaultVal := int32(autoscaling.DefaultCPUUtilization)
+ obj.Spec.Metrics = []autoscalingv2beta2.MetricSpec{
+ {
+ Type: autoscalingv2beta2.ResourceMetricSourceType,
+ Resource: &autoscalingv2beta2.ResourceMetricSource{
+ Name: v1.ResourceCPU,
+ Target: autoscalingv2beta2.MetricTarget{
+ Type: autoscalingv2beta2.UtilizationMetricType,
+ AverageUtilization: &utilizationDefaultVal,
+ },
+ },
+ },
+ }
+ }
+}
diff --git a/pkg/apis/autoscaling/v2beta2/doc.go b/pkg/apis/autoscaling/v2beta2/doc.go
new file mode 100644
index 00000000000..a6be8b596e7
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2018 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/autoscaling
+// +k8s:defaulter-gen=TypeMeta
+
+package v2beta2 // import "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2"
diff --git a/pkg/apis/autoscaling/v2beta2/register.go b/pkg/apis/autoscaling/v2beta2/register.go
new file mode 100644
index 00000000000..fc86de007e9
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/register.go
@@ -0,0 +1,45 @@
+/*
+Copyright 2018 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 v2beta2
+
+import (
+ autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "autoscaling"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta2"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ localSchemeBuilder = &autoscalingv2beta2.SchemeBuilder
+ AddToScheme = localSchemeBuilder.AddToScheme
+)
+
+func init() {
+ // We only register manually written functions here. The registration of the
+ // generated functions takes place in the generated files. The separation
+ // makes the code compile even when the generated files are missing.
+ localSchemeBuilder.Register(addDefaultingFuncs)
+}
diff --git a/pkg/apis/autoscaling/v2beta2/zz_generated.conversion.go b/pkg/apis/autoscaling/v2beta2/zz_generated.conversion.go
new file mode 100644
index 00000000000..30d43d3b092
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/zz_generated.conversion.go
@@ -0,0 +1,35 @@
+// +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 v2beta2
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+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 {
+ return nil
+}
diff --git a/pkg/apis/autoscaling/v2beta2/zz_generated.defaults.go b/pkg/apis/autoscaling/v2beta2/zz_generated.defaults.go
new file mode 100644
index 00000000000..8b2f839c289
--- /dev/null
+++ b/pkg/apis/autoscaling/v2beta2/zz_generated.defaults.go
@@ -0,0 +1,32 @@
+// +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 defaulter-gen. DO NOT EDIT.
+
+package v2beta2
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// RegisterDefaults adds defaulters functions to the given scheme.
+// Public to allow building arbitrary schemes.
+// All generated defaulters are covering - they call all nested defaulters.
+func RegisterDefaults(scheme *runtime.Scheme) error {
+ return nil
+}
diff --git a/pkg/apis/autoscaling/validation/validation.go b/pkg/apis/autoscaling/validation/validation.go
index 2257800faf0..09e8f2b7174 100644
--- a/pkg/apis/autoscaling/validation/validation.go
+++ b/pkg/apis/autoscaling/validation/validation.go
@@ -178,14 +178,16 @@ func validateMetricSpec(spec autoscaling.MetricSpec, fldPath *field.Path) field.
func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
- allErrs = append(allErrs, ValidateCrossVersionObjectReference(src.Target, fldPath.Child("target"))...)
-
- if len(src.MetricName) == 0 {
- allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
+ allErrs = append(allErrs, ValidateCrossVersionObjectReference(src.DescribedObject, fldPath.Child("describedObject"))...)
+ allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
+ if &src.Target == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
+ } else {
+ allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
}
- if src.TargetValue.Sign() != 1 {
- allErrs = append(allErrs, field.Required(fldPath.Child("targetValue"), "must specify a positive target value"))
+ if src.Target.Value == nil && src.Target.AverageValue == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must set either a target value or averageValue"))
}
return allErrs
@@ -194,28 +196,19 @@ func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Pa
func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
- if len(src.MetricName) == 0 {
- allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
+ allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
+ if &src.Target == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
} else {
- for _, msg := range pathvalidation.IsValidPathSegmentName(src.MetricName) {
- allErrs = append(allErrs, field.Invalid(fldPath.Child("metricName"), src.MetricName, msg))
- }
+ allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
}
- if src.TargetValue == nil && src.TargetAverageValue == nil {
- allErrs = append(allErrs, field.Required(fldPath.Child("targetValue"), "must set either a target value for metric or a per-pod target"))
+ if src.Target.Value == nil && src.Target.AverageValue == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must set either a target value for metric or a per-pod target"))
}
- if src.TargetValue != nil && src.TargetAverageValue != nil {
- allErrs = append(allErrs, field.Forbidden(fldPath.Child("targetValue"), "may not set both a target value for metric and a per-pod target"))
- }
-
- if src.TargetAverageValue != nil && src.TargetAverageValue.Sign() != 1 {
- allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageValue"), src.TargetAverageValue, "must be positive"))
- }
-
- if src.TargetValue != nil && src.TargetValue.Sign() != 1 {
- allErrs = append(allErrs, field.Invalid(fldPath.Child("targetValue"), src.TargetValue, "must be positive"))
+ if src.Target.Value != nil && src.Target.AverageValue != nil {
+ allErrs = append(allErrs, field.Forbidden(fldPath.Child("target").Child("value"), "may not set both a target value for metric and a per-pod target"))
}
return allErrs
@@ -224,12 +217,15 @@ func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *fiel
func validatePodsSource(src *autoscaling.PodsMetricSource, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
- if len(src.MetricName) == 0 {
- allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
+ allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
+ if &src.Target == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
+ } else {
+ allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
}
- if src.TargetAverageValue.Sign() != 1 {
- allErrs = append(allErrs, field.Required(fldPath.Child("targetAverageValue"), "must specify a positive target value"))
+ if src.Target.AverageValue == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must specify a positive target averageValue"))
}
return allErrs
@@ -241,22 +237,60 @@ func validateResourceSource(src *autoscaling.ResourceMetricSource, fldPath *fiel
if len(src.Name) == 0 {
allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must specify a resource name"))
}
-
- if src.TargetAverageUtilization == nil && src.TargetAverageValue == nil {
- allErrs = append(allErrs, field.Required(fldPath.Child("targetAverageUtilization"), "must set either a target raw value or a target utilization"))
+ if &src.Target == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
+ } else {
+ allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
}
- if src.TargetAverageUtilization != nil && *src.TargetAverageUtilization < 1 {
- allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageUtilization"), src.TargetAverageUtilization, "must be greater than 0"))
+ if src.Target.AverageUtilization == nil && src.Target.AverageValue == nil {
+ allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageUtilization"), "must set either a target raw value or a target utilization"))
}
- if src.TargetAverageUtilization != nil && src.TargetAverageValue != nil {
- allErrs = append(allErrs, field.Forbidden(fldPath.Child("targetAverageValue"), "may not set both a target raw value and a target utilization"))
- }
-
- if src.TargetAverageValue != nil && src.TargetAverageValue.Sign() != 1 {
- allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageValue"), src.TargetAverageValue, "must be positive"))
+ if src.Target.AverageUtilization != nil && src.Target.AverageValue != nil {
+ allErrs = append(allErrs, field.Forbidden(fldPath.Child("target").Child("averageValue"), "may not set both a target raw value and a target utilization"))
}
return allErrs
}
+
+func validateMetricTarget(mt autoscaling.MetricTarget, fldPath *field.Path) field.ErrorList {
+ allErrs := field.ErrorList{}
+
+ if len(mt.Type) == 0 {
+ allErrs = append(allErrs, field.Required(fldPath.Child("type"), "must specify a metric target type"))
+ }
+
+ if mt.Type != autoscaling.UtilizationMetricType &&
+ mt.Type != autoscaling.ValueMetricType &&
+ mt.Type != autoscaling.AverageValueMetricType {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("type"), mt.Type, "must be either Utilization, Value, or AverageValue"))
+ }
+
+ if mt.Value != nil && mt.Value.Sign() != 1 {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("value"), mt.Value, "must be positive"))
+ }
+
+ if mt.AverageValue != nil && mt.AverageValue.Sign() != 1 {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("averageValue"), mt.AverageValue, "must be positive"))
+ }
+
+ if mt.AverageUtilization != nil && *mt.AverageUtilization < 1 {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("averageUtilization"), mt.AverageUtilization, "must be greater than 0"))
+ }
+
+ return allErrs
+}
+
+func validateMetricIdentifier(id autoscaling.MetricIdentifier, fldPath *field.Path) field.ErrorList {
+ allErrs := field.ErrorList{}
+
+ if len(id.Name) == 0 {
+ allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must specify a metric name"))
+ } else {
+ for _, msg := range pathvalidation.IsValidPathSegmentName(id.Name) {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), id.Name, msg))
+ }
+ }
+ return allErrs
+}
diff --git a/pkg/apis/autoscaling/validation/validation_test.go b/pkg/apis/autoscaling/validation/validation_test.go
index 7c7a4250d31..deb952ba6bc 100644
--- a/pkg/apis/autoscaling/validation/validation_test.go
+++ b/pkg/apis/autoscaling/validation/validation_test.go
@@ -92,6 +92,10 @@ func TestValidateScale(t *testing.T) {
}
func TestValidateHorizontalPodAutoscaler(t *testing.T) {
+ metricLabelSelector, err := metav1.ParseToLabelSelector("label=value")
+ if err != nil {
+ t.Errorf("unable to parse label selector: %v", err)
+ }
successCases := []autoscaling.HorizontalPodAutoscaler{
{
ObjectMeta: metav1.ObjectMeta{
@@ -110,7 +114,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -146,8 +153,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
},
},
},
@@ -169,8 +179,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "somemetric",
- TargetAverageValue: *resource.NewMilliQuantity(300, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
},
},
},
@@ -192,12 +207,17 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Kind: "ReplicationController",
Name: "myrc",
},
- MetricName: "somemetric",
- TargetValue: *resource.NewMilliQuantity(300, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
},
},
},
@@ -219,13 +239,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
},
- TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
},
},
@@ -247,13 +268,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
- TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
},
},
@@ -282,7 +304,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -302,7 +327,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -322,7 +350,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -342,7 +373,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -393,8 +427,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
- TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
},
},
},
@@ -413,7 +450,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- TargetAverageUtilization: utilpointer.Int32Ptr(70),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(70),
+ },
},
},
},
@@ -433,7 +473,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: utilpointer.Int32Ptr(-10),
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: utilpointer.Int32Ptr(-10),
+ },
},
},
},
@@ -453,6 +496,9 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ },
},
},
},
@@ -471,7 +517,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{},
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -490,36 +540,18 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "somemetric",
- },
- },
- },
- },
- },
- msg: "must specify a positive target value",
- },
- {
- horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
- ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
- Spec: autoscaling.HorizontalPodAutoscalerSpec{
- ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
- MinReplicas: utilpointer.Int32Ptr(1),
- MaxReplicas: 5,
- Metrics: []autoscaling.MetricSpec{
- {
- Type: autoscaling.ObjectMetricSourceType,
- Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
- Name: "myrc",
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
},
- MetricName: "somemetric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
},
},
- msg: "target.kind: Required",
+ msg: "must specify a positive target averageValue",
},
{
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
@@ -532,11 +564,70 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Kind: "ReplicationController",
Name: "myrc",
},
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ },
+ },
+ },
+ },
+ },
+ },
+ msg: "must set either a target value or averageValue",
+ },
+ {
+ horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
+ ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
+ Spec: autoscaling.HorizontalPodAutoscalerSpec{
+ ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
+ MinReplicas: utilpointer.Int32Ptr(1),
+ MaxReplicas: 5,
+ Metrics: []autoscaling.MetricSpec{
+ {
+ Type: autoscaling.ObjectMetricSourceType,
+ Object: &autoscaling.ObjectMetricSource{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
+ Name: "myrc",
+ },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
+ },
+ },
+ },
+ },
+ },
+ msg: "object.describedObject.kind: Required",
+ },
+ {
+ horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
+ ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
+ Spec: autoscaling.HorizontalPodAutoscalerSpec{
+ ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
+ MinReplicas: utilpointer.Int32Ptr(1),
+ MaxReplicas: 5,
+ Metrics: []autoscaling.MetricSpec{
+ {
+ Type: autoscaling.ObjectMetricSourceType,
+ Object: &autoscaling.ObjectMetricSource{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
+ Kind: "ReplicationController",
+ Name: "myrc",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -555,12 +646,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
},
- TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
},
},
@@ -579,13 +671,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "foo/../",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "foo/../",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
},
- TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
},
},
@@ -605,11 +698,12 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
},
},
},
@@ -629,13 +723,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(-300, resource.DecimalSI),
},
- TargetValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
},
},
},
@@ -654,13 +749,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ AverageValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
},
- TargetAverageValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
},
},
},
@@ -679,14 +775,15 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricName: "somemetric",
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
+ AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
- TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
- TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
},
},
},
@@ -694,6 +791,79 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
},
msg: "may not set both a target value for metric and a per-pod target",
},
+ {
+ horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
+ ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
+ Spec: autoscaling.HorizontalPodAutoscalerSpec{
+ ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
+ MinReplicas: utilpointer.Int32Ptr(1),
+ MaxReplicas: 5,
+ Metrics: []autoscaling.MetricSpec{
+ {
+ Type: autoscaling.ExternalMetricSourceType,
+ External: &autoscaling.ExternalMetricSource{
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: "boogity",
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
+ },
+ },
+ },
+ },
+ },
+ msg: "must be either Utilization, Value, or AverageValue",
+ },
+ {
+ horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
+ ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
+ Spec: autoscaling.HorizontalPodAutoscalerSpec{
+ ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
+ MinReplicas: utilpointer.Int32Ptr(1),
+ MaxReplicas: 5,
+ Metrics: []autoscaling.MetricSpec{
+ {
+ Type: autoscaling.ExternalMetricSourceType,
+ External: &autoscaling.ExternalMetricSource{
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
+ },
+ },
+ },
+ },
+ },
+ msg: "must specify a metric target type",
+ },
+ {
+ horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
+ ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
+ Spec: autoscaling.HorizontalPodAutoscalerSpec{
+ ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
+ MinReplicas: utilpointer.Int32Ptr(1),
+ MaxReplicas: 5,
+ Metrics: []autoscaling.MetricSpec{
+ {
+ Type: autoscaling.ExternalMetricSourceType,
+ External: &autoscaling.ExternalMetricSource{
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ Selector: metricLabelSelector,
+ },
+ },
+ },
+ },
+ },
+ },
+ msg: "must specify a metric target",
+ },
{
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
@@ -735,12 +905,20 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
Pods: &autoscaling.PodsMetricSource{
- MetricName: "somemetric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -762,24 +940,37 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
sourceTypes := map[autoscaling.MetricSourceType]autoscaling.MetricSpec{
autoscaling.ResourceMetricSourceType: {
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
autoscaling.PodsMetricSourceType: {
Pods: &autoscaling.PodsMetricSource{
- MetricName: "somemetric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
autoscaling.ObjectMetricSourceType: {
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Kind: "ReplicationController",
Name: "myrc",
},
- MetricName: "somemetric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "somemetric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
}
diff --git a/pkg/apis/autoscaling/zz_generated.deepcopy.go b/pkg/apis/autoscaling/zz_generated.deepcopy.go
index 0681900073f..03b8cd8b673 100644
--- a/pkg/apis/autoscaling/zz_generated.deepcopy.go
+++ b/pkg/apis/autoscaling/zz_generated.deepcopy.go
@@ -44,21 +44,8 @@ func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) {
*out = *in
- if in.MetricSelector != nil {
- in, out := &in.MetricSelector, &out.MetricSelector
- *out = new(v1.LabelSelector)
- (*in).DeepCopyInto(*out)
- }
- if in.TargetValue != nil {
- in, out := &in.TargetValue, &out.TargetValue
- x := (*in).DeepCopy()
- *out = &x
- }
- if in.TargetAverageValue != nil {
- in, out := &in.TargetAverageValue, &out.TargetAverageValue
- x := (*in).DeepCopy()
- *out = &x
- }
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Target.DeepCopyInto(&out.Target)
return
}
@@ -75,17 +62,8 @@ func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) {
*out = *in
- if in.MetricSelector != nil {
- in, out := &in.MetricSelector, &out.MetricSelector
- *out = new(v1.LabelSelector)
- (*in).DeepCopyInto(*out)
- }
- out.CurrentValue = in.CurrentValue.DeepCopy()
- if in.CurrentAverageValue != nil {
- in, out := &in.CurrentAverageValue, &out.CurrentAverageValue
- x := (*in).DeepCopy()
- *out = &x
- }
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
return
}
@@ -245,6 +223,27 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopy() *HorizontalPodAutoscalerStat
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricIdentifier) DeepCopyInto(out *MetricIdentifier) {
+ *out = *in
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
+func (in *MetricIdentifier) DeepCopy() *MetricIdentifier {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricIdentifier)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricSpec) DeepCopyInto(out *MetricSpec) {
*out = *in
@@ -317,11 +316,74 @@ func (in *MetricStatus) DeepCopy() *MetricStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricTarget) DeepCopyInto(out *MetricTarget) {
+ *out = *in
+ if in.Value != nil {
+ in, out := &in.Value, &out.Value
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageUtilization != nil {
+ in, out := &in.AverageUtilization, &out.AverageUtilization
+ *out = new(int32)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricTarget.
+func (in *MetricTarget) DeepCopy() *MetricTarget {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricTarget)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricValueStatus) DeepCopyInto(out *MetricValueStatus) {
+ *out = *in
+ if in.Value != nil {
+ in, out := &in.Value, &out.Value
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageUtilization != nil {
+ in, out := &in.AverageUtilization, &out.AverageUtilization
+ *out = new(int32)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricValueStatus.
+func (in *MetricValueStatus) DeepCopy() *MetricValueStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricValueStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource) {
*out = *in
- out.Target = in.Target
- out.TargetValue = in.TargetValue.DeepCopy()
+ out.DescribedObject = in.DescribedObject
+ in.Target.DeepCopyInto(&out.Target)
+ in.Metric.DeepCopyInto(&out.Metric)
return
}
@@ -338,8 +400,9 @@ func (in *ObjectMetricSource) DeepCopy() *ObjectMetricSource {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectMetricStatus) DeepCopyInto(out *ObjectMetricStatus) {
*out = *in
- out.Target = in.Target
- out.CurrentValue = in.CurrentValue.DeepCopy()
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
+ out.DescribedObject = in.DescribedObject
return
}
@@ -356,7 +419,8 @@ func (in *ObjectMetricStatus) DeepCopy() *ObjectMetricStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource) {
*out = *in
- out.TargetAverageValue = in.TargetAverageValue.DeepCopy()
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Target.DeepCopyInto(&out.Target)
return
}
@@ -373,7 +437,8 @@ func (in *PodsMetricSource) DeepCopy() *PodsMetricSource {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus) {
*out = *in
- out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
return
}
@@ -390,16 +455,7 @@ func (in *PodsMetricStatus) DeepCopy() *PodsMetricStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) {
*out = *in
- if in.TargetAverageUtilization != nil {
- in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization
- *out = new(int32)
- **out = **in
- }
- if in.TargetAverageValue != nil {
- in, out := &in.TargetAverageValue, &out.TargetAverageValue
- x := (*in).DeepCopy()
- *out = &x
- }
+ in.Target.DeepCopyInto(&out.Target)
return
}
@@ -416,12 +472,7 @@ func (in *ResourceMetricSource) DeepCopy() *ResourceMetricSource {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus) {
*out = *in
- if in.CurrentAverageUtilization != nil {
- in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization
- *out = new(int32)
- **out = **in
- }
- out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
+ in.Current.DeepCopyInto(&out.Current)
return
}
diff --git a/pkg/controller/podautoscaler/BUILD b/pkg/controller/podautoscaler/BUILD
index 80342236639..2988db1c211 100644
--- a/pkg/controller/podautoscaler/BUILD
+++ b/pkg/controller/podautoscaler/BUILD
@@ -1,10 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
- "go_test",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
@@ -15,13 +9,14 @@ go_library(
"replica_calculator.go",
],
importpath = "k8s.io/kubernetes/pkg/controller/podautoscaler",
+ visibility = ["//visibility:public"],
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/controller/podautoscaler/metrics:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
- "//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/core/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",
@@ -66,6 +61,7 @@ go_test(
"//pkg/controller/podautoscaler/metrics:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/meta/testrestmapper:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
@@ -80,7 +76,7 @@ go_test(
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/scale/fake:go_default_library",
"//staging/src/k8s.io/client-go/testing:go_default_library",
- "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/external_metrics/v1beta1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1:go_default_library",
@@ -107,4 +103,5 @@ filegroup(
"//pkg/controller/podautoscaler/metrics:all-srcs",
],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/pkg/controller/podautoscaler/horizontal.go b/pkg/controller/podautoscaler/horizontal.go
index d94045d5cfa..b40af893bd5 100644
--- a/pkg/controller/podautoscaler/horizontal.go
+++ b/pkg/controller/podautoscaler/horizontal.go
@@ -23,7 +23,7 @@ import (
"github.com/golang/glog"
autoscalingv1 "k8s.io/api/autoscaling/v1"
- autoscalingv2 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
@@ -218,12 +218,24 @@ func (a *HorizontalController) computeReplicasForMetrics(hpa *autoscalingv2.Hori
switch metricSpec.Type {
case autoscalingv2.ObjectMetricSourceType:
- replicaCountProposal, timestampProposal, metricNameProposal, err = a.computeStatusForObjectMetric(currentReplicas, metricSpec, hpa, selector, &statuses[i])
+ metricSelector, err := metav1.LabelSelectorAsSelector(metricSpec.Object.Metric.Selector)
+ if err != nil {
+ a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetObjectMetric", err.Error())
+ setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetObjectMetric", "the HPA was unable to compute the replica count: %v", err)
+ return 0, "", nil, time.Time{}, fmt.Errorf("failed to get object metric value: %v", err)
+ }
+ replicaCountProposal, timestampProposal, metricNameProposal, err = a.computeStatusForObjectMetric(currentReplicas, metricSpec, hpa, selector, &statuses[i], metricSelector)
if err != nil {
return 0, "", nil, time.Time{}, fmt.Errorf("failed to get object metric value: %v", err)
}
case autoscalingv2.PodsMetricSourceType:
- replicaCountProposal, timestampProposal, metricNameProposal, err = a.computeStatusForPodsMetric(currentReplicas, metricSpec, hpa, selector, &statuses[i])
+ metricSelector, err := metav1.LabelSelectorAsSelector(metricSpec.Pods.Metric.Selector)
+ if err != nil {
+ a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetPodsMetric", err.Error())
+ setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetPodsMetric", "the HPA was unable to compute the replica count: %v", err)
+ return 0, "", nil, time.Time{}, fmt.Errorf("failed to get pods metric value: %v", err)
+ }
+ replicaCountProposal, timestampProposal, metricNameProposal, err = a.computeStatusForPodsMetric(currentReplicas, metricSpec, hpa, selector, &statuses[i], metricSelector)
if err != nil {
return 0, "", nil, time.Time{}, fmt.Errorf("failed to get object metric value: %v", err)
}
@@ -270,8 +282,8 @@ func (a *HorizontalController) reconcileKey(key string) error {
}
// computeStatusForObjectMetric computes the desired number of replicas for the specified metric of type ObjectMetricSourceType.
-func (a *HorizontalController) computeStatusForObjectMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus) (int32, time.Time, string, error) {
- replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetObjectMetricReplicas(currentReplicas, metricSpec.Object.TargetValue.MilliValue(), metricSpec.Object.MetricName, hpa.Namespace, &metricSpec.Object.Target, selector)
+func (a *HorizontalController) computeStatusForObjectMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus, metricSelector labels.Selector) (int32, time.Time, string, error) {
+ replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetObjectMetricReplicas(currentReplicas, metricSpec.Object.Target.Value.MilliValue(), metricSpec.Object.Metric.Name, hpa.Namespace, &metricSpec.Object.DescribedObject, selector, metricSelector)
if err != nil {
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetObjectMetric", err.Error())
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetObjectMetric", "the HPA was unable to compute the replica count: %v", err)
@@ -280,17 +292,22 @@ func (a *HorizontalController) computeStatusForObjectMetric(currentReplicas int3
*status = autoscalingv2.MetricStatus{
Type: autoscalingv2.ObjectMetricSourceType,
Object: &autoscalingv2.ObjectMetricStatus{
- Target: metricSpec.Object.Target,
- MetricName: metricSpec.Object.MetricName,
- CurrentValue: *resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ DescribedObject: metricSpec.Object.DescribedObject,
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: metricSpec.Object.Metric.Name,
+ Selector: metricSpec.Object.Metric.Selector,
+ },
+ Current: autoscalingv2.MetricValueStatus{
+ Value: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ },
},
}
- return replicaCountProposal, timestampProposal, fmt.Sprintf("%s metric %s", metricSpec.Object.Target.Kind, metricSpec.Object.MetricName), nil
+ return replicaCountProposal, timestampProposal, fmt.Sprintf("%s metric %s", metricSpec.Object.DescribedObject.Kind, metricSpec.Object.Metric.Name), nil
}
// computeStatusForPodsMetric computes the desired number of replicas for the specified metric of type PodsMetricSourceType.
-func (a *HorizontalController) computeStatusForPodsMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus) (int32, time.Time, string, error) {
- replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetMetricReplicas(currentReplicas, metricSpec.Pods.TargetAverageValue.MilliValue(), metricSpec.Pods.MetricName, hpa.Namespace, selector)
+func (a *HorizontalController) computeStatusForPodsMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus, metricSelector labels.Selector) (int32, time.Time, string, error) {
+ replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetMetricReplicas(currentReplicas, metricSpec.Pods.Target.AverageValue.MilliValue(), metricSpec.Pods.Metric.Name, hpa.Namespace, selector, metricSelector)
if err != nil {
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetPodsMetric", err.Error())
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetPodsMetric", "the HPA was unable to compute the replica count: %v", err)
@@ -299,19 +316,24 @@ func (a *HorizontalController) computeStatusForPodsMetric(currentReplicas int32,
*status = autoscalingv2.MetricStatus{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricStatus{
- MetricName: metricSpec.Pods.MetricName,
- CurrentAverageValue: *resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: metricSpec.Pods.Metric.Name,
+ Selector: metricSpec.Pods.Metric.Selector,
+ },
+ Current: autoscalingv2.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ },
},
}
- return replicaCountProposal, timestampProposal, fmt.Sprintf("pods metric %s", metricSpec.Pods.MetricName), nil
+ return replicaCountProposal, timestampProposal, fmt.Sprintf("pods metric %s", metricSpec.Pods.Metric.Name), nil
}
// computeStatusForResourceMetric computes the desired number of replicas for the specified metric of type ResourceMetricSourceType.
func (a *HorizontalController) computeStatusForResourceMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus) (int32, time.Time, string, error) {
- if metricSpec.Resource.TargetAverageValue != nil {
+ if metricSpec.Resource.Target.AverageValue != nil {
var rawProposal int64
- replicaCountProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetRawResourceReplicas(currentReplicas, metricSpec.Resource.TargetAverageValue.MilliValue(), metricSpec.Resource.Name, hpa.Namespace, selector)
+ replicaCountProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetRawResourceReplicas(currentReplicas, metricSpec.Resource.Target.AverageValue.MilliValue(), metricSpec.Resource.Name, hpa.Namespace, selector)
if err != nil {
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetResourceMetric", err.Error())
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetResourceMetric", "the HPA was unable to compute the replica count: %v", err)
@@ -321,19 +343,21 @@ func (a *HorizontalController) computeStatusForResourceMetric(currentReplicas in
status = &autoscalingv2.MetricStatus{
Type: autoscalingv2.ResourceMetricSourceType,
Resource: &autoscalingv2.ResourceMetricStatus{
- Name: metricSpec.Resource.Name,
- CurrentAverageValue: *resource.NewMilliQuantity(rawProposal, resource.DecimalSI),
+ Name: metricSpec.Resource.Name,
+ Current: autoscalingv2.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),
+ },
},
}
return replicaCountProposal, timestampProposal, metricNameProposal, nil
} else {
- if metricSpec.Resource.TargetAverageUtilization == nil {
+ if metricSpec.Resource.Target.AverageUtilization == nil {
errMsg := "invalid resource metric source: neither a utilization target nor a value target was set"
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetResourceMetric", errMsg)
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetResourceMetric", "the HPA was unable to compute the replica count: %s", errMsg)
return 0, time.Time{}, "", fmt.Errorf(errMsg)
}
- targetUtilization := *metricSpec.Resource.TargetAverageUtilization
+ targetUtilization := *metricSpec.Resource.Target.AverageUtilization
var percentageProposal int32
var rawProposal int64
replicaCountProposal, percentageProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetResourceReplicas(currentReplicas, targetUtilization, metricSpec.Resource.Name, hpa.Namespace, selector)
@@ -347,8 +371,10 @@ func (a *HorizontalController) computeStatusForResourceMetric(currentReplicas in
Type: autoscalingv2.ResourceMetricSourceType,
Resource: &autoscalingv2.ResourceMetricStatus{
Name: metricSpec.Resource.Name,
- CurrentAverageUtilization: &percentageProposal,
- CurrentAverageValue: *resource.NewMilliQuantity(rawProposal, resource.DecimalSI),
+ Current: autoscalingv2.MetricValueStatus{
+ AverageUtilization: &percentageProposal,
+ AverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),
+ },
},
}
return replicaCountProposal, timestampProposal, metricNameProposal, nil
@@ -357,39 +383,47 @@ func (a *HorizontalController) computeStatusForResourceMetric(currentReplicas in
// computeStatusForExternalMetric computes the desired number of replicas for the specified metric of type ExternalMetricSourceType.
func (a *HorizontalController) computeStatusForExternalMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus) (int32, time.Time, string, error) {
- if metricSpec.External.TargetAverageValue != nil {
- replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalPerPodMetricReplicas(currentReplicas, metricSpec.External.TargetAverageValue.MilliValue(), metricSpec.External.MetricName, hpa.Namespace, metricSpec.External.MetricSelector)
+ if metricSpec.External.Target.AverageValue != nil {
+ replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalPerPodMetricReplicas(currentReplicas, metricSpec.External.Target.AverageValue.MilliValue(), metricSpec.External.Metric.Name, hpa.Namespace, metricSpec.External.Metric.Selector)
if err != nil {
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetExternalMetric", err.Error())
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetExternalMetric", "the HPA was unable to compute the replica count: %v", err)
- return 0, time.Time{}, "", fmt.Errorf("failed to get %s external metric: %v", metricSpec.External.MetricName, err)
+ return 0, time.Time{}, "", fmt.Errorf("failed to get %s external metric: %v", metricSpec.External.Metric.Name, err)
}
*status = autoscalingv2.MetricStatus{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricStatus{
- MetricSelector: metricSpec.External.MetricSelector,
- MetricName: metricSpec.External.MetricName,
- CurrentAverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: metricSpec.External.Metric.Name,
+ Selector: metricSpec.External.Metric.Selector,
+ },
+ Current: autoscalingv2.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ },
},
}
- return replicaCountProposal, timestampProposal, fmt.Sprintf("external metric %s(%+v)", metricSpec.External.MetricName, metricSpec.External.MetricSelector), nil
+ return replicaCountProposal, timestampProposal, fmt.Sprintf("external metric %s(%+v)", metricSpec.External.Metric.Name, metricSpec.External.Metric.Selector), nil
}
- if metricSpec.External.TargetValue != nil {
- replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalMetricReplicas(currentReplicas, metricSpec.External.TargetValue.MilliValue(), metricSpec.External.MetricName, hpa.Namespace, metricSpec.External.MetricSelector, selector)
+ if metricSpec.External.Target.Value != nil {
+ replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalMetricReplicas(currentReplicas, metricSpec.External.Target.Value.MilliValue(), metricSpec.External.Metric.Name, hpa.Namespace, metricSpec.External.Metric.Selector, selector)
if err != nil {
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetExternalMetric", err.Error())
setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetExternalMetric", "the HPA was unable to compute the replica count: %v", err)
- return 0, time.Time{}, "", fmt.Errorf("failed to get external metric %s: %v", metricSpec.External.MetricName, err)
+ return 0, time.Time{}, "", fmt.Errorf("failed to get external metric %s: %v", metricSpec.External.Metric.Name, err)
}
*status = autoscalingv2.MetricStatus{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricStatus{
- MetricSelector: metricSpec.External.MetricSelector,
- MetricName: metricSpec.External.MetricName,
- CurrentValue: *resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: metricSpec.External.Metric.Name,
+ Selector: metricSpec.External.Metric.Selector,
+ },
+ Current: autoscalingv2.MetricValueStatus{
+ Value: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
+ },
},
}
- return replicaCountProposal, timestampProposal, fmt.Sprintf("external metric %s(%+v)", metricSpec.External.MetricName, metricSpec.External.MetricSelector), nil
+ return replicaCountProposal, timestampProposal, fmt.Sprintf("external metric %s(%+v)", metricSpec.External.Metric.Name, metricSpec.External.Metric.Selector), nil
}
errMsg := "invalid external metric source: neither a value target nor an average value target was set"
a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetExternalMetric", errMsg)
diff --git a/pkg/controller/podautoscaler/horizontal_test.go b/pkg/controller/podautoscaler/horizontal_test.go
index 5be579861dd..b8382f4b7a3 100644
--- a/pkg/controller/podautoscaler/horizontal_test.go
+++ b/pkg/controller/podautoscaler/horizontal_test.go
@@ -25,7 +25,7 @@ import (
"time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
- autoscalingv2 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta/testrestmapper"
"k8s.io/apimachinery/pkg/api/resource"
@@ -42,7 +42,7 @@ import (
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
- cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
emapi "k8s.io/metrics/pkg/apis/external_metrics/v1beta1"
metricsapi "k8s.io/metrics/pkg/apis/metrics/v1beta1"
metricsfake "k8s.io/metrics/pkg/client/clientset/versioned/fake"
@@ -214,7 +214,9 @@ func (tc *testCase) prepareTestClient(t *testing.T) (*fake.Clientset, *metricsfa
Type: autoscalingv2.ResourceMetricSourceType,
Resource: &autoscalingv2.ResourceMetricSource{
Name: v1.ResourceCPU,
- TargetAverageUtilization: &tc.CPUTarget,
+ Target: autoscalingv2.MetricTarget{
+ AverageUtilization: &tc.CPUTarget,
+ },
},
},
}
@@ -507,9 +509,11 @@ func (tc *testCase) prepareTestClient(t *testing.T) (*fake.Clientset, *metricsfa
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
Namespace: namespace,
},
- Timestamp: metav1.Time{Time: time.Now()},
- MetricName: "qps",
- Value: *resource.NewMilliQuantity(int64(level), resource.DecimalSI),
+ Timestamp: metav1.Time{Time: time.Now()},
+ Metric: cmapi.MetricIdentifier{
+ Name: "qps",
+ },
+ Value: *resource.NewMilliQuantity(int64(level), resource.DecimalSI),
}
metrics.Items = append(metrics.Items, podMetric)
}
@@ -522,8 +526,8 @@ func (tc *testCase) prepareTestClient(t *testing.T) (*fake.Clientset, *metricsfa
metrics := &cmapi.MetricValueList{}
var matchedTarget *autoscalingv2.MetricSpec
for i, target := range tc.metricsTarget {
- if target.Type == autoscalingv2.ObjectMetricSourceType && name == target.Object.Target.Name {
- gk := schema.FromAPIVersionAndKind(target.Object.Target.APIVersion, target.Object.Target.Kind).GroupKind()
+ if target.Type == autoscalingv2.ObjectMetricSourceType && name == target.Object.DescribedObject.Name {
+ gk := schema.FromAPIVersionAndKind(target.Object.DescribedObject.APIVersion, target.Object.DescribedObject.Kind).GroupKind()
mapping, err := mapper.RESTMapping(gk)
if err != nil {
t.Logf("unable to get mapping for %s: %v", gk.String(), err)
@@ -542,13 +546,15 @@ func (tc *testCase) prepareTestClient(t *testing.T) (*fake.Clientset, *metricsfa
metrics.Items = []cmapi.MetricValue{
{
DescribedObject: v1.ObjectReference{
- Kind: matchedTarget.Object.Target.Kind,
- APIVersion: matchedTarget.Object.Target.APIVersion,
+ Kind: matchedTarget.Object.DescribedObject.Kind,
+ APIVersion: matchedTarget.Object.DescribedObject.APIVersion,
Name: name,
},
- Timestamp: metav1.Time{Time: time.Now()},
- MetricName: "qps",
- Value: *resource.NewMilliQuantity(int64(tc.reportedLevels[0]), resource.DecimalSI),
+ Timestamp: metav1.Time{Time: time.Now()},
+ Metric: cmapi.MetricIdentifier{
+ Name: "qps",
+ },
+ Value: *resource.NewMilliQuantity(int64(tc.reportedLevels[0]), resource.DecimalSI),
},
}
@@ -847,6 +853,7 @@ func TestScaleUpReplicaSet(t *testing.T) {
}
func TestScaleUpCM(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -857,8 +864,12 @@ func TestScaleUpCM(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -869,6 +880,7 @@ func TestScaleUpCM(t *testing.T) {
}
func TestScaleUpCMUnreadyAndHotCpuNoLessScale(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -879,8 +891,12 @@ func TestScaleUpCMUnreadyAndHotCpuNoLessScale(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -893,6 +909,7 @@ func TestScaleUpCMUnreadyAndHotCpuNoLessScale(t *testing.T) {
}
func TestScaleUpCMUnreadyandCpuHot(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -903,8 +920,12 @@ func TestScaleUpCMUnreadyandCpuHot(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -926,6 +947,7 @@ func TestScaleUpCMUnreadyandCpuHot(t *testing.T) {
}
func TestScaleUpHotCpuNoScaleWouldScaleDown(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -936,8 +958,12 @@ func TestScaleUpHotCpuNoScaleWouldScaleDown(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -958,6 +984,7 @@ func TestScaleUpHotCpuNoScaleWouldScaleDown(t *testing.T) {
}
func TestScaleUpCMObject(t *testing.T) {
+ targetValue := resource.MustParse("15.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -968,13 +995,17 @@ func TestScaleUpCMObject(t *testing.T) {
{
Type: autoscalingv2.ObjectMetricSourceType,
Object: &autoscalingv2.ObjectMetricSource{
- Target: autoscalingv2.CrossVersionObjectReference{
+ DescribedObject: autoscalingv2.CrossVersionObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Deployment",
Name: "some-deployment",
},
- MetricName: "qps",
- TargetValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: &targetValue,
+ },
},
},
},
@@ -993,9 +1024,13 @@ func TestScaleUpCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetValue: resource.NewMilliQuantity(6666, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: resource.NewMilliQuantity(6666, resource.DecimalSI),
+ },
},
},
},
@@ -1014,9 +1049,13 @@ func TestScaleUpPerPodCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetAverageValue: resource.NewMilliQuantity(2222, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: resource.NewMilliQuantity(2222, resource.DecimalSI),
+ },
},
},
},
@@ -1041,6 +1080,7 @@ func TestScaleDown(t *testing.T) {
}
func TestScaleDownCM(t *testing.T) {
+ averageValue := resource.MustParse("20.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -1051,8 +1091,12 @@ func TestScaleDownCM(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("20.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -1063,6 +1107,7 @@ func TestScaleDownCM(t *testing.T) {
}
func TestScaleDownCMObject(t *testing.T) {
+ targetValue := resource.MustParse("20.0")
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
@@ -1073,13 +1118,17 @@ func TestScaleDownCMObject(t *testing.T) {
{
Type: autoscalingv2.ObjectMetricSourceType,
Object: &autoscalingv2.ObjectMetricSource{
- Target: autoscalingv2.CrossVersionObjectReference{
+ DescribedObject: autoscalingv2.CrossVersionObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Deployment",
Name: "some-deployment",
},
- MetricName: "qps",
- TargetValue: resource.MustParse("20.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: &targetValue,
+ },
},
},
},
@@ -1099,9 +1148,13 @@ func TestScaleDownCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetValue: resource.NewMilliQuantity(14400, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: resource.NewMilliQuantity(14400, resource.DecimalSI),
+ },
},
},
},
@@ -1120,9 +1173,13 @@ func TestScaleDownPerPodCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetAverageValue: resource.NewMilliQuantity(3000, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: resource.NewMilliQuantity(3000, resource.DecimalSI),
+ },
},
},
},
@@ -1203,6 +1260,7 @@ func TestTolerance(t *testing.T) {
}
func TestToleranceCM(t *testing.T) {
+ averageValue := resource.MustParse("20.0")
tc := testCase{
minReplicas: 1,
maxReplicas: 5,
@@ -1212,8 +1270,12 @@ func TestToleranceCM(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("20.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -1229,6 +1291,7 @@ func TestToleranceCM(t *testing.T) {
}
func TestToleranceCMObject(t *testing.T) {
+ targetValue := resource.MustParse("20.0")
tc := testCase{
minReplicas: 1,
maxReplicas: 5,
@@ -1238,13 +1301,17 @@ func TestToleranceCMObject(t *testing.T) {
{
Type: autoscalingv2.ObjectMetricSourceType,
Object: &autoscalingv2.ObjectMetricSource{
- Target: autoscalingv2.CrossVersionObjectReference{
+ DescribedObject: autoscalingv2.CrossVersionObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Deployment",
Name: "some-deployment",
},
- MetricName: "qps",
- TargetValue: resource.MustParse("20.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: &targetValue,
+ },
},
},
},
@@ -1269,9 +1336,13 @@ func TestToleranceCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetValue: resource.NewMilliQuantity(8666, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: resource.NewMilliQuantity(8666, resource.DecimalSI),
+ },
},
},
},
@@ -1295,9 +1366,13 @@ func TestTolerancePerPodCMExternal(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetAverageValue: resource.NewMilliQuantity(2200, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: resource.NewMilliQuantity(2200, resource.DecimalSI),
+ },
},
},
},
@@ -1669,14 +1744,20 @@ func TestConditionInvalidSelectorUnparsable(t *testing.T) {
}
func TestConditionFailedGetMetrics(t *testing.T) {
+ targetValue := resource.MustParse("15.0")
+ averageValue := resource.MustParse("15.0")
metricsTargets := map[string][]autoscalingv2.MetricSpec{
"FailedGetResourceMetric": nil,
"FailedGetPodsMetric": {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -1684,13 +1765,17 @@ func TestConditionFailedGetMetrics(t *testing.T) {
{
Type: autoscalingv2.ObjectMetricSourceType,
Object: &autoscalingv2.ObjectMetricSource{
- Target: autoscalingv2.CrossVersionObjectReference{
+ DescribedObject: autoscalingv2.CrossVersionObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Deployment",
Name: "some-deployment",
},
- MetricName: "qps",
- TargetValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: &targetValue,
+ },
},
},
},
@@ -1698,9 +1783,13 @@ func TestConditionFailedGetMetrics(t *testing.T) {
{
Type: autoscalingv2.ExternalMetricSourceType,
External: &autoscalingv2.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{},
- MetricName: "qps",
- TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ Selector: &metav1.LabelSelector{},
+ },
+ Target: autoscalingv2.MetricTarget{
+ Value: resource.NewMilliQuantity(300, resource.DecimalSI),
+ },
},
},
},
@@ -1857,6 +1946,7 @@ func NoTestBackoffUpscale(t *testing.T) {
}
func TestNoBackoffUpscaleCM(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
time := metav1.Time{Time: time.Now()}
tc := testCase{
minReplicas: 1,
@@ -1868,8 +1958,12 @@ func TestNoBackoffUpscaleCM(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
@@ -1895,6 +1989,7 @@ func TestNoBackoffUpscaleCM(t *testing.T) {
}
func TestNoBackoffUpscaleCMNoBackoffCpu(t *testing.T) {
+ averageValue := resource.MustParse("15.0")
time := metav1.Time{Time: time.Now()}
tc := testCase{
minReplicas: 1,
@@ -1906,8 +2001,12 @@ func TestNoBackoffUpscaleCMNoBackoffCpu(t *testing.T) {
{
Type: autoscalingv2.PodsMetricSourceType,
Pods: &autoscalingv2.PodsMetricSource{
- MetricName: "qps",
- TargetAverageValue: resource.MustParse("15.0"),
+ Metric: autoscalingv2.MetricIdentifier{
+ Name: "qps",
+ },
+ Target: autoscalingv2.MetricTarget{
+ AverageValue: &averageValue,
+ },
},
},
},
diff --git a/pkg/controller/podautoscaler/legacy_replica_calculator_test.go b/pkg/controller/podautoscaler/legacy_replica_calculator_test.go
index 9fac8a4a000..df42d7133fb 100644
--- a/pkg/controller/podautoscaler/legacy_replica_calculator_test.go
+++ b/pkg/controller/podautoscaler/legacy_replica_calculator_test.go
@@ -210,7 +210,7 @@ func (tc *legacyReplicaCalcTestCase) runTest(t *testing.T) {
assert.True(t, tc.timestamp.Equal(outTimestamp), "timestamp should be as expected")
} else {
- outReplicas, outUtilization, outTimestamp, err := replicaCalc.GetMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, selector)
+ outReplicas, outUtilization, outTimestamp, err := replicaCalc.GetMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, selector, nil)
if tc.expectedError != nil {
require.Error(t, err, "there should be an error calculating the replica count")
diff --git a/pkg/controller/podautoscaler/metrics/BUILD b/pkg/controller/podautoscaler/metrics/BUILD
index 8abce805215..f745c9ac0ef 100644
--- a/pkg/controller/podautoscaler/metrics/BUILD
+++ b/pkg/controller/podautoscaler/metrics/BUILD
@@ -1,10 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
- "go_test",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
@@ -15,15 +9,16 @@ go_library(
"utilization.go",
],
importpath = "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics",
+ visibility = ["//visibility:public"],
deps = [
- "//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/core/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/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
- "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/client/custom_metrics:go_default_library",
@@ -44,7 +39,7 @@ go_test(
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/extensions/install:go_default_library",
- "//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/meta/testrestmapper:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
@@ -55,7 +50,7 @@ go_test(
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/testing:go_default_library",
- "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/external_metrics/v1beta1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1:go_default_library",
@@ -78,4 +73,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/pkg/controller/podautoscaler/metrics/interfaces.go b/pkg/controller/podautoscaler/metrics/interfaces.go
index 29fccc48e3a..943a164ae9c 100644
--- a/pkg/controller/podautoscaler/metrics/interfaces.go
+++ b/pkg/controller/podautoscaler/metrics/interfaces.go
@@ -19,7 +19,7 @@ package metrics
import (
"time"
- autoscaling "k8s.io/api/autoscaling/v2beta1"
+ autoscaling "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
)
@@ -37,11 +37,11 @@ type MetricsClient interface {
// GetRawMetric gets the given metric (and an associated oldest timestamp)
// for all pods matching the specified selector in the given namespace
- GetRawMetric(metricName string, namespace string, selector labels.Selector) (PodMetricsInfo, time.Time, error)
+ GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (PodMetricsInfo, time.Time, error)
// GetObjectMetric gets the given metric (and an associated timestamp) for the given
// object in the given namespace
- GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference) (int64, time.Time, error)
+ GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error)
// GetExternalMetric gets all the values of a given external metric
// that match the specified selector.
diff --git a/pkg/controller/podautoscaler/metrics/legacy_metrics_client.go b/pkg/controller/podautoscaler/metrics/legacy_metrics_client.go
index c9846602773..11fdb21db59 100644
--- a/pkg/controller/podautoscaler/metrics/legacy_metrics_client.go
+++ b/pkg/controller/podautoscaler/metrics/legacy_metrics_client.go
@@ -26,7 +26,7 @@ import (
heapster "k8s.io/heapster/metrics/api/v1/types"
metricsapi "k8s.io/metrics/pkg/apis/metrics/v1alpha1"
- autoscaling "k8s.io/api/autoscaling/v2beta1"
+ autoscaling "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
@@ -109,7 +109,7 @@ func (h *HeapsterMetricsClient) GetResourceMetric(resource v1.ResourceName, name
return res, timestamp, nil
}
-func (h *HeapsterMetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector) (PodMetricsInfo, time.Time, error) {
+func (h *HeapsterMetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (PodMetricsInfo, time.Time, error) {
podList, err := h.podsGetter.Pods(namespace).List(metav1.ListOptions{LabelSelector: selector.String()})
if err != nil {
return nil, time.Time{}, fmt.Errorf("failed to get pod list while fetching metrics: %v", err)
@@ -173,7 +173,7 @@ func (h *HeapsterMetricsClient) GetRawMetric(metricName string, namespace string
return res, *timestamp, nil
}
-func (h *HeapsterMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference) (int64, time.Time, error) {
+func (h *HeapsterMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) {
return 0, time.Time{}, fmt.Errorf("object metrics are not yet supported")
}
diff --git a/pkg/controller/podautoscaler/metrics/legacy_metrics_client_test.go b/pkg/controller/podautoscaler/metrics/legacy_metrics_client_test.go
index 55c016dd199..fd86e3db3b0 100644
--- a/pkg/controller/podautoscaler/metrics/legacy_metrics_client_test.go
+++ b/pkg/controller/podautoscaler/metrics/legacy_metrics_client_test.go
@@ -71,10 +71,11 @@ type testCase struct {
reportedMetricsPoints [][]metricPoint
reportedPodMetrics [][]int64
- namespace string
- selector labels.Selector
- resourceName v1.ResourceName
- metricName string
+ namespace string
+ selector labels.Selector
+ metricSelector labels.Selector
+ resourceName v1.ResourceName
+ metricName string
}
func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset {
@@ -211,7 +212,7 @@ func (tc *testCase) runTest(t *testing.T) {
info, timestamp, err := metricsClient.GetResourceMetric(tc.resourceName, tc.namespace, tc.selector)
tc.verifyResults(t, info, timestamp, err)
} else {
- info, timestamp, err := metricsClient.GetRawMetric(tc.metricName, tc.namespace, tc.selector)
+ info, timestamp, err := metricsClient.GetRawMetric(tc.metricName, tc.namespace, tc.selector, tc.metricSelector)
tc.verifyResults(t, info, timestamp, err)
}
}
diff --git a/pkg/controller/podautoscaler/metrics/rest_metrics_client.go b/pkg/controller/podautoscaler/metrics/rest_metrics_client.go
index cf26617a4e3..0e4b2e583a7 100644
--- a/pkg/controller/podautoscaler/metrics/rest_metrics_client.go
+++ b/pkg/controller/podautoscaler/metrics/rest_metrics_client.go
@@ -22,12 +22,12 @@ import (
"github.com/golang/glog"
- autoscaling "k8s.io/api/autoscaling/v2beta1"
+ autoscaling "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
- customapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ customapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
resourceclient "k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1"
customclient "k8s.io/metrics/pkg/client/custom_metrics"
externalclient "k8s.io/metrics/pkg/client/external_metrics"
@@ -101,8 +101,8 @@ type customMetricsClient struct {
// GetRawMetric gets the given metric (and an associated oldest timestamp)
// for all pods matching the specified selector in the given namespace
-func (c *customMetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector) (PodMetricsInfo, time.Time, error) {
- metrics, err := c.client.NamespacedMetrics(namespace).GetForObjects(schema.GroupKind{Kind: "Pod"}, selector, metricName)
+func (c *customMetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (PodMetricsInfo, time.Time, error) {
+ metrics, err := c.client.NamespacedMetrics(namespace).GetForObjects(schema.GroupKind{Kind: "Pod"}, selector, metricName, metricSelector)
if err != nil {
return nil, time.Time{}, fmt.Errorf("unable to fetch metrics from custom metrics API: %v", err)
}
@@ -123,7 +123,7 @@ func (c *customMetricsClient) GetRawMetric(metricName string, namespace string,
// GetObjectMetric gets the given metric (and an associated timestamp) for the given
// object in the given namespace
-func (c *customMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference) (int64, time.Time, error) {
+func (c *customMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) {
gvk := schema.FromAPIVersionAndKind(objectRef.APIVersion, objectRef.Kind)
var metricValue *customapi.MetricValue
var err error
@@ -131,9 +131,9 @@ func (c *customMetricsClient) GetObjectMetric(metricName string, namespace strin
// handle namespace separately
// NB: we ignore namespace name here, since CrossVersionObjectReference isn't
// supposed to allow you to escape your namespace
- metricValue, err = c.client.RootScopedMetrics().GetForObject(gvk.GroupKind(), namespace, metricName)
+ metricValue, err = c.client.RootScopedMetrics().GetForObject(gvk.GroupKind(), namespace, metricName, metricSelector)
} else {
- metricValue, err = c.client.NamespacedMetrics(namespace).GetForObject(gvk.GroupKind(), objectRef.Name, metricName)
+ metricValue, err = c.client.NamespacedMetrics(namespace).GetForObject(gvk.GroupKind(), objectRef.Name, metricName, metricSelector)
}
if err != nil {
diff --git a/pkg/controller/podautoscaler/metrics/rest_metrics_client_test.go b/pkg/controller/podautoscaler/metrics/rest_metrics_client_test.go
index d1488d94206..624f2fd3a45 100644
--- a/pkg/controller/podautoscaler/metrics/rest_metrics_client_test.go
+++ b/pkg/controller/podautoscaler/metrics/rest_metrics_client_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"time"
- autoscalingapi "k8s.io/api/autoscaling/v2beta1"
+ autoscalingapi "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta/testrestmapper"
"k8s.io/apimachinery/pkg/api/resource"
@@ -32,7 +32,7 @@ import (
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/api/legacyscheme"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
- cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
emapi "k8s.io/metrics/pkg/apis/external_metrics/v1beta1"
metricsapi "k8s.io/metrics/pkg/apis/metrics/v1beta1"
metricsfake "k8s.io/metrics/pkg/client/clientset/versioned/fake"
@@ -143,9 +143,11 @@ func (tc *restClientTestCase) prepareTestClient(t *testing.T) (*metricsfake.Clie
APIVersion: "v1",
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
},
- Value: *resource.NewMilliQuantity(int64(metricPoint.level), resource.DecimalSI),
- Timestamp: metav1.Time{Time: timestamp},
- MetricName: tc.metricName,
+ Value: *resource.NewMilliQuantity(int64(metricPoint.level), resource.DecimalSI),
+ Timestamp: metav1.Time{Time: timestamp},
+ Metric: cmapi.MetricIdentifier{
+ Name: tc.metricName,
+ },
}
metrics.Items = append(metrics.Items, metric)
@@ -176,9 +178,11 @@ func (tc *restClientTestCase) prepareTestClient(t *testing.T) (*metricsfake.Clie
APIVersion: tc.singleObject.APIVersion,
Name: tc.singleObject.Name,
},
- Timestamp: metav1.Time{Time: timestamp},
- MetricName: tc.metricName,
- Value: *resource.NewMilliQuantity(int64(metricPoint.level), resource.DecimalSI),
+ Timestamp: metav1.Time{Time: timestamp},
+ Metric: cmapi.MetricIdentifier{
+ Name: tc.metricName,
+ },
+ Value: *resource.NewMilliQuantity(int64(metricPoint.level), resource.DecimalSI),
},
},
}
@@ -227,10 +231,10 @@ func (tc *restClientTestCase) runTest(t *testing.T) {
}
tc.verifyResults(t, info, timestamp, err)
} else if tc.singleObject == nil {
- info, timestamp, err := metricsClient.GetRawMetric(tc.metricName, tc.namespace, tc.selector)
+ info, timestamp, err := metricsClient.GetRawMetric(tc.metricName, tc.namespace, tc.selector, tc.metricLabelSelector)
tc.verifyResults(t, info, timestamp, err)
} else {
- val, timestamp, err := metricsClient.GetObjectMetric(tc.metricName, tc.namespace, tc.singleObject)
+ val, timestamp, err := metricsClient.GetObjectMetric(tc.metricName, tc.namespace, tc.singleObject, tc.metricLabelSelector)
info := PodMetricsInfo{tc.singleObject.Name: val}
tc.verifyResults(t, info, timestamp, err)
}
diff --git a/pkg/controller/podautoscaler/replica_calculator.go b/pkg/controller/podautoscaler/replica_calculator.go
index b4faac41096..38ad64bafaa 100644
--- a/pkg/controller/podautoscaler/replica_calculator.go
+++ b/pkg/controller/podautoscaler/replica_calculator.go
@@ -22,7 +22,7 @@ import (
"time"
"github.com/golang/glog"
- autoscaling "k8s.io/api/autoscaling/v2beta1"
+ autoscaling "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
@@ -159,8 +159,8 @@ func (c *ReplicaCalculator) GetRawResourceReplicas(currentReplicas int32, target
// GetMetricReplicas calculates the desired replica count based on a target metric utilization
// (as a milli-value) for pods matching the given selector in the given namespace, and the
// current replica count
-func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, selector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error) {
- metrics, timestamp, err := c.metricsClient.GetRawMetric(metricName, namespace, selector)
+func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error) {
+ metrics, timestamp, err := c.metricsClient.GetRawMetric(metricName, namespace, selector, metricSelector)
if err != nil {
return 0, 0, time.Time{}, fmt.Errorf("unable to get metric %s: %v", metricName, err)
}
@@ -238,8 +238,8 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet
// GetObjectMetricReplicas calculates the desired replica count based on a target metric utilization (as a milli-value)
// for the given object in the given namespace, and the current replica count.
-func (c *ReplicaCalculator) GetObjectMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error) {
- utilization, timestamp, err = c.metricsClient.GetObjectMetric(metricName, namespace, objectRef)
+func (c *ReplicaCalculator) GetObjectMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error) {
+ utilization, timestamp, err = c.metricsClient.GetObjectMetric(metricName, namespace, objectRef, metricSelector)
if err != nil {
return 0, 0, time.Time{}, fmt.Errorf("unable to get metric %s: %v on %s %s/%s", metricName, objectRef.Kind, namespace, objectRef.Name, err)
}
diff --git a/pkg/controller/podautoscaler/replica_calculator_test.go b/pkg/controller/podautoscaler/replica_calculator_test.go
index fa869a38f47..7cce4849634 100644
--- a/pkg/controller/podautoscaler/replica_calculator_test.go
+++ b/pkg/controller/podautoscaler/replica_calculator_test.go
@@ -22,20 +22,20 @@ import (
"testing"
"time"
- autoscalingv2 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta/testrestmapper"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes/fake"
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/api/legacyscheme"
- "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
- cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ cmapi "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
emapi "k8s.io/metrics/pkg/apis/external_metrics/v1beta1"
metricsapi "k8s.io/metrics/pkg/apis/metrics/v1beta1"
metricsfake "k8s.io/metrics/pkg/client/clientset/versioned/fake"
@@ -86,8 +86,9 @@ type replicaCalcTestCase struct {
timestamp time.Time
- resource *resourceInfo
- metric *metricInfo
+ resource *resourceInfo
+ metric *metricInfo
+ metricLabelSelector labels.Selector
podReadiness []v1.ConditionStatus
podStartTime []metav1.Time
@@ -235,9 +236,11 @@ func (tc *replicaCalcTestCase) prepareTestCMClient(t *testing.T) *cmfake.FakeCus
Name: fmt.Sprintf("%s-%d", podNamePrefix, i),
Namespace: testNamespace,
},
- Timestamp: metav1.Time{Time: tc.timestamp},
- MetricName: tc.metric.name,
- Value: *resource.NewMilliQuantity(level, resource.DecimalSI),
+ Timestamp: metav1.Time{Time: tc.timestamp},
+ Metric: cmapi.MetricIdentifier{
+ Name: tc.metric.name,
+ },
+ Value: *resource.NewMilliQuantity(level, resource.DecimalSI),
}
metrics.Items = append(metrics.Items, podMetric)
}
@@ -265,9 +268,11 @@ func (tc *replicaCalcTestCase) prepareTestCMClient(t *testing.T) *cmfake.FakeCus
APIVersion: tc.metric.singleObject.APIVersion,
Name: name,
},
- Timestamp: metav1.Time{Time: tc.timestamp},
- MetricName: tc.metric.name,
- Value: *resource.NewMilliQuantity(int64(tc.metric.levels[0]), resource.DecimalSI),
+ Timestamp: metav1.Time{Time: tc.timestamp},
+ Metric: cmapi.MetricIdentifier{
+ Name: tc.metric.name,
+ },
+ Value: *resource.NewMilliQuantity(int64(tc.metric.levels[0]), resource.DecimalSI),
},
}
@@ -322,7 +327,7 @@ func (tc *replicaCalcTestCase) prepareTestClient(t *testing.T) (*fake.Clientset,
func (tc *replicaCalcTestCase) runTest(t *testing.T) {
testClient, testMetricsClient, testCMClient, testEMClient := tc.prepareTestClient(t)
- metricsClient := metrics.NewRESTMetricsClient(testMetricsClient.MetricsV1beta1(), testCMClient, testEMClient)
+ metricsClient := metricsclient.NewRESTMetricsClient(testMetricsClient.MetricsV1beta1(), testCMClient, testEMClient)
replicaCalc := NewReplicaCalculator(metricsClient, testClient.Core(), defaultTestingTolerance, defaultTestingCpuTaintAfterStart, defaultTestingDelayOfInitialReadinessStatus)
@@ -357,7 +362,7 @@ func (tc *replicaCalcTestCase) runTest(t *testing.T) {
if tc.metric.singleObject == nil {
t.Fatal("Metric specified as objectMetric but metric.singleObject is nil.")
}
- outReplicas, outUtilization, outTimestamp, err = replicaCalc.GetObjectMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, tc.metric.singleObject, selector)
+ outReplicas, outUtilization, outTimestamp, err = replicaCalc.GetObjectMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, tc.metric.singleObject, selector, nil)
case externalMetric:
if tc.metric.selector == nil {
t.Fatal("Metric specified as externalMetric but metric.selector is nil.")
@@ -376,7 +381,7 @@ func (tc *replicaCalcTestCase) runTest(t *testing.T) {
outReplicas, outUtilization, outTimestamp, err = replicaCalc.GetExternalPerPodMetricReplicas(tc.currentReplicas, tc.metric.perPodTargetUtilization, tc.metric.name, testNamespace, tc.metric.selector)
case podMetric:
- outReplicas, outUtilization, outTimestamp, err = replicaCalc.GetMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, selector)
+ outReplicas, outUtilization, outTimestamp, err = replicaCalc.GetMetricReplicas(tc.currentReplicas, tc.metric.targetUtilization, tc.metric.name, testNamespace, selector, nil)
default:
t.Fatalf("Unknown metric type: %d", tc.metric.metricType)
}
diff --git a/pkg/generated/openapi/BUILD b/pkg/generated/openapi/BUILD
index ad5ad975bba..ce3b3905bc0 100644
--- a/pkg/generated/openapi/BUILD
+++ b/pkg/generated/openapi/BUILD
@@ -33,6 +33,7 @@ openapi_library(
"k8s.io/api/authorization/v1beta1",
"k8s.io/api/autoscaling/v1",
"k8s.io/api/autoscaling/v2beta1",
+ "k8s.io/api/autoscaling/v2beta2",
"k8s.io/api/batch/v1",
"k8s.io/api/batch/v1beta1",
"k8s.io/api/batch/v2alpha1",
@@ -72,6 +73,7 @@ openapi_library(
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1",
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1",
"k8s.io/metrics/pkg/apis/custom_metrics/v1beta1",
+ "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2",
"k8s.io/metrics/pkg/apis/external_metrics/v1beta1",
"k8s.io/metrics/pkg/apis/metrics/v1alpha1",
"k8s.io/metrics/pkg/apis/metrics/v1beta1",
diff --git a/pkg/master/BUILD b/pkg/master/BUILD
index 0a4519c3870..002d57bac4e 100644
--- a/pkg/master/BUILD
+++ b/pkg/master/BUILD
@@ -1,10 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
- "go_test",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
@@ -18,6 +12,7 @@ go_library(
"services.go",
],
importpath = "k8s.io/kubernetes/pkg/master",
+ visibility = ["//visibility:public"],
deps = [
"//pkg/apis/admission/install:go_default_library",
"//pkg/apis/admissionregistration/install:go_default_library",
@@ -83,6 +78,7 @@ go_library(
"//staging/src/k8s.io/api/authorization/v1beta1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/batch/v2alpha1:go_default_library",
@@ -199,4 +195,5 @@ filegroup(
"//pkg/master/tunneler:all-srcs",
],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/pkg/master/master.go b/pkg/master/master.go
index 22a4ac85add..37c672c7094 100644
--- a/pkg/master/master.go
+++ b/pkg/master/master.go
@@ -35,6 +35,7 @@ import (
authorizationapiv1beta1 "k8s.io/api/authorization/v1beta1"
autoscalingapiv1 "k8s.io/api/autoscaling/v1"
autoscalingapiv2beta1 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingapiv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchapiv1 "k8s.io/api/batch/v1"
batchapiv1beta1 "k8s.io/api/batch/v1beta1"
batchapiv2alpha1 "k8s.io/api/batch/v2alpha1"
@@ -487,6 +488,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
authorizationapiv1beta1.SchemeGroupVersion,
autoscalingapiv1.SchemeGroupVersion,
autoscalingapiv2beta1.SchemeGroupVersion,
+ autoscalingapiv2beta2.SchemeGroupVersion,
batchapiv1.SchemeGroupVersion,
batchapiv1beta1.SchemeGroupVersion,
certificatesapiv1beta1.SchemeGroupVersion,
diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go
index d40dce2fd63..534b6884259 100644
--- a/pkg/printers/internalversion/describe.go
+++ b/pkg/printers/internalversion/describe.go
@@ -2972,50 +2972,50 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
for i, metric := range hpa.Spec.Metrics {
switch metric.Type {
case autoscaling.ExternalMetricSourceType:
- if metric.External.TargetAverageValue != nil {
+ if metric.External.Target.AverageValue != nil {
current := ""
if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].External != nil &&
- hpa.Status.CurrentMetrics[i].External.CurrentAverageValue != nil {
- current = hpa.Status.CurrentMetrics[i].External.CurrentAverageValue.String()
+ &hpa.Status.CurrentMetrics[i].External.Current.AverageValue != nil {
+ current = hpa.Status.CurrentMetrics[i].External.Current.AverageValue.String()
}
- w.Write(LEVEL_1, "%q (target average value):\t%s / %s\n", metric.External.MetricName, current, metric.External.TargetAverageValue.String())
+ w.Write(LEVEL_1, "%q (target average value):\t%s / %s\n", metric.External.Metric.Name, current, metric.External.Target.AverageValue.String())
} else {
current := ""
if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].External != nil {
- current = hpa.Status.CurrentMetrics[i].External.CurrentValue.String()
+ current = hpa.Status.CurrentMetrics[i].External.Current.Value.String()
}
- w.Write(LEVEL_1, "%q (target value):\t%s / %s\n", metric.External.MetricName, current, metric.External.TargetValue.String())
+ w.Write(LEVEL_1, "%q (target value):\t%s / %s\n", metric.External.Metric.Name, current, metric.External.Target.Value.String())
}
case autoscaling.PodsMetricSourceType:
current := ""
if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].Pods != nil {
- current = hpa.Status.CurrentMetrics[i].Pods.CurrentAverageValue.String()
+ current = hpa.Status.CurrentMetrics[i].Pods.Current.AverageValue.String()
}
- w.Write(LEVEL_1, "%q on pods:\t%s / %s\n", metric.Pods.MetricName, current, metric.Pods.TargetAverageValue.String())
+ w.Write(LEVEL_1, "%q on pods:\t%s / %s\n", metric.Pods.Metric.Name, current, metric.Pods.Target.AverageValue.String())
case autoscaling.ObjectMetricSourceType:
current := ""
if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].Object != nil {
- current = hpa.Status.CurrentMetrics[i].Object.CurrentValue.String()
+ current = hpa.Status.CurrentMetrics[i].Object.Current.Value.String()
}
- w.Write(LEVEL_1, "%q on %s/%s:\t%s / %s\n", metric.Object.MetricName, metric.Object.Target.Kind, metric.Object.Target.Name, current, metric.Object.TargetValue.String())
+ w.Write(LEVEL_1, "%q on %s/%s:\t%s / %s\n", metric.Object.Metric.Name, metric.Object.DescribedObject.Kind, metric.Object.DescribedObject.Name, current, metric.Object.Target.Value.String())
case autoscaling.ResourceMetricSourceType:
w.Write(LEVEL_1, "resource %s on pods", string(metric.Resource.Name))
- if metric.Resource.TargetAverageValue != nil {
+ if metric.Resource.Target.AverageValue != nil {
current := ""
if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].Resource != nil {
- current = hpa.Status.CurrentMetrics[i].Resource.CurrentAverageValue.String()
+ current = hpa.Status.CurrentMetrics[i].Resource.Current.AverageValue.String()
}
- w.Write(LEVEL_0, ":\t%s / %s\n", current, metric.Resource.TargetAverageValue.String())
+ w.Write(LEVEL_0, ":\t%s / %s\n", current, metric.Resource.Target.AverageValue.String())
} else {
current := ""
- if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].Resource != nil && hpa.Status.CurrentMetrics[i].Resource.CurrentAverageUtilization != nil {
- current = fmt.Sprintf("%d%% (%s)", *hpa.Status.CurrentMetrics[i].Resource.CurrentAverageUtilization, hpa.Status.CurrentMetrics[i].Resource.CurrentAverageValue.String())
+ if len(hpa.Status.CurrentMetrics) > i && hpa.Status.CurrentMetrics[i].Resource != nil && hpa.Status.CurrentMetrics[i].Resource.Current.AverageUtilization != nil {
+ current = fmt.Sprintf("%d%% (%s)", *hpa.Status.CurrentMetrics[i].Resource.Current.AverageUtilization, hpa.Status.CurrentMetrics[i].Resource.Current.AverageValue.String())
}
target := ""
- if metric.Resource.TargetAverageUtilization != nil {
- target = fmt.Sprintf("%d%%", *metric.Resource.TargetAverageUtilization)
+ if metric.Resource.Target.AverageUtilization != nil {
+ target = fmt.Sprintf("%d%%", *metric.Resource.Target.AverageUtilization)
}
w.Write(LEVEL_1, "(as a percentage of request):\t%s / %s\n", current, target)
}
diff --git a/pkg/printers/internalversion/describe_test.go b/pkg/printers/internalversion/describe_test.go
index 7ad5cea385a..f11bc7f8b1a 100644
--- a/pkg/printers/internalversion/describe_test.go
+++ b/pkg/printers/internalversion/describe_test.go
@@ -1483,6 +1483,10 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
minReplicasVal := int32(2)
targetUtilizationVal := int32(80)
currentUtilizationVal := int32(50)
+ metricLabelSelector, err := metav1.ParseToLabelSelector("label=value")
+ if err != nil {
+ t.Errorf("unable to parse label selector: %v", err)
+ }
tests := []struct {
name string
hpa autoscaling.HorizontalPodAutoscaler
@@ -1517,13 +1521,14 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -1548,13 +1553,14 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -1566,13 +1572,13 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricStatus{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- CurrentAverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
},
},
},
@@ -1593,13 +1599,14 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -1624,13 +1631,14 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -1642,13 +1650,13 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricStatus{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Current: autoscaling.MetricValueStatus{
+ Value: resource.NewMilliQuantity(50, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- CurrentValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
},
},
},
@@ -1669,8 +1677,13 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1695,8 +1708,13 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1708,8 +1726,12 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricStatus{
- MetricName: "some-pods-metric",
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -1730,12 +1752,17 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1760,12 +1787,17 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1777,12 +1809,16 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricStatus{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- CurrentValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ Value: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -1803,8 +1839,11 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1829,8 +1868,11 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -1842,8 +1884,10 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
- Name: api.ResourceCPU,
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -1865,7 +1909,10 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
},
@@ -1891,7 +1938,10 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
},
@@ -1904,8 +1954,10 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
Name: api.ResourceCPU,
- CurrentAverageUtilization: ¤tUtilizationVal,
- CurrentAverageValue: *resource.NewMilliQuantity(40, resource.DecimalSI),
+ Current: autoscaling.MetricValueStatus{
+ AverageUtilization: ¤tUtilizationVal,
+ AverageValue: resource.NewMilliQuantity(40, resource.DecimalSI),
+ },
},
},
},
@@ -1926,22 +1978,35 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "other-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(400, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "other-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(400, resource.DecimalSI),
+ },
},
},
},
@@ -1953,16 +2018,22 @@ func TestDescribeHorizontalPodAutoscaler(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricStatus{
- MetricName: "some-pods-metric",
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
Name: api.ResourceCPU,
- CurrentAverageUtilization: ¤tUtilizationVal,
- CurrentAverageValue: *resource.NewMilliQuantity(40, resource.DecimalSI),
+ Current: autoscaling.MetricValueStatus{
+ AverageUtilization: ¤tUtilizationVal,
+ AverageValue: resource.NewMilliQuantity(40, resource.DecimalSI),
+ },
},
},
},
diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go
index 311d8d92c5d..cb4a3e07e97 100644
--- a/pkg/printers/internalversion/printers.go
+++ b/pkg/printers/internalversion/printers.go
@@ -1580,47 +1580,47 @@ func formatHPAMetrics(specs []autoscaling.MetricSpec, statuses []autoscaling.Met
for i, spec := range specs {
switch spec.Type {
case autoscaling.ExternalMetricSourceType:
- if spec.External.TargetAverageValue != nil {
+ if spec.External.Target.AverageValue != nil {
current := ""
- if len(statuses) > i && statuses[i].External != nil && statuses[i].External.CurrentAverageValue != nil {
- current = statuses[i].External.CurrentAverageValue.String()
+ if len(statuses) > i && statuses[i].External != nil && &statuses[i].External.Current.AverageValue != nil {
+ current = statuses[i].External.Current.AverageValue.String()
}
- list = append(list, fmt.Sprintf("%s/%s (avg)", current, spec.External.TargetAverageValue.String()))
+ list = append(list, fmt.Sprintf("%s/%s (avg)", current, spec.External.Target.AverageValue.String()))
} else {
current := ""
if len(statuses) > i && statuses[i].External != nil {
- current = statuses[i].External.CurrentValue.String()
+ current = statuses[i].External.Current.Value.String()
}
- list = append(list, fmt.Sprintf("%s/%s", current, spec.External.TargetValue.String()))
+ list = append(list, fmt.Sprintf("%s/%s", current, spec.External.Target.Value.String()))
}
case autoscaling.PodsMetricSourceType:
current := ""
if len(statuses) > i && statuses[i].Pods != nil {
- current = statuses[i].Pods.CurrentAverageValue.String()
+ current = statuses[i].Pods.Current.AverageValue.String()
}
- list = append(list, fmt.Sprintf("%s/%s", current, spec.Pods.TargetAverageValue.String()))
+ list = append(list, fmt.Sprintf("%s/%s", current, spec.Pods.Target.AverageValue.String()))
case autoscaling.ObjectMetricSourceType:
current := ""
if len(statuses) > i && statuses[i].Object != nil {
- current = statuses[i].Object.CurrentValue.String()
+ current = statuses[i].Object.Current.Value.String()
}
- list = append(list, fmt.Sprintf("%s/%s", current, spec.Object.TargetValue.String()))
+ list = append(list, fmt.Sprintf("%s/%s", current, spec.Object.Target.Value.String()))
case autoscaling.ResourceMetricSourceType:
- if spec.Resource.TargetAverageValue != nil {
+ if spec.Resource.Target.AverageValue != nil {
current := ""
if len(statuses) > i && statuses[i].Resource != nil {
- current = statuses[i].Resource.CurrentAverageValue.String()
+ current = statuses[i].Resource.Current.AverageValue.String()
}
- list = append(list, fmt.Sprintf("%s/%s", current, spec.Resource.TargetAverageValue.String()))
+ list = append(list, fmt.Sprintf("%s/%s", current, spec.Resource.Target.AverageValue.String()))
} else {
current := ""
- if len(statuses) > i && statuses[i].Resource != nil && statuses[i].Resource.CurrentAverageUtilization != nil {
- current = fmt.Sprintf("%d%%", *statuses[i].Resource.CurrentAverageUtilization)
+ if len(statuses) > i && statuses[i].Resource != nil && statuses[i].Resource.Current.AverageUtilization != nil {
+ current = fmt.Sprintf("%d%%", *statuses[i].Resource.Current.AverageUtilization)
}
target := ""
- if spec.Resource.TargetAverageUtilization != nil {
- target = fmt.Sprintf("%d%%", *spec.Resource.TargetAverageUtilization)
+ if spec.Resource.Target.AverageUtilization != nil {
+ target = fmt.Sprintf("%d%%", *spec.Resource.Target.AverageUtilization)
}
list = append(list, fmt.Sprintf("%s/%s", current, target))
}
diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go
index b8968dd57d3..817a451699a 100644
--- a/pkg/printers/internalversion/printers_test.go
+++ b/pkg/printers/internalversion/printers_test.go
@@ -2172,6 +2172,10 @@ func TestPrintHPA(t *testing.T) {
minReplicasVal := int32(2)
targetUtilizationVal := int32(80)
currentUtilizationVal := int32(50)
+ metricLabelSelector, err := metav1.ParseToLabelSelector("label=value")
+ if err != nil {
+ t.Errorf("unable to parse label selector: %v", err)
+ }
tests := []struct {
hpa autoscaling.HorizontalPodAutoscaler
expected string
@@ -2209,13 +2213,14 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -2242,13 +2247,14 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -2260,13 +2266,13 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricStatus{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- CurrentAverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
},
},
},
@@ -2289,13 +2295,14 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-service-metric",
- TargetValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -2322,13 +2329,14 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricSource{
- MetricSelector: &metav1.LabelSelector{
- MatchLabels: map[string]string{
- "label": "value",
- },
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ Selector: metricLabelSelector,
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
},
- MetricName: "some-external-metric",
- TargetValue: resource.NewMilliQuantity(100, resource.DecimalSI),
},
},
},
@@ -2340,8 +2348,12 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ExternalMetricSourceType,
External: &autoscaling.ExternalMetricStatus{
- MetricName: "some-external-metric",
- CurrentValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-external-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ Value: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -2364,8 +2376,13 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2392,8 +2409,13 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2405,8 +2427,12 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricStatus{
- MetricName: "some-pods-metric",
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -2429,12 +2455,17 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2461,12 +2492,17 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricSource{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.ValueMetricType,
+ Value: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2478,12 +2514,16 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ObjectMetricSourceType,
Object: &autoscaling.ObjectMetricStatus{
- Target: autoscaling.CrossVersionObjectReference{
+ DescribedObject: autoscaling.CrossVersionObjectReference{
Name: "some-service",
Kind: "Service",
},
- MetricName: "some-service-metric",
- CurrentValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-service-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ Value: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -2506,8 +2546,11 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2534,8 +2577,11 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
- Name: api.ResourceCPU,
- TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
},
@@ -2547,8 +2593,10 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
- Name: api.ResourceCPU,
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Name: api.ResourceCPU,
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
},
@@ -2572,7 +2620,10 @@ func TestPrintHPA(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
},
@@ -2600,7 +2651,10 @@ func TestPrintHPA(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
},
@@ -2613,8 +2667,10 @@ func TestPrintHPA(t *testing.T) {
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
Name: api.ResourceCPU,
- CurrentAverageUtilization: ¤tUtilizationVal,
- CurrentAverageValue: *resource.NewMilliQuantity(40, resource.DecimalSI),
+ Current: autoscaling.MetricValueStatus{
+ AverageUtilization: ¤tUtilizationVal,
+ AverageValue: resource.NewMilliQuantity(40, resource.DecimalSI),
+ },
},
},
},
@@ -2637,22 +2693,35 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "some-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &targetUtilizationVal,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &targetUtilizationVal,
+ },
},
},
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricSource{
- MetricName: "other-pods-metric",
- TargetAverageValue: *resource.NewMilliQuantity(400, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "other-pods-metric",
+ },
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.AverageValueMetricType,
+ AverageValue: resource.NewMilliQuantity(400, resource.DecimalSI),
+ },
},
},
},
@@ -2664,16 +2733,22 @@ func TestPrintHPA(t *testing.T) {
{
Type: autoscaling.PodsMetricSourceType,
Pods: &autoscaling.PodsMetricStatus{
- MetricName: "some-pods-metric",
- CurrentAverageValue: *resource.NewMilliQuantity(50, resource.DecimalSI),
+ Metric: autoscaling.MetricIdentifier{
+ Name: "some-pods-metric",
+ },
+ Current: autoscaling.MetricValueStatus{
+ AverageValue: resource.NewMilliQuantity(50, resource.DecimalSI),
+ },
},
},
{
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricStatus{
Name: api.ResourceCPU,
- CurrentAverageUtilization: ¤tUtilizationVal,
- CurrentAverageValue: *resource.NewMilliQuantity(40, resource.DecimalSI),
+ Current: autoscaling.MetricValueStatus{
+ AverageUtilization: ¤tUtilizationVal,
+ AverageValue: resource.NewMilliQuantity(40, resource.DecimalSI),
+ },
},
},
},
diff --git a/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go b/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go
index ab0a55defaf..a68d270b768 100644
--- a/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go
+++ b/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage_test.go
@@ -67,7 +67,10 @@ func validNewHorizontalPodAutoscaler(name string) *autoscaling.HorizontalPodAuto
Type: autoscaling.ResourceMetricSourceType,
Resource: &autoscaling.ResourceMetricSource{
Name: api.ResourceCPU,
- TargetAverageUtilization: &cpu,
+ Target: autoscaling.MetricTarget{
+ Type: autoscaling.UtilizationMetricType,
+ AverageUtilization: &cpu,
+ },
},
},
},
diff --git a/pkg/registry/autoscaling/rest/BUILD b/pkg/registry/autoscaling/rest/BUILD
index 84f299f1398..cc96b1f38c8 100644
--- a/pkg/registry/autoscaling/rest/BUILD
+++ b/pkg/registry/autoscaling/rest/BUILD
@@ -12,6 +12,7 @@ go_library(
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
+ "//pkg/apis/autoscaling/v2beta2:go_default_library",
"//pkg/registry/autoscaling/horizontalpodautoscaler/storage:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
diff --git a/pkg/registry/autoscaling/rest/storage_autoscaling.go b/pkg/registry/autoscaling/rest/storage_autoscaling.go
index 021beb07042..b4e527c27ae 100644
--- a/pkg/registry/autoscaling/rest/storage_autoscaling.go
+++ b/pkg/registry/autoscaling/rest/storage_autoscaling.go
@@ -25,6 +25,7 @@ import (
serverstorage "k8s.io/apiserver/pkg/server/storage"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/autoscaling"
+ autoscalingapiv2beta2 "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2"
horizontalpodautoscalerstore "k8s.io/kubernetes/pkg/registry/autoscaling/horizontalpodautoscaler/storage"
)
@@ -35,6 +36,9 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
// If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities.
// TODO refactor the plumbing to provide the information in the APIGroupInfo
+ if apiResourceConfigSource.VersionEnabled(autoscalingapiv2beta2.SchemeGroupVersion) {
+ apiGroupInfo.VersionedResourcesStorageMap[autoscalingapiv2beta2.SchemeGroupVersion.Version] = p.v2beta2Storage(apiResourceConfigSource, restOptionsGetter)
+ }
if apiResourceConfigSource.VersionEnabled(autoscalingapiv2beta1.SchemeGroupVersion) {
apiGroupInfo.VersionedResourcesStorageMap[autoscalingapiv2beta1.SchemeGroupVersion.Version] = p.v2beta1Storage(apiResourceConfigSource, restOptionsGetter)
}
@@ -65,6 +69,16 @@ func (p RESTStorageProvider) v2beta1Storage(apiResourceConfigSource serverstorag
return storage
}
+func (p RESTStorageProvider) v2beta2Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) map[string]rest.Storage {
+ storage := map[string]rest.Storage{}
+ // horizontalpodautoscalers
+ hpaStorage, hpaStatusStorage := horizontalpodautoscalerstore.NewREST(restOptionsGetter)
+ storage["horizontalpodautoscalers"] = hpaStorage
+ storage["horizontalpodautoscalers/status"] = hpaStatusStorage
+
+ return storage
+}
+
func (p RESTStorageProvider) GroupName() string {
return autoscaling.GroupName
}
diff --git a/staging/src/BUILD b/staging/src/BUILD
index 2122eaf6ff9..965c193e808 100644
--- a/staging/src/BUILD
+++ b/staging/src/BUILD
@@ -132,6 +132,7 @@ filegroup(
"//staging/src/k8s.io/client-go/listers/authorization/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/listers/autoscaling/v1:all-srcs",
"//staging/src/k8s.io/client-go/listers/autoscaling/v2beta1:all-srcs",
+ "//staging/src/k8s.io/client-go/listers/autoscaling/v2beta2:all-srcs",
"//staging/src/k8s.io/client-go/listers/batch/v1:all-srcs",
"//staging/src/k8s.io/client-go/listers/batch/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/listers/batch/v2alpha1:all-srcs",
diff --git a/staging/src/k8s.io/api/BUILD b/staging/src/k8s.io/api/BUILD
index fbcac21668d..482955e4149 100644
--- a/staging/src/k8s.io/api/BUILD
+++ b/staging/src/k8s.io/api/BUILD
@@ -69,6 +69,7 @@ filegroup(
"//staging/src/k8s.io/api/authorization/v1beta1:all-srcs",
"//staging/src/k8s.io/api/autoscaling/v1:all-srcs",
"//staging/src/k8s.io/api/autoscaling/v2beta1:all-srcs",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:all-srcs",
"//staging/src/k8s.io/api/batch/v1:all-srcs",
"//staging/src/k8s.io/api/batch/v1beta1:all-srcs",
"//staging/src/k8s.io/api/batch/v2alpha1:all-srcs",
diff --git a/staging/src/k8s.io/api/autoscaling/v1/generated.pb.go b/staging/src/k8s.io/api/autoscaling/v1/generated.pb.go
index 8d67ef976db..47a46a5574e 100644
--- a/staging/src/k8s.io/api/autoscaling/v1/generated.pb.go
+++ b/staging/src/k8s.io/api/autoscaling/v1/generated.pb.go
@@ -675,6 +675,26 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) {
return 0, err
}
i += n23
+ if m.Selector != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n24, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n24
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n25, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n25
+ }
return i, nil
}
@@ -696,11 +716,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
- n24, err := m.Target.MarshalTo(dAtA[i:])
+ n26, err := m.Target.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n24
+ i += n26
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName)))
@@ -708,11 +728,31 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size()))
- n25, err := m.CurrentValue.MarshalTo(dAtA[i:])
+ n27, err := m.CurrentValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n25
+ i += n27
+ if m.Selector != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n28, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n28
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n29, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n29
+ }
return i, nil
}
@@ -738,11 +778,21 @@ func (m *PodsMetricSource) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size()))
- n26, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
+ n30, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n26
+ i += n30
+ if m.Selector != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n31, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n31
+ }
return i, nil
}
@@ -768,11 +818,21 @@ func (m *PodsMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size()))
- n27, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
+ n32, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n27
+ i += n32
+ if m.Selector != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n33, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n33
+ }
return i, nil
}
@@ -804,11 +864,11 @@ func (m *ResourceMetricSource) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size()))
- n28, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
+ n34, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n28
+ i += n34
}
return i, nil
}
@@ -840,11 +900,11 @@ func (m *ResourceMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size()))
- n29, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
+ n35, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n29
+ i += n35
return i, nil
}
@@ -866,27 +926,27 @@ func (m *Scale) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size()))
- n30, err := m.ObjectMeta.MarshalTo(dAtA[i:])
+ n36, err := m.ObjectMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n30
+ i += n36
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size()))
- n31, err := m.Spec.MarshalTo(dAtA[i:])
+ n37, err := m.Spec.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n31
+ i += n37
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size()))
- n32, err := m.Status.MarshalTo(dAtA[i:])
+ n38, err := m.Status.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n32
+ i += n38
return i, nil
}
@@ -1145,6 +1205,14 @@ func (m *ObjectMetricSource) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.TargetValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1157,6 +1225,14 @@ func (m *ObjectMetricStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.CurrentValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1167,6 +1243,10 @@ func (m *PodsMetricSource) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.TargetAverageValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1177,6 +1257,10 @@ func (m *PodsMetricStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.CurrentAverageValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1387,6 +1471,8 @@ func (this *ObjectMetricSource) String() string {
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`TargetValue:` + strings.Replace(strings.Replace(this.TargetValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
`}`,
}, "")
return s
@@ -1399,6 +1485,8 @@ func (this *ObjectMetricStatus) String() string {
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`CurrentValue:` + strings.Replace(strings.Replace(this.CurrentValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
`}`,
}, "")
return s
@@ -1410,6 +1498,7 @@ func (this *PodsMetricSource) String() string {
s := strings.Join([]string{`&PodsMetricSource{`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`TargetAverageValue:` + strings.Replace(strings.Replace(this.TargetAverageValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@@ -1421,6 +1510,7 @@ func (this *PodsMetricStatus) String() string {
s := strings.Join([]string{`&PodsMetricStatus{`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`CurrentAverageValue:` + strings.Replace(strings.Replace(this.CurrentAverageValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@@ -3267,6 +3357,72 @@ func (m *ObjectMetricSource) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3406,6 +3562,72 @@ func (m *ObjectMetricStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3515,6 +3737,39 @@ func (m *PodsMetricSource) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3624,6 +3879,39 @@ func (m *PodsMetricStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -4323,97 +4611,100 @@ func init() {
}
var fileDescriptorGenerated = []byte{
- // 1471 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x4b, 0x6f, 0x14, 0xc7,
- 0x13, 0xf7, 0x3e, 0x6c, 0xec, 0x5e, 0x63, 0xf3, 0x6f, 0x10, 0x18, 0xf3, 0x67, 0xc7, 0x9a, 0x20,
- 0x44, 0x1e, 0xcc, 0xc6, 0x0e, 0x41, 0xe4, 0xe8, 0xdd, 0x84, 0x80, 0xe2, 0x05, 0xd3, 0x36, 0x84,
- 0x3c, 0x14, 0xd1, 0x9e, 0x6d, 0xd6, 0x8d, 0x77, 0x66, 0x56, 0x3d, 0xbd, 0x2b, 0x8c, 0x14, 0x29,
- 0x39, 0xe4, 0x9c, 0x28, 0x52, 0xa2, 0x1c, 0xf3, 0x05, 0x72, 0xe6, 0x9c, 0x48, 0x91, 0x38, 0x72,
- 0xc8, 0x81, 0xd3, 0x28, 0x4c, 0x8e, 0xf9, 0x06, 0x9c, 0xa2, 0x7e, 0xec, 0xec, 0xcc, 0xee, 0xcc,
- 0xfa, 0x81, 0xb1, 0x92, 0xdb, 0xf4, 0x54, 0xd5, 0xaf, 0xba, 0xab, 0xaa, 0xeb, 0xd1, 0xa0, 0xba,
- 0x75, 0xc5, 0xb7, 0xa8, 0x57, 0xd9, 0xea, 0x6c, 0x10, 0xe6, 0x12, 0x4e, 0xfc, 0x4a, 0x97, 0xb8,
- 0x0d, 0x8f, 0x55, 0x34, 0x01, 0xb7, 0x69, 0x05, 0x77, 0xb8, 0xe7, 0xdb, 0xb8, 0x45, 0xdd, 0x66,
- 0xa5, 0xbb, 0x58, 0x69, 0x12, 0x97, 0x30, 0xcc, 0x49, 0xc3, 0x6a, 0x33, 0x8f, 0x7b, 0xf0, 0xb4,
- 0x62, 0xb5, 0x70, 0x9b, 0x5a, 0x31, 0x56, 0xab, 0xbb, 0x38, 0x7f, 0xb1, 0x49, 0xf9, 0x66, 0x67,
- 0xc3, 0xb2, 0x3d, 0xa7, 0xd2, 0xf4, 0x9a, 0x5e, 0x45, 0x4a, 0x6c, 0x74, 0xee, 0xcb, 0x95, 0x5c,
- 0xc8, 0x2f, 0x85, 0x34, 0x6f, 0xc6, 0x94, 0xda, 0x1e, 0x23, 0x29, 0xda, 0xe6, 0x2f, 0xf5, 0x79,
- 0x1c, 0x6c, 0x6f, 0x52, 0x97, 0xb0, 0xed, 0x4a, 0x7b, 0xab, 0x29, 0x85, 0x18, 0xf1, 0xbd, 0x0e,
- 0xb3, 0xc9, 0x9e, 0xa4, 0xfc, 0x8a, 0x43, 0x38, 0x4e, 0xd3, 0x55, 0xc9, 0x92, 0x62, 0x1d, 0x97,
- 0x53, 0x67, 0x58, 0xcd, 0xe5, 0x9d, 0x04, 0x7c, 0x7b, 0x93, 0x38, 0x78, 0x50, 0xce, 0xfc, 0x21,
- 0x07, 0xce, 0xd4, 0x98, 0xe7, 0xfb, 0x77, 0x08, 0xf3, 0xa9, 0xe7, 0xde, 0xdc, 0x78, 0x40, 0x6c,
- 0x8e, 0xc8, 0x7d, 0xc2, 0x88, 0x6b, 0x13, 0xb8, 0x00, 0x8a, 0x5b, 0xd4, 0x6d, 0xcc, 0xe5, 0x16,
- 0x72, 0x17, 0xa6, 0xaa, 0xd3, 0x4f, 0x02, 0x63, 0x2c, 0x0c, 0x8c, 0xe2, 0x47, 0xd4, 0x6d, 0x20,
- 0x49, 0x11, 0x1c, 0x2e, 0x76, 0xc8, 0x5c, 0x3e, 0xc9, 0x71, 0x03, 0x3b, 0x04, 0x49, 0x0a, 0x5c,
- 0x02, 0x00, 0xb7, 0xa9, 0x56, 0x30, 0x57, 0x90, 0x7c, 0x50, 0xf3, 0x81, 0xe5, 0xd5, 0xeb, 0x9a,
- 0x82, 0x62, 0x5c, 0xe6, 0x8f, 0x05, 0x70, 0xe2, 0x83, 0x87, 0x9c, 0x30, 0x17, 0xb7, 0xea, 0x84,
- 0x33, 0x6a, 0xaf, 0x49, 0xfb, 0x0a, 0x30, 0x47, 0xae, 0x85, 0x02, 0xbd, 0xad, 0x08, 0xac, 0x1e,
- 0x51, 0x50, 0x8c, 0x0b, 0x7a, 0x60, 0x46, 0xad, 0xd6, 0x48, 0x8b, 0xd8, 0xdc, 0x63, 0x72, 0xb3,
- 0xa5, 0xa5, 0x77, 0xac, 0x7e, 0x00, 0x45, 0x56, 0xb3, 0xda, 0x5b, 0x4d, 0xf1, 0xc3, 0xb7, 0x84,
- 0x73, 0xac, 0xee, 0xa2, 0xb5, 0x82, 0x37, 0x48, 0xab, 0x27, 0x5a, 0x85, 0x61, 0x60, 0xcc, 0xd4,
- 0x13, 0x70, 0x68, 0x00, 0x1e, 0x62, 0x50, 0xe2, 0x98, 0x35, 0x09, 0xbf, 0x83, 0x5b, 0x1d, 0x22,
- 0x8f, 0x5c, 0x5a, 0xb2, 0x46, 0x69, 0xb3, 0x7a, 0x01, 0x64, 0xdd, 0xea, 0x60, 0x97, 0x53, 0xbe,
- 0x5d, 0x9d, 0x0d, 0x03, 0xa3, 0xb4, 0xde, 0x87, 0x41, 0x71, 0x4c, 0xd8, 0x05, 0x50, 0x2d, 0x97,
- 0xbb, 0x84, 0xe1, 0x26, 0x51, 0x9a, 0x8a, 0xfb, 0xd2, 0x74, 0x32, 0x0c, 0x0c, 0xb8, 0x3e, 0x84,
- 0x86, 0x52, 0x34, 0x98, 0x3f, 0x0f, 0x3b, 0x86, 0x63, 0xde, 0xf1, 0xff, 0x1b, 0x8e, 0xd9, 0x04,
- 0xd3, 0x76, 0x87, 0x31, 0xe2, 0xbe, 0x94, 0x67, 0x4e, 0xe8, 0x63, 0x4d, 0xd7, 0x62, 0x58, 0x28,
- 0x81, 0x0c, 0xb7, 0xc1, 0x71, 0xbd, 0x3e, 0x00, 0x07, 0x9d, 0x0a, 0x03, 0xe3, 0x78, 0x6d, 0x18,
- 0x0e, 0xa5, 0xe9, 0x30, 0x1f, 0xe7, 0xc1, 0xa9, 0x6b, 0x1e, 0xa3, 0x8f, 0x3c, 0x97, 0xe3, 0xd6,
- 0xaa, 0xd7, 0x58, 0xd6, 0xb9, 0x91, 0x30, 0x78, 0x0f, 0x4c, 0x0a, 0xeb, 0x35, 0x30, 0xc7, 0xd2,
- 0x47, 0xa5, 0xa5, 0xb7, 0x77, 0x67, 0x6b, 0x95, 0x18, 0xea, 0x84, 0xe3, 0xbe, 0x57, 0xfb, 0xff,
- 0x50, 0x84, 0x0a, 0xef, 0x82, 0xa2, 0xdf, 0x26, 0xb6, 0xf6, 0xe4, 0x65, 0x2b, 0x33, 0x47, 0x5b,
- 0x19, 0x7b, 0x5c, 0x6b, 0x13, 0xbb, 0x9f, 0x47, 0xc4, 0x0a, 0x49, 0x44, 0x78, 0x0f, 0x4c, 0xf8,
- 0x32, 0xd6, 0xb4, 0xdb, 0xae, 0xec, 0x03, 0x5b, 0xca, 0x57, 0x67, 0x34, 0xfa, 0x84, 0x5a, 0x23,
- 0x8d, 0x6b, 0x7e, 0x53, 0x00, 0x0b, 0x19, 0x92, 0x35, 0xcf, 0x6d, 0x50, 0x4e, 0x3d, 0x17, 0x5e,
- 0x03, 0x45, 0xbe, 0xdd, 0xee, 0x85, 0xf8, 0xa5, 0xde, 0x46, 0xd7, 0xb7, 0xdb, 0xe4, 0x45, 0x60,
- 0x9c, 0xdb, 0x49, 0x5e, 0xf0, 0x21, 0x89, 0x00, 0x57, 0xa2, 0x03, 0xe5, 0x13, 0x58, 0x7a, 0x5b,
- 0x2f, 0x02, 0x23, 0xa5, 0x2e, 0x59, 0x11, 0x52, 0x72, 0xf3, 0x22, 0x23, 0xb4, 0xb0, 0xcf, 0xd7,
- 0x19, 0x76, 0x7d, 0xa5, 0x89, 0x3a, 0xbd, 0x08, 0x7f, 0x63, 0x77, 0x4e, 0x16, 0x12, 0xd5, 0x79,
- 0xbd, 0x0b, 0xb8, 0x32, 0x84, 0x86, 0x52, 0x34, 0xc0, 0xf3, 0x60, 0x82, 0x11, 0xec, 0x7b, 0xae,
- 0x0c, 0xee, 0xa9, 0xbe, 0x71, 0x91, 0xfc, 0x8b, 0x34, 0x15, 0xbe, 0x0e, 0x8e, 0x38, 0xc4, 0xf7,
- 0x71, 0x93, 0xcc, 0x8d, 0x4b, 0xc6, 0x59, 0xcd, 0x78, 0xa4, 0xae, 0x7e, 0xa3, 0x1e, 0xdd, 0xfc,
- 0x23, 0x07, 0xce, 0x64, 0xd8, 0x71, 0x85, 0xfa, 0x1c, 0x7e, 0x3e, 0x14, 0xc5, 0xd6, 0x2e, 0x33,
- 0x06, 0xf5, 0x55, 0x0c, 0x1f, 0xd3, 0xba, 0x27, 0x7b, 0x7f, 0x62, 0x11, 0xfc, 0x31, 0x18, 0xa7,
- 0x9c, 0x38, 0xc2, 0x2b, 0x85, 0x0b, 0xa5, 0xa5, 0xa5, 0xbd, 0x87, 0x59, 0xf5, 0xa8, 0x86, 0x1f,
- 0xbf, 0x2e, 0x80, 0x90, 0xc2, 0x33, 0xff, 0xce, 0x67, 0x1e, 0x4b, 0x84, 0x39, 0xec, 0x82, 0x19,
- 0xb9, 0x52, 0xa9, 0x18, 0x91, 0xfb, 0xfa, 0x70, 0xa3, 0x2e, 0xd1, 0x88, 0xe2, 0x5d, 0x3d, 0xa9,
- 0x77, 0x31, 0xb3, 0x96, 0x40, 0x45, 0x03, 0x5a, 0xe0, 0x22, 0x28, 0x39, 0xd4, 0x45, 0xa4, 0xdd,
- 0xa2, 0x36, 0x56, 0xc1, 0x38, 0xae, 0xca, 0x4f, 0xbd, 0xff, 0x1b, 0xc5, 0x79, 0xe0, 0xbb, 0xa0,
- 0xe4, 0xe0, 0x87, 0x91, 0x48, 0x41, 0x8a, 0x1c, 0xd7, 0xfa, 0x4a, 0xf5, 0x3e, 0x09, 0xc5, 0xf9,
- 0xe0, 0x03, 0x50, 0x56, 0x35, 0xa5, 0xb6, 0x7a, 0xfb, 0x36, 0xa7, 0x2d, 0xfa, 0x08, 0x8b, 0x38,
- 0x5a, 0x25, 0xcc, 0x26, 0x2e, 0x17, 0xa1, 0x51, 0x94, 0x48, 0x66, 0x18, 0x18, 0xe5, 0xf5, 0x91,
- 0x9c, 0x68, 0x07, 0x24, 0xf3, 0xd7, 0x02, 0x38, 0x3b, 0x32, 0x0d, 0xc0, 0xab, 0x00, 0x7a, 0x1b,
- 0x3e, 0x61, 0x5d, 0xd2, 0xf8, 0x50, 0xf5, 0x45, 0xa2, 0x41, 0x11, 0x36, 0x2f, 0xa8, 0x9a, 0x78,
- 0x73, 0x88, 0x8a, 0x52, 0x24, 0xa0, 0x0d, 0x8e, 0x8a, 0x7b, 0xa1, 0xac, 0x4c, 0x75, 0x2f, 0xb4,
- 0xb7, 0x4b, 0xf7, 0xbf, 0x30, 0x30, 0x8e, 0xae, 0xc4, 0x41, 0x50, 0x12, 0x13, 0x2e, 0x83, 0x59,
- 0x9d, 0xec, 0x07, 0xac, 0x7e, 0x4a, 0x5b, 0x7d, 0xb6, 0x96, 0x24, 0xa3, 0x41, 0x7e, 0x01, 0xd1,
- 0x20, 0x3e, 0x65, 0xa4, 0x11, 0x41, 0x14, 0x93, 0x10, 0xef, 0x27, 0xc9, 0x68, 0x90, 0x1f, 0x3a,
- 0xc0, 0xd0, 0xa8, 0x99, 0x1e, 0x1c, 0x97, 0x90, 0xaf, 0x85, 0x81, 0x61, 0xd4, 0x46, 0xb3, 0xa2,
- 0x9d, 0xb0, 0x44, 0x1b, 0xa8, 0x7b, 0x07, 0x79, 0x41, 0x2e, 0x25, 0x52, 0xef, 0xc2, 0x40, 0xea,
- 0x3d, 0x16, 0x6f, 0x14, 0x63, 0x69, 0xf6, 0x16, 0x98, 0xf0, 0xe4, 0xcd, 0xd0, 0x7e, 0xb9, 0x38,
- 0xe2, 0x3a, 0x45, 0x25, 0x2d, 0x02, 0xaa, 0x02, 0x91, 0xcb, 0xf4, 0xd5, 0xd2, 0x40, 0xf0, 0x3a,
- 0x28, 0xb6, 0xbd, 0x46, 0xaf, 0x10, 0xbd, 0x39, 0x02, 0x70, 0xd5, 0x6b, 0xf8, 0x09, 0xb8, 0x49,
- 0xb1, 0x63, 0xf1, 0x17, 0x49, 0x08, 0xf8, 0x09, 0x98, 0xec, 0x15, 0x7c, 0xdd, 0x1d, 0x54, 0x46,
- 0xc0, 0x21, 0xcd, 0x9a, 0x80, 0x9c, 0x16, 0x89, 0xac, 0x47, 0x41, 0x11, 0x9c, 0x80, 0x26, 0xba,
- 0x55, 0x93, 0x5e, 0x19, 0x0d, 0x9d, 0xd6, 0x6e, 0x2b, 0xe8, 0x1e, 0x05, 0x45, 0x70, 0xe6, 0x4f,
- 0x05, 0x30, 0x9d, 0x68, 0xff, 0x0e, 0xd9, 0x35, 0xaa, 0x8e, 0x1f, 0x98, 0x6b, 0x14, 0xdc, 0x81,
- 0xba, 0x46, 0x41, 0xbe, 0x12, 0xd7, 0xc4, 0xa0, 0x53, 0x5c, 0xf3, 0x6d, 0x1e, 0xc0, 0xe1, 0x30,
- 0x86, 0x5f, 0x80, 0x09, 0x95, 0x30, 0x5f, 0xb2, 0xa8, 0x44, 0xe5, 0x5d, 0xd7, 0x0f, 0x8d, 0x3a,
- 0xd0, 0xff, 0xe7, 0x77, 0xd5, 0xff, 0x93, 0x83, 0x98, 0x93, 0xa2, 0xaa, 0x93, 0x35, 0x2b, 0x99,
- 0xdf, 0x0f, 0x5a, 0x44, 0x85, 0xec, 0xbf, 0xd1, 0x22, 0x87, 0x36, 0xa0, 0x98, 0xbf, 0xe5, 0xc0,
- 0xb1, 0xc1, 0xe4, 0xb4, 0xaf, 0x21, 0xee, 0x51, 0xea, 0x24, 0x9a, 0xdf, 0xd7, 0xc6, 0xa3, 0xde,
- 0x73, 0x97, 0xd3, 0xe8, 0xef, 0xc9, 0x43, 0xec, 0x7f, 0x12, 0xfd, 0x32, 0x7d, 0x5c, 0xdb, 0xdf,
- 0x29, 0xce, 0x68, 0x65, 0xbb, 0x1f, 0xd9, 0x7e, 0xc9, 0x83, 0x13, 0x69, 0xa9, 0x1d, 0xd6, 0xf4,
- 0xeb, 0x8a, 0x3a, 0x45, 0x25, 0xfe, 0xba, 0xf2, 0x22, 0x30, 0x8c, 0x94, 0xf1, 0xa0, 0x07, 0x13,
- 0x7b, 0x80, 0xb9, 0x0b, 0xe6, 0x12, 0xb6, 0x8b, 0xd5, 0x5a, 0xdd, 0xec, 0xfd, 0x3f, 0x0c, 0x8c,
- 0xb9, 0xf5, 0x0c, 0x1e, 0x94, 0x29, 0x9d, 0xf1, 0x0a, 0x51, 0x78, 0xe5, 0xaf, 0x10, 0x8f, 0x87,
- 0xed, 0xa5, 0x7c, 0x7f, 0x20, 0xf6, 0xfa, 0x0c, 0x9c, 0x4e, 0x3a, 0x69, 0xd8, 0x60, 0x67, 0xc3,
- 0xc0, 0x38, 0x5d, 0xcb, 0x62, 0x42, 0xd9, 0xf2, 0x59, 0x91, 0x56, 0x38, 0xa4, 0x48, 0xfb, 0x3a,
- 0x0f, 0xc6, 0x65, 0x53, 0x79, 0x08, 0x4f, 0x01, 0x57, 0x13, 0x4f, 0x01, 0xe7, 0x46, 0xa4, 0x57,
- 0xb9, 0xa3, 0xcc, 0xc1, 0xff, 0xc6, 0xc0, 0xe0, 0x7f, 0x7e, 0x47, 0xa4, 0xd1, 0x63, 0xfe, 0x7b,
- 0x60, 0x2a, 0x52, 0x08, 0xdf, 0x12, 0x45, 0x5e, 0x77, 0xc3, 0x39, 0xe9, 0xdb, 0x68, 0x36, 0x8c,
- 0xda, 0xe0, 0x88, 0xc3, 0xa4, 0xa0, 0x14, 0xd3, 0xb0, 0x37, 0x61, 0xc1, 0xed, 0xc7, 0x1f, 0xba,
- 0xa6, 0xfa, 0xdc, 0xd1, 0x8b, 0x55, 0xc4, 0x51, 0xbd, 0xf0, 0xe4, 0x79, 0x79, 0xec, 0xe9, 0xf3,
- 0xf2, 0xd8, 0xb3, 0xe7, 0xe5, 0xb1, 0xaf, 0xc2, 0x72, 0xee, 0x49, 0x58, 0xce, 0x3d, 0x0d, 0xcb,
- 0xb9, 0x67, 0x61, 0x39, 0xf7, 0x67, 0x58, 0xce, 0x7d, 0xf7, 0x57, 0x79, 0xec, 0xd3, 0x7c, 0x77,
- 0xf1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x5f, 0x69, 0x0c, 0x4c, 0x17, 0x00, 0x00,
+ // 1516 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6f, 0x13, 0xc7,
+ 0x17, 0x8f, 0x7f, 0x24, 0x24, 0xe3, 0x90, 0xe4, 0x3b, 0x20, 0x08, 0xe1, 0x8b, 0x37, 0xda, 0x22,
+ 0x44, 0x7f, 0xb0, 0x6e, 0x52, 0x8a, 0xe8, 0x31, 0x76, 0x4b, 0x41, 0x8d, 0x21, 0x4c, 0x02, 0xa5,
+ 0x3f, 0xc5, 0x64, 0x3d, 0x38, 0x43, 0xbc, 0xbb, 0xd6, 0xec, 0xd8, 0x22, 0x48, 0x95, 0xda, 0x43,
+ 0xef, 0xbd, 0xb4, 0xea, 0xb1, 0x95, 0x7a, 0xed, 0x99, 0x73, 0x6f, 0x1c, 0x39, 0x20, 0x95, 0xd3,
+ 0xaa, 0x6c, 0x8f, 0xfd, 0x0f, 0x38, 0x55, 0xf3, 0xc3, 0xeb, 0x5d, 0xdb, 0xeb, 0x24, 0x26, 0x44,
+ 0x6d, 0x6f, 0x3b, 0x33, 0xef, 0x7d, 0xde, 0xec, 0x7b, 0x6f, 0xde, 0x2f, 0x50, 0xde, 0xbe, 0xec,
+ 0x5b, 0xd4, 0x2b, 0x6d, 0xb7, 0x36, 0x09, 0x73, 0x09, 0x27, 0x7e, 0xa9, 0x4d, 0xdc, 0x9a, 0xc7,
+ 0x4a, 0xfa, 0x00, 0x37, 0x69, 0x09, 0xb7, 0xb8, 0xe7, 0xdb, 0xb8, 0x41, 0xdd, 0x7a, 0xa9, 0xbd,
+ 0x54, 0xaa, 0x13, 0x97, 0x30, 0xcc, 0x49, 0xcd, 0x6a, 0x32, 0x8f, 0x7b, 0xf0, 0x94, 0x22, 0xb5,
+ 0x70, 0x93, 0x5a, 0x31, 0x52, 0xab, 0xbd, 0xb4, 0x70, 0xa1, 0x4e, 0xf9, 0x56, 0x6b, 0xd3, 0xb2,
+ 0x3d, 0xa7, 0x54, 0xf7, 0xea, 0x5e, 0x49, 0x72, 0x6c, 0xb6, 0xee, 0xc9, 0x95, 0x5c, 0xc8, 0x2f,
+ 0x85, 0xb4, 0x60, 0xc6, 0x84, 0xda, 0x1e, 0x23, 0x03, 0xa4, 0x2d, 0x5c, 0xec, 0xd2, 0x38, 0xd8,
+ 0xde, 0xa2, 0x2e, 0x61, 0x3b, 0xa5, 0xe6, 0x76, 0x5d, 0x32, 0x31, 0xe2, 0x7b, 0x2d, 0x66, 0x93,
+ 0x7d, 0x71, 0xf9, 0x25, 0x87, 0x70, 0x3c, 0x48, 0x56, 0x29, 0x8d, 0x8b, 0xb5, 0x5c, 0x4e, 0x9d,
+ 0x7e, 0x31, 0x97, 0x76, 0x63, 0xf0, 0xed, 0x2d, 0xe2, 0xe0, 0x5e, 0x3e, 0xf3, 0xfb, 0x0c, 0x38,
+ 0x5d, 0x61, 0x9e, 0xef, 0xdf, 0x26, 0xcc, 0xa7, 0x9e, 0x7b, 0x63, 0xf3, 0x3e, 0xb1, 0x39, 0x22,
+ 0xf7, 0x08, 0x23, 0xae, 0x4d, 0xe0, 0x22, 0xc8, 0x6f, 0x53, 0xb7, 0x36, 0x9f, 0x59, 0xcc, 0x9c,
+ 0x9f, 0x2a, 0x4f, 0x3f, 0x0e, 0x8c, 0xb1, 0x30, 0x30, 0xf2, 0x1f, 0x51, 0xb7, 0x86, 0xe4, 0x89,
+ 0xa0, 0x70, 0xb1, 0x43, 0xe6, 0xb3, 0x49, 0x8a, 0xeb, 0xd8, 0x21, 0x48, 0x9e, 0xc0, 0x65, 0x00,
+ 0x70, 0x93, 0x6a, 0x01, 0xf3, 0x39, 0x49, 0x07, 0x35, 0x1d, 0x58, 0x59, 0xbb, 0xa6, 0x4f, 0x50,
+ 0x8c, 0xca, 0xfc, 0x21, 0x07, 0x8e, 0x7f, 0xf0, 0x80, 0x13, 0xe6, 0xe2, 0x46, 0x95, 0x70, 0x46,
+ 0xed, 0x75, 0xa9, 0x5f, 0x01, 0xe6, 0xc8, 0xb5, 0x10, 0xa0, 0xaf, 0x15, 0x81, 0x55, 0xa3, 0x13,
+ 0x14, 0xa3, 0x82, 0x1e, 0x98, 0x51, 0xab, 0x75, 0xd2, 0x20, 0x36, 0xf7, 0x98, 0xbc, 0x6c, 0x61,
+ 0xf9, 0x1d, 0xab, 0xeb, 0x40, 0x91, 0xd6, 0xac, 0xe6, 0x76, 0x5d, 0x6c, 0xf8, 0x96, 0x30, 0x8e,
+ 0xd5, 0x5e, 0xb2, 0x56, 0xf1, 0x26, 0x69, 0x74, 0x58, 0xcb, 0x30, 0x0c, 0x8c, 0x99, 0x6a, 0x02,
+ 0x0e, 0xf5, 0xc0, 0x43, 0x0c, 0x0a, 0x1c, 0xb3, 0x3a, 0xe1, 0xb7, 0x71, 0xa3, 0x45, 0xe4, 0x2f,
+ 0x17, 0x96, 0xad, 0x61, 0xd2, 0xac, 0x8e, 0x03, 0x59, 0x37, 0x5b, 0xd8, 0xe5, 0x94, 0xef, 0x94,
+ 0x67, 0xc3, 0xc0, 0x28, 0x6c, 0x74, 0x61, 0x50, 0x1c, 0x13, 0xb6, 0x01, 0x54, 0xcb, 0x95, 0x36,
+ 0x61, 0xb8, 0x4e, 0x94, 0xa4, 0xfc, 0x48, 0x92, 0x4e, 0x84, 0x81, 0x01, 0x37, 0xfa, 0xd0, 0xd0,
+ 0x00, 0x09, 0xe6, 0x4f, 0xfd, 0x86, 0xe1, 0x98, 0xb7, 0xfc, 0x7f, 0x87, 0x61, 0xb6, 0xc0, 0xb4,
+ 0xdd, 0x62, 0x8c, 0xb8, 0x2f, 0x65, 0x99, 0xe3, 0xfa, 0xb7, 0xa6, 0x2b, 0x31, 0x2c, 0x94, 0x40,
+ 0x86, 0x3b, 0xe0, 0x98, 0x5e, 0x1f, 0x80, 0x81, 0x4e, 0x86, 0x81, 0x71, 0xac, 0xd2, 0x0f, 0x87,
+ 0x06, 0xc9, 0x30, 0x1f, 0x65, 0xc1, 0xc9, 0xab, 0x1e, 0xa3, 0x0f, 0x3d, 0x97, 0xe3, 0xc6, 0x9a,
+ 0x57, 0x5b, 0xd1, 0xb1, 0x91, 0x30, 0x78, 0x17, 0x4c, 0x0a, 0xed, 0xd5, 0x30, 0xc7, 0xd2, 0x46,
+ 0x85, 0xe5, 0xb7, 0xf7, 0xa6, 0x6b, 0x15, 0x18, 0xaa, 0x84, 0xe3, 0xae, 0x55, 0xbb, 0x7b, 0x28,
+ 0x42, 0x85, 0x77, 0x40, 0xde, 0x6f, 0x12, 0x5b, 0x5b, 0xf2, 0x92, 0x95, 0x1a, 0xa3, 0xad, 0x94,
+ 0x3b, 0xae, 0x37, 0x89, 0xdd, 0x8d, 0x23, 0x62, 0x85, 0x24, 0x22, 0xbc, 0x0b, 0x26, 0x7c, 0xe9,
+ 0x6b, 0xda, 0x6c, 0x97, 0x47, 0xc0, 0x96, 0xfc, 0xe5, 0x19, 0x8d, 0x3e, 0xa1, 0xd6, 0x48, 0xe3,
+ 0x9a, 0xdf, 0xe6, 0xc0, 0x62, 0x0a, 0x67, 0xc5, 0x73, 0x6b, 0x94, 0x53, 0xcf, 0x85, 0x57, 0x41,
+ 0x9e, 0xef, 0x34, 0x3b, 0x2e, 0x7e, 0xb1, 0x73, 0xd1, 0x8d, 0x9d, 0x26, 0x79, 0x11, 0x18, 0x67,
+ 0x77, 0xe3, 0x17, 0x74, 0x48, 0x22, 0xc0, 0xd5, 0xe8, 0x87, 0xb2, 0x09, 0x2c, 0x7d, 0xad, 0x17,
+ 0x81, 0x31, 0x20, 0x2f, 0x59, 0x11, 0x52, 0xf2, 0xf2, 0x22, 0x22, 0x34, 0xb0, 0xcf, 0x37, 0x18,
+ 0x76, 0x7d, 0x25, 0x89, 0x3a, 0x1d, 0x0f, 0x7f, 0x63, 0x6f, 0x46, 0x16, 0x1c, 0xe5, 0x05, 0x7d,
+ 0x0b, 0xb8, 0xda, 0x87, 0x86, 0x06, 0x48, 0x80, 0xe7, 0xc0, 0x04, 0x23, 0xd8, 0xf7, 0x5c, 0xe9,
+ 0xdc, 0x53, 0x5d, 0xe5, 0x22, 0xb9, 0x8b, 0xf4, 0x29, 0x7c, 0x1d, 0x1c, 0x71, 0x88, 0xef, 0xe3,
+ 0x3a, 0x99, 0x1f, 0x97, 0x84, 0xb3, 0x9a, 0xf0, 0x48, 0x55, 0x6d, 0xa3, 0xce, 0xb9, 0xf9, 0x34,
+ 0x03, 0x4e, 0xa7, 0xe8, 0x71, 0x95, 0xfa, 0x1c, 0x7e, 0xde, 0xe7, 0xc5, 0xd6, 0x1e, 0x23, 0x06,
+ 0xf5, 0x95, 0x0f, 0xcf, 0x69, 0xd9, 0x93, 0x9d, 0x9d, 0x98, 0x07, 0x7f, 0x0c, 0xc6, 0x29, 0x27,
+ 0x8e, 0xb0, 0x4a, 0xee, 0x7c, 0x61, 0x79, 0x79, 0xff, 0x6e, 0x56, 0x3e, 0xaa, 0xe1, 0xc7, 0xaf,
+ 0x09, 0x20, 0xa4, 0xf0, 0xcc, 0xbf, 0xb2, 0xa9, 0xbf, 0x25, 0xdc, 0x1c, 0xb6, 0xc1, 0x8c, 0x5c,
+ 0xa9, 0x50, 0x8c, 0xc8, 0x3d, 0xfd, 0x73, 0xc3, 0x1e, 0xd1, 0x90, 0xe4, 0x5d, 0x3e, 0xa1, 0x6f,
+ 0x31, 0xb3, 0x9e, 0x40, 0x45, 0x3d, 0x52, 0xe0, 0x12, 0x28, 0x38, 0xd4, 0x45, 0xa4, 0xd9, 0xa0,
+ 0x36, 0x56, 0xce, 0x38, 0xae, 0xd2, 0x4f, 0xb5, 0xbb, 0x8d, 0xe2, 0x34, 0xf0, 0x5d, 0x50, 0x70,
+ 0xf0, 0x83, 0x88, 0x25, 0x27, 0x59, 0x8e, 0x69, 0x79, 0x85, 0x6a, 0xf7, 0x08, 0xc5, 0xe9, 0xe0,
+ 0x7d, 0x50, 0x54, 0x39, 0xa5, 0xb2, 0x76, 0xeb, 0x16, 0xa7, 0x0d, 0xfa, 0x10, 0x0b, 0x3f, 0x5a,
+ 0x23, 0xcc, 0x26, 0x2e, 0x17, 0xae, 0x91, 0x97, 0x48, 0x66, 0x18, 0x18, 0xc5, 0x8d, 0xa1, 0x94,
+ 0x68, 0x17, 0x24, 0xf3, 0xb7, 0x1c, 0x38, 0x33, 0x34, 0x0c, 0xc0, 0x2b, 0x00, 0x7a, 0x9b, 0x3e,
+ 0x61, 0x6d, 0x52, 0xfb, 0x50, 0xd5, 0x45, 0xa2, 0x40, 0x11, 0x3a, 0xcf, 0xa9, 0x9c, 0x78, 0xa3,
+ 0xef, 0x14, 0x0d, 0xe0, 0x80, 0x36, 0x38, 0x2a, 0xde, 0x85, 0xd2, 0x32, 0xd5, 0xb5, 0xd0, 0xfe,
+ 0x1e, 0xdd, 0xff, 0xc2, 0xc0, 0x38, 0xba, 0x1a, 0x07, 0x41, 0x49, 0x4c, 0xb8, 0x02, 0x66, 0x75,
+ 0xb0, 0xef, 0xd1, 0xfa, 0x49, 0xad, 0xf5, 0xd9, 0x4a, 0xf2, 0x18, 0xf5, 0xd2, 0x0b, 0x88, 0x1a,
+ 0xf1, 0x29, 0x23, 0xb5, 0x08, 0x22, 0x9f, 0x84, 0x78, 0x3f, 0x79, 0x8c, 0x7a, 0xe9, 0xa1, 0x03,
+ 0x0c, 0x8d, 0x9a, 0x6a, 0xc1, 0x71, 0x09, 0xf9, 0x5a, 0x18, 0x18, 0x46, 0x65, 0x38, 0x29, 0xda,
+ 0x0d, 0x4b, 0x94, 0x81, 0xba, 0x76, 0x90, 0x0f, 0xe4, 0x62, 0x22, 0xf4, 0x2e, 0xf6, 0x84, 0xde,
+ 0xb9, 0x78, 0xa1, 0x18, 0x0b, 0xb3, 0x37, 0xc1, 0x84, 0x27, 0x5f, 0x86, 0xb6, 0xcb, 0x85, 0x21,
+ 0xcf, 0x29, 0x4a, 0x69, 0x11, 0x50, 0x19, 0x88, 0x58, 0xa6, 0x9f, 0x96, 0x06, 0x82, 0xd7, 0x40,
+ 0xbe, 0xe9, 0xd5, 0x3a, 0x89, 0xe8, 0xcd, 0x21, 0x80, 0x6b, 0x5e, 0xcd, 0x4f, 0xc0, 0x4d, 0x8a,
+ 0x1b, 0x8b, 0x5d, 0x24, 0x21, 0xe0, 0x27, 0x60, 0xb2, 0x93, 0xf0, 0x75, 0x75, 0x50, 0x1a, 0x02,
+ 0x87, 0x34, 0x69, 0x02, 0x72, 0x5a, 0x04, 0xb2, 0xce, 0x09, 0x8a, 0xe0, 0x04, 0x34, 0xd1, 0xa5,
+ 0x9a, 0xb4, 0xca, 0x70, 0xe8, 0x41, 0xe5, 0xb6, 0x82, 0xee, 0x9c, 0xa0, 0x08, 0xce, 0xfc, 0x31,
+ 0x07, 0xa6, 0x13, 0xe5, 0xdf, 0x21, 0x9b, 0x46, 0xe5, 0xf1, 0x03, 0x33, 0x8d, 0x82, 0x3b, 0x50,
+ 0xd3, 0x28, 0xc8, 0x57, 0x62, 0x9a, 0x18, 0xf4, 0x00, 0xd3, 0x3c, 0xcd, 0x01, 0xd8, 0xef, 0xc6,
+ 0xf0, 0x4b, 0x30, 0xa1, 0x02, 0xe6, 0x4b, 0x26, 0x95, 0x28, 0xbd, 0xeb, 0xfc, 0xa1, 0x51, 0x7b,
+ 0xea, 0xff, 0xec, 0x9e, 0xea, 0x7f, 0x72, 0x10, 0x7d, 0x52, 0x94, 0x75, 0x52, 0x7b, 0xa5, 0x2f,
+ 0xc0, 0xa4, 0xdf, 0x69, 0x30, 0xf2, 0xa3, 0x37, 0x18, 0x52, 0xe1, 0x51, 0x6b, 0x11, 0x41, 0xc2,
+ 0x1a, 0x98, 0xc6, 0xf1, 0x1a, 0x7f, 0x7c, 0xa4, 0xdf, 0x98, 0x13, 0x0d, 0x45, 0xa2, 0xb8, 0x4f,
+ 0xa0, 0x9a, 0xbf, 0xf7, 0x9a, 0x55, 0xbd, 0xbb, 0x7f, 0xa2, 0x59, 0x0f, 0xaf, 0xcb, 0xfa, 0x4f,
+ 0x58, 0xf6, 0xe7, 0x2c, 0x98, 0xeb, 0x4d, 0x13, 0x23, 0xb5, 0xd3, 0x0f, 0x07, 0xce, 0x04, 0xb2,
+ 0x23, 0x5d, 0x3a, 0xea, 0x02, 0xf6, 0x36, 0x17, 0x48, 0x58, 0x22, 0x77, 0xe0, 0x96, 0x30, 0x7f,
+ 0x49, 0xea, 0x68, 0xf4, 0x91, 0xc3, 0x57, 0x83, 0xfb, 0xf2, 0xd1, 0x94, 0x74, 0x5a, 0x0b, 0xdb,
+ 0x73, 0x6f, 0xfe, 0xaa, 0xd5, 0xf4, 0x6b, 0x16, 0x1c, 0x1f, 0x54, 0x22, 0xc0, 0x8a, 0x9e, 0xd2,
+ 0x29, 0x25, 0x95, 0xe2, 0x53, 0xba, 0x17, 0x81, 0x61, 0x0c, 0x68, 0x33, 0x3b, 0x30, 0xb1, 0x41,
+ 0xde, 0x1d, 0x30, 0x9f, 0xb0, 0x7c, 0xac, 0x66, 0xd3, 0x4d, 0xc3, 0xff, 0xc3, 0xc0, 0x98, 0xdf,
+ 0x48, 0xa1, 0x41, 0xa9, 0xdc, 0x29, 0xd3, 0xac, 0xdc, 0x2b, 0x9f, 0x66, 0x3d, 0xea, 0xd7, 0x97,
+ 0x72, 0xad, 0x03, 0xd1, 0xd7, 0x67, 0xe0, 0x54, 0xd2, 0x07, 0xfa, 0x15, 0x76, 0x26, 0x0c, 0x8c,
+ 0x53, 0x95, 0x34, 0x22, 0x94, 0xce, 0x9f, 0xe6, 0xc8, 0xb9, 0xc3, 0x71, 0x64, 0xf3, 0x9b, 0x2c,
+ 0x18, 0x97, 0xcd, 0xc9, 0x21, 0x8c, 0x94, 0xae, 0x24, 0x46, 0x4a, 0x67, 0x87, 0x64, 0x38, 0x79,
+ 0xa3, 0xd4, 0x01, 0xd2, 0xf5, 0x9e, 0x01, 0xd2, 0xb9, 0x5d, 0x91, 0x86, 0x8f, 0x8b, 0xde, 0x03,
+ 0x53, 0x91, 0x40, 0xf8, 0x96, 0x28, 0x16, 0x75, 0x57, 0x95, 0x91, 0xb6, 0x8d, 0x66, 0x0c, 0x51,
+ 0x3b, 0x15, 0x51, 0x98, 0x14, 0x14, 0x62, 0x12, 0xf6, 0xc7, 0x2c, 0xa8, 0xfd, 0xf8, 0xc0, 0x74,
+ 0xaa, 0x4b, 0xdd, 0x1f, 0x13, 0xca, 0xe7, 0x1f, 0x3f, 0x2f, 0x8e, 0x3d, 0x79, 0x5e, 0x1c, 0x7b,
+ 0xf6, 0xbc, 0x38, 0xf6, 0x75, 0x58, 0xcc, 0x3c, 0x0e, 0x8b, 0x99, 0x27, 0x61, 0x31, 0xf3, 0x2c,
+ 0x2c, 0x66, 0xfe, 0x08, 0x8b, 0x99, 0xef, 0xfe, 0x2c, 0x8e, 0x7d, 0x9a, 0x6d, 0x2f, 0xfd, 0x1d,
+ 0x00, 0x00, 0xff, 0xff, 0x3c, 0x26, 0x41, 0xcb, 0x94, 0x19, 0x00, 0x00,
}
diff --git a/staging/src/k8s.io/api/autoscaling/v1/generated.proto b/staging/src/k8s.io/api/autoscaling/v1/generated.proto
index a3c542de25c..5b56b2ac831 100644
--- a/staging/src/k8s.io/api/autoscaling/v1/generated.proto
+++ b/staging/src/k8s.io/api/autoscaling/v1/generated.proto
@@ -257,6 +257,17 @@ message ObjectMetricSource {
// targetValue is the target value of the metric (as a quantity).
optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric.
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// ObjectMetricStatus indicates the current value of a metric describing a
@@ -270,6 +281,17 @@ message ObjectMetricStatus {
// currentValue is the current value of the metric (as a quantity).
optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -283,6 +305,12 @@ message PodsMetricSource {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -294,6 +322,12 @@ message PodsMetricStatus {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// ResourceMetricSource indicates how to scale on a resource metric known to
diff --git a/staging/src/k8s.io/api/autoscaling/v1/types.go b/staging/src/k8s.io/api/autoscaling/v1/types.go
index 344af774f00..c03af13ae21 100644
--- a/staging/src/k8s.io/api/autoscaling/v1/types.go
+++ b/staging/src/k8s.io/api/autoscaling/v1/types.go
@@ -211,6 +211,16 @@ type ObjectMetricSource struct {
MetricName string `json:"metricName" protobuf:"bytes,2,name=metricName"`
// targetValue is the target value of the metric (as a quantity).
TargetValue resource.Quantity `json:"targetValue" protobuf:"bytes,3,name=targetValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric.
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,name=selector"`
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,5,name=averageValue"`
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -223,6 +233,12 @@ type PodsMetricSource struct {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
TargetAverageValue resource.Quantity `json:"targetAverageValue" protobuf:"bytes,2,name=targetAverageValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,3,name=selector"`
}
// ResourceMetricSource indicates how to scale on a resource metric known to
@@ -344,6 +360,16 @@ type ObjectMetricStatus struct {
MetricName string `json:"metricName" protobuf:"bytes,2,name=metricName"`
// currentValue is the current value of the metric (as a quantity).
CurrentValue resource.Quantity `json:"currentValue" protobuf:"bytes,3,name=currentValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,name=selector"`
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,5,name=averageValue"`
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -354,6 +380,12 @@ type PodsMetricStatus struct {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
CurrentAverageValue resource.Quantity `json:"currentAverageValue" protobuf:"bytes,2,name=currentAverageValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,3,name=selector"`
}
// ResourceMetricStatus indicates the current value of a resource metric known to
diff --git a/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go
index e84909269db..a6e874f3da9 100644
--- a/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go
+++ b/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go
@@ -148,10 +148,12 @@ func (MetricStatus) SwaggerDoc() map[string]string {
}
var map_ObjectMetricSource = map[string]string{
- "": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
- "target": "target is the described Kubernetes object.",
- "metricName": "metricName is the name of the metric in question.",
- "targetValue": "targetValue is the target value of the metric (as a quantity).",
+ "": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "target": "target is the described Kubernetes object.",
+ "metricName": "metricName is the name of the metric in question.",
+ "targetValue": "targetValue is the target value of the metric (as a quantity).",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric. When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
+ "averageValue": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
}
func (ObjectMetricSource) SwaggerDoc() map[string]string {
@@ -163,6 +165,8 @@ var map_ObjectMetricStatus = map[string]string{
"target": "target is the described Kubernetes object.",
"metricName": "metricName is the name of the metric in question.",
"currentValue": "currentValue is the current value of the metric (as a quantity).",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+ "averageValue": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
}
func (ObjectMetricStatus) SwaggerDoc() map[string]string {
@@ -173,6 +177,7 @@ var map_PodsMetricSource = map[string]string{
"": "PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
"metricName": "metricName is the name of the metric in question",
"targetAverageValue": "targetAverageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
}
func (PodsMetricSource) SwaggerDoc() map[string]string {
@@ -183,6 +188,7 @@ var map_PodsMetricStatus = map[string]string{
"": "PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).",
"metricName": "metricName is the name of the metric in question",
"currentAverageValue": "currentAverageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
}
func (PodsMetricStatus) SwaggerDoc() map[string]string {
diff --git a/staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go
index 6bafc0887f2..3fda47d543c 100644
--- a/staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go
@@ -311,6 +311,16 @@ func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource) {
*out = *in
out.Target = in.Target
out.TargetValue = in.TargetValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(metav1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
return
}
@@ -329,6 +339,16 @@ func (in *ObjectMetricStatus) DeepCopyInto(out *ObjectMetricStatus) {
*out = *in
out.Target = in.Target
out.CurrentValue = in.CurrentValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(metav1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
return
}
@@ -346,6 +366,11 @@ func (in *ObjectMetricStatus) DeepCopy() *ObjectMetricStatus {
func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource) {
*out = *in
out.TargetAverageValue = in.TargetAverageValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(metav1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -363,6 +388,11 @@ func (in *PodsMetricSource) DeepCopy() *PodsMetricSource {
func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus) {
*out = *in
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(metav1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
return
}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/generated.pb.go b/staging/src/k8s.io/api/autoscaling/v2beta1/generated.pb.go
index 33f67913a94..bee94129d8e 100644
--- a/staging/src/k8s.io/api/autoscaling/v2beta1/generated.pb.go
+++ b/staging/src/k8s.io/api/autoscaling/v2beta1/generated.pb.go
@@ -683,6 +683,26 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) {
return 0, err
}
i += n23
+ if m.Selector != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n24, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n24
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n25, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n25
+ }
return i, nil
}
@@ -704,11 +724,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
- n24, err := m.Target.MarshalTo(dAtA[i:])
+ n26, err := m.Target.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n24
+ i += n26
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName)))
@@ -716,11 +736,31 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size()))
- n25, err := m.CurrentValue.MarshalTo(dAtA[i:])
+ n27, err := m.CurrentValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n25
+ i += n27
+ if m.Selector != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n28, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n28
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n29, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n29
+ }
return i, nil
}
@@ -746,11 +786,21 @@ func (m *PodsMetricSource) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size()))
- n26, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
+ n30, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n26
+ i += n30
+ if m.Selector != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n31, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n31
+ }
return i, nil
}
@@ -776,11 +826,21 @@ func (m *PodsMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size()))
- n27, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
+ n32, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n27
+ i += n32
+ if m.Selector != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n33, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n33
+ }
return i, nil
}
@@ -812,11 +872,11 @@ func (m *ResourceMetricSource) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size()))
- n28, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
+ n34, err := m.TargetAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n28
+ i += n34
}
return i, nil
}
@@ -848,11 +908,11 @@ func (m *ResourceMetricStatus) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size()))
- n29, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
+ n35, err := m.CurrentAverageValue.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n29
+ i += n35
return i, nil
}
@@ -1077,6 +1137,14 @@ func (m *ObjectMetricSource) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.TargetValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1089,6 +1157,14 @@ func (m *ObjectMetricStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.CurrentValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1099,6 +1175,10 @@ func (m *PodsMetricSource) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.TargetAverageValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1109,6 +1189,10 @@ func (m *PodsMetricStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.CurrentAverageValue.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1292,6 +1376,8 @@ func (this *ObjectMetricSource) String() string {
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`TargetValue:` + strings.Replace(strings.Replace(this.TargetValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
`}`,
}, "")
return s
@@ -1304,6 +1390,8 @@ func (this *ObjectMetricStatus) String() string {
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`CurrentValue:` + strings.Replace(strings.Replace(this.CurrentValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
`}`,
}, "")
return s
@@ -1315,6 +1403,7 @@ func (this *PodsMetricSource) String() string {
s := strings.Join([]string{`&PodsMetricSource{`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`TargetAverageValue:` + strings.Replace(strings.Replace(this.TargetAverageValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@@ -1326,6 +1415,7 @@ func (this *PodsMetricStatus) String() string {
s := strings.Join([]string{`&PodsMetricStatus{`,
`MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`,
`CurrentAverageValue:` + strings.Replace(strings.Replace(this.CurrentAverageValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@@ -3192,6 +3282,72 @@ func (m *ObjectMetricSource) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3331,6 +3487,72 @@ func (m *ObjectMetricStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3440,6 +3662,39 @@ func (m *PodsMetricSource) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3549,6 +3804,39 @@ func (m *PodsMetricStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3941,95 +4229,98 @@ func init() {
}
var fileDescriptorGenerated = []byte{
- // 1426 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcb, 0x8f, 0x1b, 0x45,
- 0x13, 0x5f, 0x3f, 0x76, 0xb3, 0x69, 0x6f, 0x76, 0xf3, 0x75, 0xa2, 0xc4, 0xd9, 0x7c, 0xf1, 0xac,
- 0x46, 0x08, 0x85, 0x88, 0xcc, 0x24, 0x66, 0x79, 0x48, 0x08, 0x89, 0xb5, 0x81, 0x24, 0x62, 0x9d,
- 0x84, 0xde, 0x4d, 0x84, 0x20, 0x20, 0xda, 0xe3, 0x8e, 0xb7, 0x59, 0xcf, 0x8c, 0x35, 0xdd, 0xb6,
- 0xb2, 0x41, 0x48, 0x5c, 0xb8, 0x73, 0xe0, 0x71, 0xe5, 0x8c, 0xe0, 0x0a, 0x67, 0x90, 0x90, 0x72,
- 0xcc, 0x31, 0x08, 0xc9, 0x22, 0xc3, 0x7f, 0x91, 0x13, 0xea, 0xc7, 0x8c, 0x67, 0xfc, 0x58, 0x3b,
- 0x66, 0x13, 0xe0, 0x36, 0xdd, 0x55, 0xf5, 0xab, 0xea, 0xaa, 0xea, 0xea, 0xaa, 0x01, 0x97, 0x76,
- 0x5f, 0x61, 0x16, 0xf5, 0xed, 0xdd, 0x4e, 0x9d, 0x04, 0x1e, 0xe1, 0x84, 0xd9, 0x5d, 0xe2, 0x35,
- 0xfc, 0xc0, 0xd6, 0x04, 0xdc, 0xa6, 0x36, 0xee, 0x70, 0x9f, 0x39, 0xb8, 0x45, 0xbd, 0xa6, 0xdd,
- 0x2d, 0xd7, 0x09, 0xc7, 0x17, 0xed, 0x26, 0xf1, 0x48, 0x80, 0x39, 0x69, 0x58, 0xed, 0xc0, 0xe7,
- 0x3e, 0x2c, 0x29, 0x7e, 0x0b, 0xb7, 0xa9, 0x95, 0xe0, 0xb7, 0x34, 0xff, 0xea, 0xf9, 0x26, 0xe5,
- 0x3b, 0x9d, 0xba, 0xe5, 0xf8, 0xae, 0xdd, 0xf4, 0x9b, 0xbe, 0x2d, 0xc5, 0xea, 0x9d, 0xdb, 0x72,
- 0x25, 0x17, 0xf2, 0x4b, 0xc1, 0xad, 0x9a, 0x09, 0xf5, 0x8e, 0x1f, 0x10, 0xbb, 0x3b, 0xa4, 0x72,
- 0x75, 0xbd, 0xcf, 0xe3, 0x62, 0x67, 0x87, 0x7a, 0x24, 0xd8, 0xb3, 0xdb, 0xbb, 0x4d, 0x29, 0x14,
- 0x10, 0xe6, 0x77, 0x02, 0x87, 0x3c, 0x96, 0x14, 0xb3, 0x5d, 0xc2, 0xf1, 0x28, 0x5d, 0xf6, 0x38,
- 0xa9, 0xa0, 0xe3, 0x71, 0xea, 0x0e, 0xab, 0x79, 0x69, 0x92, 0x00, 0x73, 0x76, 0x88, 0x8b, 0x07,
- 0xe5, 0xcc, 0xaf, 0x32, 0xe0, 0x74, 0x35, 0xf0, 0x19, 0xbb, 0x49, 0x02, 0x46, 0x7d, 0xef, 0x5a,
- 0xfd, 0x63, 0xe2, 0x70, 0x44, 0x6e, 0x93, 0x80, 0x78, 0x0e, 0x81, 0x6b, 0x20, 0xbf, 0x4b, 0xbd,
- 0x46, 0x31, 0xb3, 0x96, 0x39, 0x7b, 0xb8, 0xb2, 0x74, 0xaf, 0x67, 0xcc, 0x85, 0x3d, 0x23, 0xff,
- 0x36, 0xf5, 0x1a, 0x48, 0x52, 0x04, 0x87, 0x87, 0x5d, 0x52, 0xcc, 0xa6, 0x39, 0xae, 0x62, 0x97,
- 0x20, 0x49, 0x81, 0x65, 0x00, 0x70, 0x9b, 0x6a, 0x05, 0xc5, 0x9c, 0xe4, 0x83, 0x9a, 0x0f, 0x6c,
- 0x5c, 0xbf, 0xa2, 0x29, 0x28, 0xc1, 0x65, 0x7e, 0x9d, 0x03, 0xc7, 0xdf, 0xbc, 0xc3, 0x49, 0xe0,
- 0xe1, 0x56, 0x8d, 0xf0, 0x80, 0x3a, 0x5b, 0xd2, 0xbf, 0x02, 0xcc, 0x95, 0x6b, 0xa1, 0x40, 0x9b,
- 0x15, 0x83, 0xd5, 0x62, 0x0a, 0x4a, 0x70, 0x41, 0x1f, 0x2c, 0xab, 0xd5, 0x16, 0x69, 0x11, 0x87,
- 0xfb, 0x81, 0x34, 0xb6, 0x50, 0x7e, 0xc1, 0xea, 0x67, 0x51, 0xec, 0x35, 0xab, 0xbd, 0xdb, 0x14,
- 0x1b, 0xcc, 0x12, 0xc1, 0xb1, 0xba, 0x17, 0xad, 0x4d, 0x5c, 0x27, 0xad, 0x48, 0xb4, 0x02, 0xc3,
- 0x9e, 0xb1, 0x5c, 0x4b, 0xc1, 0xa1, 0x01, 0x78, 0x88, 0x41, 0x81, 0xe3, 0xa0, 0x49, 0xf8, 0x4d,
- 0xdc, 0xea, 0x10, 0x79, 0xe4, 0x42, 0xd9, 0xda, 0x4f, 0x9b, 0x15, 0x25, 0x90, 0xf5, 0x4e, 0x07,
- 0x7b, 0x9c, 0xf2, 0xbd, 0xca, 0x4a, 0xd8, 0x33, 0x0a, 0xdb, 0x7d, 0x18, 0x94, 0xc4, 0x84, 0x5d,
- 0x00, 0xd5, 0x72, 0xa3, 0x4b, 0x02, 0xdc, 0x24, 0x4a, 0x53, 0x7e, 0x26, 0x4d, 0x27, 0xc2, 0x9e,
- 0x01, 0xb7, 0x87, 0xd0, 0xd0, 0x08, 0x0d, 0xe6, 0xb7, 0xc3, 0x81, 0xe1, 0x98, 0x77, 0xd8, 0x7f,
- 0x23, 0x30, 0x3b, 0x60, 0xc9, 0xe9, 0x04, 0x01, 0xf1, 0xfe, 0x56, 0x64, 0x8e, 0xeb, 0x63, 0x2d,
- 0x55, 0x13, 0x58, 0x28, 0x85, 0x0c, 0xf7, 0xc0, 0x31, 0xbd, 0x3e, 0x80, 0x00, 0x9d, 0x0c, 0x7b,
- 0xc6, 0xb1, 0xea, 0x30, 0x1c, 0x1a, 0xa5, 0xc3, 0xfc, 0x39, 0x0b, 0x4e, 0x5e, 0xf6, 0x03, 0x7a,
- 0xd7, 0xf7, 0x38, 0x6e, 0x5d, 0xf7, 0x1b, 0x1b, 0xba, 0x40, 0x92, 0x00, 0x7e, 0x04, 0x16, 0x85,
- 0xf7, 0x1a, 0x98, 0x63, 0x19, 0xa3, 0x42, 0xf9, 0xc2, 0x74, 0xbe, 0x56, 0x85, 0xa1, 0x46, 0x38,
- 0xee, 0x47, 0xb5, 0xbf, 0x87, 0x62, 0x54, 0xf8, 0x01, 0xc8, 0xb3, 0x36, 0x71, 0x74, 0x24, 0x5f,
- 0xb5, 0xf6, 0x2f, 0xd4, 0xd6, 0x18, 0x43, 0xb7, 0xda, 0xc4, 0xe9, 0x17, 0x13, 0xb1, 0x42, 0x12,
- 0x16, 0x12, 0xb0, 0xc0, 0x64, 0xc2, 0xe9, 0xd8, 0xbd, 0x36, 0xab, 0x02, 0x09, 0x52, 0x59, 0xd6,
- 0x2a, 0x16, 0xd4, 0x1a, 0x69, 0x70, 0xf3, 0xf3, 0x1c, 0x58, 0x1b, 0x23, 0x59, 0xf5, 0xbd, 0x06,
- 0xe5, 0xd4, 0xf7, 0xe0, 0x65, 0x90, 0xe7, 0x7b, 0xed, 0x28, 0xd9, 0xd7, 0x23, 0x6b, 0xb7, 0xf7,
- 0xda, 0xe4, 0x51, 0xcf, 0x78, 0x66, 0x92, 0xbc, 0xe0, 0x43, 0x12, 0x01, 0x6e, 0xc6, 0xa7, 0xca,
- 0xa6, 0xb0, 0xb4, 0x59, 0x8f, 0x7a, 0xc6, 0x88, 0x17, 0xca, 0x8a, 0x91, 0xd2, 0xc6, 0x8b, 0xda,
- 0xd0, 0xc2, 0x8c, 0x6f, 0x07, 0xd8, 0x63, 0x4a, 0x13, 0x75, 0xa3, 0x5c, 0x3f, 0x37, 0x5d, 0xb8,
- 0x85, 0x44, 0x65, 0x55, 0x5b, 0x01, 0x37, 0x87, 0xd0, 0xd0, 0x08, 0x0d, 0xf0, 0x59, 0xb0, 0x10,
- 0x10, 0xcc, 0x7c, 0x4f, 0xa6, 0xf9, 0xe1, 0xbe, 0x73, 0x91, 0xdc, 0x45, 0x9a, 0x0a, 0x9f, 0x03,
- 0x87, 0x5c, 0xc2, 0x18, 0x6e, 0x92, 0xe2, 0xbc, 0x64, 0x5c, 0xd1, 0x8c, 0x87, 0x6a, 0x6a, 0x1b,
- 0x45, 0x74, 0xf3, 0xb7, 0x0c, 0x38, 0x3d, 0xc6, 0x8f, 0x9b, 0x94, 0x71, 0x78, 0x6b, 0x28, 0x9f,
- 0xad, 0x29, 0x6b, 0x07, 0x65, 0x2a, 0x9b, 0x8f, 0x6a, 0xdd, 0x8b, 0xd1, 0x4e, 0x22, 0x97, 0x6f,
- 0x81, 0x79, 0xca, 0x89, 0x2b, 0xa2, 0x92, 0x3b, 0x5b, 0x28, 0xbf, 0x3c, 0x63, 0xae, 0x55, 0x8e,
- 0x68, 0x1d, 0xf3, 0x57, 0x04, 0x1a, 0x52, 0xa0, 0xe6, 0xef, 0xd9, 0xb1, 0x67, 0x13, 0x09, 0x0f,
- 0x3f, 0x01, 0xcb, 0x72, 0xa5, 0x2a, 0x33, 0x22, 0xb7, 0xf5, 0x09, 0x27, 0xde, 0xa9, 0x7d, 0x1e,
- 0xf4, 0xca, 0x09, 0x6d, 0xca, 0xf2, 0x56, 0x0a, 0x1a, 0x0d, 0xa8, 0x82, 0x17, 0x41, 0xc1, 0xa5,
- 0x1e, 0x22, 0xed, 0x16, 0x75, 0xb0, 0x4a, 0xcb, 0x79, 0xf5, 0x24, 0xd5, 0xfa, 0xdb, 0x28, 0xc9,
- 0x03, 0x5f, 0x04, 0x05, 0x17, 0xdf, 0x89, 0x45, 0x72, 0x52, 0xe4, 0x98, 0xd6, 0x57, 0xa8, 0xf5,
- 0x49, 0x28, 0xc9, 0x07, 0x6f, 0x88, 0x6c, 0x10, 0x55, 0x9a, 0x15, 0xf3, 0xd2, 0xcd, 0xe7, 0x26,
- 0x9d, 0x4f, 0x17, 0x79, 0x51, 0x22, 0x12, 0x99, 0x23, 0x21, 0x50, 0x84, 0x65, 0xfe, 0x98, 0x07,
- 0x67, 0xf6, 0xbd, 0xfb, 0xf0, 0x2d, 0x00, 0xfd, 0x3a, 0x23, 0x41, 0x97, 0x34, 0x2e, 0xa9, 0xb6,
- 0x48, 0xf4, 0x27, 0xc2, 0xc7, 0x39, 0xf5, 0x24, 0x5e, 0x1b, 0xa2, 0xa2, 0x11, 0x12, 0xd0, 0x01,
- 0x47, 0xc4, 0x65, 0x50, 0x0e, 0xa5, 0xba, 0x15, 0x7a, 0xbc, 0x9b, 0xf6, 0xbf, 0xb0, 0x67, 0x1c,
- 0xd9, 0x4c, 0x82, 0xa0, 0x34, 0x26, 0xdc, 0x00, 0x2b, 0xba, 0xd6, 0x0f, 0x38, 0xf8, 0xa4, 0xf6,
- 0xc0, 0x4a, 0x35, 0x4d, 0x46, 0x83, 0xfc, 0x02, 0xa2, 0x41, 0x18, 0x0d, 0x48, 0x23, 0x86, 0xc8,
- 0xa7, 0x21, 0xde, 0x48, 0x93, 0xd1, 0x20, 0x3f, 0x6c, 0x81, 0x65, 0x8d, 0xaa, 0xfd, 0x5d, 0x9c,
- 0x97, 0x21, 0x7b, 0x7e, 0xca, 0x90, 0xa9, 0xa2, 0x1b, 0xe7, 0x60, 0x35, 0x85, 0x85, 0x06, 0xb0,
- 0x21, 0x07, 0xc0, 0x89, 0x4a, 0x1c, 0x2b, 0x2e, 0x48, 0x4d, 0xaf, 0xcf, 0x78, 0x07, 0xe3, 0x5a,
- 0xd9, 0x7f, 0xbe, 0xe2, 0x2d, 0x86, 0x12, 0x7a, 0xcc, 0xef, 0x72, 0x00, 0xf4, 0x33, 0x0c, 0xae,
- 0xa7, 0x8a, 0xfc, 0xda, 0x40, 0x91, 0x3f, 0x9a, 0x6c, 0x4e, 0x13, 0x05, 0xfd, 0x26, 0x58, 0xf0,
- 0xe5, 0xcd, 0xd3, 0xc9, 0x50, 0x9e, 0x64, 0x76, 0xfc, 0x96, 0xc6, 0x68, 0x15, 0x20, 0x4a, 0xa7,
- 0xbe, 0xbf, 0x1a, 0x0d, 0x5e, 0x05, 0xf9, 0xb6, 0xdf, 0x88, 0x1e, 0xbf, 0x0b, 0x93, 0x50, 0xaf,
- 0xfb, 0x0d, 0x96, 0xc2, 0x5c, 0x14, 0xb6, 0x8b, 0x5d, 0x24, 0x71, 0xe0, 0x87, 0x60, 0x31, 0x6a,
- 0x37, 0x74, 0x6f, 0xb2, 0x3e, 0x09, 0x13, 0x69, 0xfe, 0x14, 0xee, 0x92, 0xa8, 0xa0, 0x11, 0x05,
- 0xc5, 0x98, 0x02, 0x9f, 0xe8, 0x6e, 0x51, 0xd6, 0xfa, 0x29, 0xf0, 0x47, 0xb5, 0xfd, 0x0a, 0x3f,
- 0xa2, 0xa0, 0x18, 0xd3, 0xfc, 0x3e, 0x07, 0x96, 0x52, 0x6d, 0xe8, 0x3f, 0x11, 0x2e, 0x95, 0xd5,
- 0x07, 0x1b, 0x2e, 0x85, 0x79, 0xf0, 0xe1, 0x52, 0xb8, 0x4f, 0x2e, 0x5c, 0x09, 0xfc, 0x11, 0xe1,
- 0xfa, 0x32, 0x0b, 0xe0, 0x70, 0xa6, 0x43, 0x07, 0x2c, 0xa8, 0x51, 0xe3, 0x20, 0x5e, 0xb8, 0xb8,
- 0xeb, 0xd0, 0x8f, 0x99, 0x86, 0x1e, 0x18, 0x50, 0xb2, 0x53, 0x0d, 0x28, 0xe4, 0x20, 0x06, 0xb9,
- 0xf8, 0x09, 0x1c, 0x37, 0xcc, 0x99, 0xdf, 0x0c, 0xba, 0x45, 0xe5, 0xf2, 0xbf, 0xd6, 0x2d, 0x4f,
- 0x6d, 0x8c, 0x32, 0x7f, 0xc9, 0x80, 0xa3, 0x83, 0x45, 0x6c, 0xa6, 0x51, 0xf3, 0xee, 0xc8, 0x79,
- 0x39, 0x3b, 0x93, 0xe1, 0x71, 0x5f, 0x3c, 0xe5, 0xcc, 0xfc, 0x6b, 0xfa, 0x10, 0xb3, 0xcf, 0xcb,
- 0x9f, 0x8e, 0x1e, 0x2a, 0x67, 0x3b, 0xc5, 0x69, 0xad, 0x6c, 0xfa, 0xc1, 0xf2, 0x87, 0x2c, 0x38,
- 0x3e, 0xaa, 0xfa, 0xc3, 0xaa, 0xfe, 0x07, 0xa4, 0x4e, 0x61, 0x27, 0xff, 0x01, 0x3d, 0xea, 0x19,
- 0xc6, 0x88, 0xd1, 0x25, 0x82, 0x49, 0xfc, 0x26, 0x7a, 0x17, 0x14, 0x53, 0xbe, 0xbb, 0xc1, 0x69,
- 0x8b, 0xde, 0x55, 0x4d, 0x99, 0x6a, 0x3f, 0xff, 0x1f, 0xf6, 0x8c, 0xe2, 0xf6, 0x18, 0x1e, 0x34,
- 0x56, 0x7a, 0xcc, 0xbf, 0x92, 0xdc, 0x13, 0xff, 0x57, 0xf2, 0xd3, 0xb0, 0xbf, 0x54, 0xec, 0x0f,
- 0xc4, 0x5f, 0xef, 0x83, 0x53, 0xe9, 0x20, 0x0d, 0x3b, 0xec, 0x4c, 0xd8, 0x33, 0x4e, 0x55, 0xc7,
- 0x31, 0xa1, 0xf1, 0xf2, 0xe3, 0x32, 0x2d, 0xf7, 0x74, 0x32, 0xad, 0x72, 0xfe, 0xde, 0xc3, 0xd2,
- 0xdc, 0xfd, 0x87, 0xa5, 0xb9, 0x07, 0x0f, 0x4b, 0x73, 0x9f, 0x85, 0xa5, 0xcc, 0xbd, 0xb0, 0x94,
- 0xb9, 0x1f, 0x96, 0x32, 0x0f, 0xc2, 0x52, 0xe6, 0x8f, 0xb0, 0x94, 0xf9, 0xe2, 0xcf, 0xd2, 0xdc,
- 0x7b, 0x87, 0x74, 0xdd, 0xfb, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xb1, 0xdd, 0xcd, 0x57, 0x16,
- 0x00, 0x00,
+ // 1475 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcb, 0x8f, 0x1b, 0x45,
+ 0x13, 0x5f, 0x3f, 0x76, 0xb3, 0x69, 0x6f, 0x76, 0xf7, 0xeb, 0x44, 0x89, 0xb3, 0xf9, 0x62, 0xaf,
+ 0x2c, 0x84, 0x42, 0x44, 0x66, 0x12, 0xb3, 0x3c, 0x24, 0x84, 0xc4, 0xda, 0x40, 0x12, 0xb1, 0x4e,
+ 0x42, 0xef, 0x26, 0x42, 0x90, 0x20, 0xda, 0x33, 0x1d, 0x6f, 0xb3, 0x9e, 0x19, 0x6b, 0xba, 0x6d,
+ 0x65, 0x83, 0x90, 0xb8, 0x70, 0xe7, 0x02, 0x67, 0x90, 0x38, 0x21, 0xb8, 0xc2, 0x99, 0x5b, 0x8e,
+ 0x39, 0x26, 0x02, 0x59, 0x64, 0xf8, 0x2f, 0x72, 0x42, 0xfd, 0x98, 0xf1, 0x8c, 0x1f, 0x6b, 0xc7,
+ 0x38, 0xe1, 0x71, 0x9b, 0xee, 0xaa, 0xfa, 0x55, 0x4f, 0xfd, 0xaa, 0xab, 0xbb, 0x1a, 0x5c, 0xdc,
+ 0x7b, 0x8d, 0x19, 0xd4, 0x33, 0xf7, 0xda, 0x75, 0xe2, 0xbb, 0x84, 0x13, 0x66, 0x76, 0x88, 0x6b,
+ 0x7b, 0xbe, 0xa9, 0x05, 0xb8, 0x45, 0x4d, 0xdc, 0xe6, 0x1e, 0xb3, 0x70, 0x93, 0xba, 0x0d, 0xb3,
+ 0x53, 0xae, 0x13, 0x8e, 0x2f, 0x98, 0x0d, 0xe2, 0x12, 0x1f, 0x73, 0x62, 0x1b, 0x2d, 0xdf, 0xe3,
+ 0x1e, 0x2c, 0x28, 0x7d, 0x03, 0xb7, 0xa8, 0x11, 0xd3, 0x37, 0xb4, 0xfe, 0xda, 0xb9, 0x06, 0xe5,
+ 0xbb, 0xed, 0xba, 0x61, 0x79, 0x8e, 0xd9, 0xf0, 0x1a, 0x9e, 0x29, 0xcd, 0xea, 0xed, 0xdb, 0x72,
+ 0x24, 0x07, 0xf2, 0x4b, 0xc1, 0xad, 0x95, 0x62, 0xee, 0x2d, 0xcf, 0x27, 0x66, 0x67, 0xc0, 0xe5,
+ 0xda, 0x46, 0x4f, 0xc7, 0xc1, 0xd6, 0x2e, 0x75, 0x89, 0xbf, 0x6f, 0xb6, 0xf6, 0x1a, 0xd2, 0xc8,
+ 0x27, 0xcc, 0x6b, 0xfb, 0x16, 0x79, 0x22, 0x2b, 0x66, 0x3a, 0x84, 0xe3, 0x61, 0xbe, 0xcc, 0x51,
+ 0x56, 0x7e, 0xdb, 0xe5, 0xd4, 0x19, 0x74, 0xf3, 0xca, 0x38, 0x03, 0x66, 0xed, 0x12, 0x07, 0xf7,
+ 0xdb, 0x95, 0xbe, 0x4a, 0x81, 0x53, 0x55, 0xdf, 0x63, 0xec, 0x06, 0xf1, 0x19, 0xf5, 0xdc, 0xab,
+ 0xf5, 0x4f, 0x88, 0xc5, 0x11, 0xb9, 0x4d, 0x7c, 0xe2, 0x5a, 0x04, 0xae, 0x83, 0xec, 0x1e, 0x75,
+ 0xed, 0x7c, 0x6a, 0x3d, 0x75, 0xe6, 0x70, 0x65, 0xe9, 0x5e, 0xb7, 0x38, 0x17, 0x74, 0x8b, 0xd9,
+ 0x77, 0xa9, 0x6b, 0x23, 0x29, 0x11, 0x1a, 0x2e, 0x76, 0x48, 0x3e, 0x9d, 0xd4, 0xb8, 0x82, 0x1d,
+ 0x82, 0xa4, 0x04, 0x96, 0x01, 0xc0, 0x2d, 0xaa, 0x1d, 0xe4, 0x33, 0x52, 0x0f, 0x6a, 0x3d, 0xb0,
+ 0x79, 0xed, 0xb2, 0x96, 0xa0, 0x98, 0x56, 0xe9, 0xeb, 0x0c, 0x38, 0xf6, 0xf6, 0x1d, 0x4e, 0x7c,
+ 0x17, 0x37, 0x6b, 0x84, 0xfb, 0xd4, 0xda, 0x96, 0xf1, 0x15, 0x60, 0x8e, 0x1c, 0x0b, 0x07, 0x7a,
+ 0x59, 0x11, 0x58, 0x2d, 0x92, 0xa0, 0x98, 0x16, 0xf4, 0xc0, 0xb2, 0x1a, 0x6d, 0x93, 0x26, 0xb1,
+ 0xb8, 0xe7, 0xcb, 0xc5, 0xe6, 0xca, 0x2f, 0x19, 0xbd, 0x2c, 0x8a, 0xa2, 0x66, 0xb4, 0xf6, 0x1a,
+ 0x62, 0x82, 0x19, 0x82, 0x1c, 0xa3, 0x73, 0xc1, 0xd8, 0xc2, 0x75, 0xd2, 0x0c, 0x4d, 0x2b, 0x30,
+ 0xe8, 0x16, 0x97, 0x6b, 0x09, 0x38, 0xd4, 0x07, 0x0f, 0x31, 0xc8, 0x71, 0xec, 0x37, 0x08, 0xbf,
+ 0x81, 0x9b, 0x6d, 0x22, 0x7f, 0x39, 0x57, 0x36, 0x0e, 0xf2, 0x66, 0x84, 0x09, 0x64, 0xbc, 0xd7,
+ 0xc6, 0x2e, 0xa7, 0x7c, 0xbf, 0xb2, 0x12, 0x74, 0x8b, 0xb9, 0x9d, 0x1e, 0x0c, 0x8a, 0x63, 0xc2,
+ 0x0e, 0x80, 0x6a, 0xb8, 0xd9, 0x21, 0x3e, 0x6e, 0x10, 0xe5, 0x29, 0x3b, 0x95, 0xa7, 0xe3, 0x41,
+ 0xb7, 0x08, 0x77, 0x06, 0xd0, 0xd0, 0x10, 0x0f, 0xa5, 0x6f, 0x06, 0x89, 0xe1, 0x98, 0xb7, 0xd9,
+ 0xbf, 0x83, 0x98, 0x5d, 0xb0, 0x64, 0xb5, 0x7d, 0x9f, 0xb8, 0x7f, 0x89, 0x99, 0x63, 0xfa, 0xb7,
+ 0x96, 0xaa, 0x31, 0x2c, 0x94, 0x40, 0x86, 0xfb, 0xe0, 0xa8, 0x1e, 0xcf, 0x80, 0xa0, 0x13, 0x41,
+ 0xb7, 0x78, 0xb4, 0x3a, 0x08, 0x87, 0x86, 0xf9, 0x28, 0xfd, 0x92, 0x06, 0x27, 0x2e, 0x79, 0x3e,
+ 0xbd, 0xeb, 0xb9, 0x1c, 0x37, 0xaf, 0x79, 0xf6, 0xa6, 0x2e, 0x90, 0xc4, 0x87, 0x1f, 0x83, 0x45,
+ 0x11, 0x3d, 0x1b, 0x73, 0x2c, 0x39, 0xca, 0x95, 0xcf, 0x4f, 0x16, 0x6b, 0x55, 0x18, 0x6a, 0x84,
+ 0xe3, 0x1e, 0xab, 0xbd, 0x39, 0x14, 0xa1, 0xc2, 0x5b, 0x20, 0xcb, 0x5a, 0xc4, 0xd2, 0x4c, 0xbe,
+ 0x6e, 0x1c, 0x5c, 0xa8, 0x8d, 0x11, 0x0b, 0xdd, 0x6e, 0x11, 0xab, 0x57, 0x4c, 0xc4, 0x08, 0x49,
+ 0x58, 0x48, 0xc0, 0x02, 0x93, 0x09, 0xa7, 0xb9, 0x7b, 0x63, 0x5a, 0x07, 0x12, 0xa4, 0xb2, 0xac,
+ 0x5d, 0x2c, 0xa8, 0x31, 0xd2, 0xe0, 0xa5, 0x2f, 0x32, 0x60, 0x7d, 0x84, 0x65, 0xd5, 0x73, 0x6d,
+ 0xca, 0xa9, 0xe7, 0xc2, 0x4b, 0x20, 0xcb, 0xf7, 0x5b, 0x61, 0xb2, 0x6f, 0x84, 0xab, 0xdd, 0xd9,
+ 0x6f, 0x91, 0xc7, 0xdd, 0xe2, 0x73, 0xe3, 0xec, 0x85, 0x1e, 0x92, 0x08, 0x70, 0x2b, 0xfa, 0xab,
+ 0x74, 0x02, 0x4b, 0x2f, 0xeb, 0x71, 0xb7, 0x38, 0xe4, 0x84, 0x32, 0x22, 0xa4, 0xe4, 0xe2, 0x45,
+ 0x6d, 0x68, 0x62, 0xc6, 0x77, 0x7c, 0xec, 0x32, 0xe5, 0x89, 0x3a, 0x61, 0xae, 0x9f, 0x9d, 0x8c,
+ 0x6e, 0x61, 0x51, 0x59, 0xd3, 0xab, 0x80, 0x5b, 0x03, 0x68, 0x68, 0x88, 0x07, 0xf8, 0x3c, 0x58,
+ 0xf0, 0x09, 0x66, 0x9e, 0x2b, 0xd3, 0xfc, 0x70, 0x2f, 0xb8, 0x48, 0xce, 0x22, 0x2d, 0x85, 0x2f,
+ 0x80, 0x43, 0x0e, 0x61, 0x0c, 0x37, 0x48, 0x7e, 0x5e, 0x2a, 0xae, 0x68, 0xc5, 0x43, 0x35, 0x35,
+ 0x8d, 0x42, 0x79, 0xe9, 0x61, 0x0a, 0x9c, 0x1a, 0x11, 0xc7, 0x2d, 0xca, 0x38, 0xbc, 0x39, 0x90,
+ 0xcf, 0xc6, 0x84, 0xb5, 0x83, 0x32, 0x95, 0xcd, 0xab, 0xda, 0xf7, 0x62, 0x38, 0x13, 0xcb, 0xe5,
+ 0x9b, 0x60, 0x9e, 0x72, 0xe2, 0x08, 0x56, 0x32, 0x67, 0x72, 0xe5, 0x57, 0xa7, 0xcc, 0xb5, 0xca,
+ 0x11, 0xed, 0x63, 0xfe, 0xb2, 0x40, 0x43, 0x0a, 0xb4, 0xf4, 0x6b, 0x7a, 0xe4, 0xbf, 0x89, 0x84,
+ 0x87, 0x9f, 0x82, 0x65, 0x39, 0x52, 0x95, 0x19, 0x91, 0xdb, 0xfa, 0x0f, 0xc7, 0xee, 0xa9, 0x03,
+ 0x0e, 0xf4, 0xca, 0x71, 0xbd, 0x94, 0xe5, 0xed, 0x04, 0x34, 0xea, 0x73, 0x05, 0x2f, 0x80, 0x9c,
+ 0x43, 0x5d, 0x44, 0x5a, 0x4d, 0x6a, 0x61, 0x95, 0x96, 0xf3, 0xea, 0x48, 0xaa, 0xf5, 0xa6, 0x51,
+ 0x5c, 0x07, 0xbe, 0x0c, 0x72, 0x0e, 0xbe, 0x13, 0x99, 0x64, 0xa4, 0xc9, 0x51, 0xed, 0x2f, 0x57,
+ 0xeb, 0x89, 0x50, 0x5c, 0x0f, 0x5e, 0x17, 0xd9, 0x20, 0xaa, 0x34, 0xcb, 0x67, 0x65, 0x98, 0xcf,
+ 0x8e, 0xfb, 0x3f, 0x5d, 0xe4, 0x45, 0x89, 0x88, 0x65, 0x8e, 0x84, 0x40, 0x21, 0x56, 0xe9, 0xa7,
+ 0x2c, 0x38, 0x7d, 0xe0, 0xde, 0x87, 0xef, 0x00, 0xe8, 0xd5, 0x19, 0xf1, 0x3b, 0xc4, 0xbe, 0xa8,
+ 0xae, 0x45, 0xe2, 0x7e, 0x22, 0x62, 0x9c, 0x51, 0x47, 0xe2, 0xd5, 0x01, 0x29, 0x1a, 0x62, 0x01,
+ 0x2d, 0x70, 0x44, 0x6c, 0x06, 0x15, 0x50, 0xaa, 0xaf, 0x42, 0x4f, 0xb6, 0xd3, 0xfe, 0x17, 0x74,
+ 0x8b, 0x47, 0xb6, 0xe2, 0x20, 0x28, 0x89, 0x09, 0x37, 0xc1, 0x8a, 0xae, 0xf5, 0x7d, 0x01, 0x3e,
+ 0xa1, 0x23, 0xb0, 0x52, 0x4d, 0x8a, 0x51, 0xbf, 0xbe, 0x80, 0xb0, 0x09, 0xa3, 0x3e, 0xb1, 0x23,
+ 0x88, 0x6c, 0x12, 0xe2, 0xad, 0xa4, 0x18, 0xf5, 0xeb, 0xc3, 0x26, 0x58, 0xd6, 0xa8, 0x3a, 0xde,
+ 0xf9, 0x79, 0x49, 0xd9, 0x8b, 0x13, 0x52, 0xa6, 0x8a, 0x6e, 0x94, 0x83, 0xd5, 0x04, 0x16, 0xea,
+ 0xc3, 0x86, 0x1c, 0x00, 0x2b, 0x2c, 0x71, 0x2c, 0xbf, 0x20, 0x3d, 0xbd, 0x39, 0xe5, 0x1e, 0x8c,
+ 0x6a, 0x65, 0xef, 0xf8, 0x8a, 0xa6, 0x18, 0x8a, 0xf9, 0x29, 0x7d, 0x9f, 0x01, 0xa0, 0x97, 0x61,
+ 0x70, 0x23, 0x51, 0xe4, 0xd7, 0xfb, 0x8a, 0xfc, 0x6a, 0xfc, 0x72, 0x1a, 0x2b, 0xe8, 0x37, 0xc0,
+ 0x82, 0x27, 0x77, 0x9e, 0x4e, 0x86, 0xf2, 0xb8, 0x65, 0x47, 0x67, 0x69, 0x84, 0x56, 0x01, 0xa2,
+ 0x74, 0xea, 0xfd, 0xab, 0xd1, 0xe0, 0x15, 0x90, 0x6d, 0x79, 0x76, 0x78, 0xf8, 0x9d, 0x1f, 0x87,
+ 0x7a, 0xcd, 0xb3, 0x59, 0x02, 0x73, 0x51, 0xac, 0x5d, 0xcc, 0x22, 0x89, 0x03, 0x3f, 0x02, 0x8b,
+ 0xe1, 0x75, 0x43, 0xdf, 0x4d, 0x36, 0xc6, 0x61, 0x22, 0xad, 0x9f, 0xc0, 0x5d, 0x12, 0x15, 0x34,
+ 0x94, 0xa0, 0x08, 0x53, 0xe0, 0x13, 0x7d, 0x5b, 0x94, 0xb5, 0x7e, 0x02, 0xfc, 0x61, 0xd7, 0x7e,
+ 0x85, 0x1f, 0x4a, 0x50, 0x84, 0x59, 0xfa, 0x21, 0x03, 0x96, 0x12, 0xd7, 0xd0, 0xbf, 0x83, 0x2e,
+ 0x95, 0xd5, 0xb3, 0xa5, 0x4b, 0x61, 0xce, 0x9e, 0x2e, 0x85, 0xfb, 0xf4, 0xe8, 0x8a, 0xe1, 0x0f,
+ 0xa1, 0xeb, 0x61, 0x06, 0xc0, 0xc1, 0x4c, 0x87, 0x16, 0x58, 0x50, 0xad, 0xc6, 0x2c, 0x4e, 0xb8,
+ 0xe8, 0xd6, 0xa1, 0x0f, 0x33, 0x0d, 0xdd, 0xd7, 0xa0, 0xa4, 0x27, 0x6a, 0x50, 0xc8, 0x2c, 0x1a,
+ 0xb9, 0xe8, 0x08, 0x1c, 0xd9, 0xcc, 0xdd, 0x02, 0x8b, 0x2c, 0xec, 0x80, 0xb2, 0xd3, 0x77, 0x40,
+ 0x32, 0xea, 0x51, 0xef, 0x13, 0x41, 0x42, 0x1b, 0x2c, 0xe1, 0x78, 0x13, 0x32, 0x3f, 0xd5, 0x6f,
+ 0xac, 0x8a, 0x8e, 0x27, 0xd1, 0x7d, 0x24, 0x50, 0x4b, 0xbf, 0xf5, 0x73, 0xab, 0x36, 0xe4, 0x3f,
+ 0x96, 0xdb, 0x67, 0xd7, 0x0b, 0xfe, 0x27, 0xe8, 0xfd, 0x36, 0x0d, 0x56, 0xfb, 0x8f, 0x93, 0xa9,
+ 0x9a, 0xfe, 0xbb, 0x43, 0x5f, 0x2e, 0xd2, 0x53, 0x2d, 0x3a, 0xea, 0x50, 0x26, 0x7b, 0xbd, 0x48,
+ 0x30, 0x91, 0x99, 0x39, 0x13, 0xa5, 0xef, 0x92, 0x31, 0x9a, 0xfe, 0x61, 0xe4, 0xb3, 0xe1, 0xaf,
+ 0x07, 0xd3, 0x05, 0xe9, 0x94, 0x76, 0x36, 0xf1, 0x0b, 0xc2, 0xd3, 0x0e, 0xd3, 0x8f, 0x69, 0x70,
+ 0x6c, 0xd8, 0x2d, 0x02, 0x56, 0xf5, 0x5b, 0xa2, 0x0a, 0x92, 0x19, 0x7f, 0x4b, 0x7c, 0xdc, 0x2d,
+ 0x16, 0x87, 0xb4, 0xc0, 0x21, 0x4c, 0xec, 0xb9, 0xf1, 0x7d, 0x90, 0x4f, 0x30, 0x7f, 0x9d, 0xd3,
+ 0x26, 0xbd, 0xab, 0x2e, 0xf7, 0xaa, 0x8d, 0xf9, 0x7f, 0xd0, 0x2d, 0xe6, 0x77, 0x46, 0xe8, 0xa0,
+ 0x91, 0xd6, 0x23, 0xde, 0xdc, 0x32, 0x4f, 0xfd, 0xcd, 0xed, 0xe7, 0xc1, 0x78, 0xa9, 0xd4, 0x9a,
+ 0x49, 0xbc, 0x3e, 0x04, 0x27, 0x93, 0x39, 0x30, 0x18, 0xb0, 0xd3, 0x41, 0xb7, 0x78, 0xb2, 0x3a,
+ 0x4a, 0x09, 0x8d, 0xb6, 0x1f, 0x95, 0xc8, 0x99, 0x67, 0x93, 0xc8, 0x95, 0x73, 0xf7, 0x1e, 0x15,
+ 0xe6, 0xee, 0x3f, 0x2a, 0xcc, 0x3d, 0x78, 0x54, 0x98, 0xfb, 0x3c, 0x28, 0xa4, 0xee, 0x05, 0x85,
+ 0xd4, 0xfd, 0xa0, 0x90, 0x7a, 0x10, 0x14, 0x52, 0xbf, 0x07, 0x85, 0xd4, 0x97, 0x7f, 0x14, 0xe6,
+ 0x3e, 0x38, 0xa4, 0x8f, 0x9e, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x05, 0x26, 0x31, 0x5d, 0x9f,
+ 0x18, 0x00, 0x00,
}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/generated.proto b/staging/src/k8s.io/api/autoscaling/v2beta1/generated.proto
index 5cc6063d014..04bc0ed6014 100644
--- a/staging/src/k8s.io/api/autoscaling/v2beta1/generated.proto
+++ b/staging/src/k8s.io/api/autoscaling/v2beta1/generated.proto
@@ -186,6 +186,7 @@ message HorizontalPodAutoscalerStatus {
optional int32 desiredReplicas = 4;
// currentMetrics is the last read state of the metrics used by this autoscaler.
+ // +optional
repeated MetricStatus currentMetrics = 5;
// conditions is the set of conditions required for this autoscaler to scale its target,
@@ -273,6 +274,17 @@ message ObjectMetricSource {
// targetValue is the target value of the metric (as a quantity).
optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// ObjectMetricStatus indicates the current value of a metric describing a
@@ -286,6 +298,17 @@ message ObjectMetricStatus {
// currentValue is the current value of the metric (as a quantity).
optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -299,6 +322,12 @@ message PodsMetricSource {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -310,6 +339,12 @@ message PodsMetricStatus {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// ResourceMetricSource indicates how to scale on a resource metric known to
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/types.go b/staging/src/k8s.io/api/autoscaling/v2beta1/types.go
index f842cc342da..6a30e6774db 100644
--- a/staging/src/k8s.io/api/autoscaling/v2beta1/types.go
+++ b/staging/src/k8s.io/api/autoscaling/v2beta1/types.go
@@ -123,6 +123,16 @@ type ObjectMetricSource struct {
MetricName string `json:"metricName" protobuf:"bytes,2,name=metricName"`
// targetValue is the target value of the metric (as a quantity).
TargetValue resource.Quantity `json:"targetValue" protobuf:"bytes,3,name=targetValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,name=selector"`
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,5,name=averageValue"`
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -135,6 +145,12 @@ type PodsMetricSource struct {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
TargetAverageValue resource.Quantity `json:"targetAverageValue" protobuf:"bytes,2,name=targetAverageValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,3,name=selector"`
}
// ResourceMetricSource indicates how to scale on a resource metric known to
@@ -200,6 +216,7 @@ type HorizontalPodAutoscalerStatus struct {
DesiredReplicas int32 `json:"desiredReplicas" protobuf:"varint,4,opt,name=desiredReplicas"`
// currentMetrics is the last read state of the metrics used by this autoscaler.
+ // +optional
CurrentMetrics []MetricStatus `json:"currentMetrics" protobuf:"bytes,5,rep,name=currentMetrics"`
// conditions is the set of conditions required for this autoscaler to scale its target,
@@ -284,6 +301,16 @@ type ObjectMetricStatus struct {
MetricName string `json:"metricName" protobuf:"bytes,2,name=metricName"`
// currentValue is the current value of the metric (as a quantity).
CurrentValue resource.Quantity `json:"currentValue" protobuf:"bytes,3,name=currentValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,name=selector"`
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ // +optional
+ AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,5,name=averageValue"`
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -294,6 +321,12 @@ type PodsMetricStatus struct {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
CurrentAverageValue resource.Quantity `json:"currentAverageValue" protobuf:"bytes,2,name=currentAverageValue"`
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,3,name=selector"`
}
// ResourceMetricStatus indicates the current value of a resource metric known to
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go
index 6fa9385c234..411b817d04e 100644
--- a/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go
+++ b/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go
@@ -149,10 +149,12 @@ func (MetricStatus) SwaggerDoc() map[string]string {
}
var map_ObjectMetricSource = map[string]string{
- "": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
- "target": "target is the described Kubernetes object.",
- "metricName": "metricName is the name of the metric in question.",
- "targetValue": "targetValue is the target value of the metric (as a quantity).",
+ "": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "target": "target is the described Kubernetes object.",
+ "metricName": "metricName is the name of the metric in question.",
+ "targetValue": "targetValue is the target value of the metric (as a quantity).",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
+ "averageValue": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
}
func (ObjectMetricSource) SwaggerDoc() map[string]string {
@@ -164,6 +166,8 @@ var map_ObjectMetricStatus = map[string]string{
"target": "target is the described Kubernetes object.",
"metricName": "metricName is the name of the metric in question.",
"currentValue": "currentValue is the current value of the metric (as a quantity).",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+ "averageValue": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
}
func (ObjectMetricStatus) SwaggerDoc() map[string]string {
@@ -174,6 +178,7 @@ var map_PodsMetricSource = map[string]string{
"": "PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
"metricName": "metricName is the name of the metric in question",
"targetAverageValue": "targetAverageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping When unset, just the metricName will be used to gather metrics.",
}
func (PodsMetricSource) SwaggerDoc() map[string]string {
@@ -184,6 +189,7 @@ var map_PodsMetricStatus = map[string]string{
"": "PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).",
"metricName": "metricName is the name of the metric in question",
"currentAverageValue": "currentAverageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
}
func (PodsMetricStatus) SwaggerDoc() map[string]string {
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go
index 41da778fab0..2ec7e615613 100644
--- a/staging/src/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go
@@ -322,6 +322,16 @@ func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource) {
*out = *in
out.Target = in.Target
out.TargetValue = in.TargetValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
return
}
@@ -340,6 +350,16 @@ func (in *ObjectMetricStatus) DeepCopyInto(out *ObjectMetricStatus) {
*out = *in
out.Target = in.Target
out.CurrentValue = in.CurrentValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
return
}
@@ -357,6 +377,11 @@ func (in *ObjectMetricStatus) DeepCopy() *ObjectMetricStatus {
func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource) {
*out = *in
out.TargetAverageValue = in.TargetAverageValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -374,6 +399,11 @@ func (in *PodsMetricSource) DeepCopy() *PodsMetricSource {
func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus) {
*out = *in
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
return
}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/BUILD b/staging/src/k8s.io/api/autoscaling/v2beta2/BUILD
new file mode 100644
index 00000000000..bb211b2605a
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/BUILD
@@ -0,0 +1,44 @@
+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/autoscaling/v2beta2",
+ importpath = "k8s.io/api/autoscaling/v2beta2",
+ 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",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "go_default_library_protos",
+ srcs = ["generated.proto"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/doc.go b/staging/src/k8s.io/api/autoscaling/v2beta2/doc.go
new file mode 100644
index 00000000000..7c7d2b6f1e7
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2018 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:openapi-gen=true
+
+package v2beta2 // import "k8s.io/api/autoscaling/v2beta2"
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/generated.pb.go b/staging/src/k8s.io/api/autoscaling/v2beta2/generated.pb.go
new file mode 100644
index 00000000000..be752a14025
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/generated.pb.go
@@ -0,0 +1,4438 @@
+/*
+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 protoc-gen-gogo.
+// source: k8s.io/kubernetes/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto
+// DO NOT EDIT!
+
+/*
+ Package v2beta2 is a generated protocol buffer package.
+
+ It is generated from these files:
+ k8s.io/kubernetes/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto
+
+ It has these top-level messages:
+ CrossVersionObjectReference
+ ExternalMetricSource
+ ExternalMetricStatus
+ HorizontalPodAutoscaler
+ HorizontalPodAutoscalerCondition
+ HorizontalPodAutoscalerList
+ HorizontalPodAutoscalerSpec
+ HorizontalPodAutoscalerStatus
+ MetricIdentifier
+ MetricSpec
+ MetricStatus
+ MetricTarget
+ MetricValueStatus
+ ObjectMetricSource
+ ObjectMetricStatus
+ PodsMetricSource
+ PodsMetricStatus
+ ResourceMetricSource
+ ResourceMetricStatus
+*/
+package v2beta2
+
+import proto "github.com/gogo/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+import k8s_io_apimachinery_pkg_api_resource "k8s.io/apimachinery/pkg/api/resource"
+import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+import k8s_io_api_core_v1 "k8s.io/api/core/v1"
+
+import strings "strings"
+import reflect "reflect"
+
+import io "io"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
+
+func (m *CrossVersionObjectReference) Reset() { *m = CrossVersionObjectReference{} }
+func (*CrossVersionObjectReference) ProtoMessage() {}
+func (*CrossVersionObjectReference) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{0}
+}
+
+func (m *ExternalMetricSource) Reset() { *m = ExternalMetricSource{} }
+func (*ExternalMetricSource) ProtoMessage() {}
+func (*ExternalMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
+
+func (m *ExternalMetricStatus) Reset() { *m = ExternalMetricStatus{} }
+func (*ExternalMetricStatus) ProtoMessage() {}
+func (*ExternalMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
+
+func (m *HorizontalPodAutoscaler) Reset() { *m = HorizontalPodAutoscaler{} }
+func (*HorizontalPodAutoscaler) ProtoMessage() {}
+func (*HorizontalPodAutoscaler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
+
+func (m *HorizontalPodAutoscalerCondition) Reset() { *m = HorizontalPodAutoscalerCondition{} }
+func (*HorizontalPodAutoscalerCondition) ProtoMessage() {}
+func (*HorizontalPodAutoscalerCondition) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{4}
+}
+
+func (m *HorizontalPodAutoscalerList) Reset() { *m = HorizontalPodAutoscalerList{} }
+func (*HorizontalPodAutoscalerList) ProtoMessage() {}
+func (*HorizontalPodAutoscalerList) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{5}
+}
+
+func (m *HorizontalPodAutoscalerSpec) Reset() { *m = HorizontalPodAutoscalerSpec{} }
+func (*HorizontalPodAutoscalerSpec) ProtoMessage() {}
+func (*HorizontalPodAutoscalerSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{6}
+}
+
+func (m *HorizontalPodAutoscalerStatus) Reset() { *m = HorizontalPodAutoscalerStatus{} }
+func (*HorizontalPodAutoscalerStatus) ProtoMessage() {}
+func (*HorizontalPodAutoscalerStatus) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{7}
+}
+
+func (m *MetricIdentifier) Reset() { *m = MetricIdentifier{} }
+func (*MetricIdentifier) ProtoMessage() {}
+func (*MetricIdentifier) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} }
+
+func (m *MetricSpec) Reset() { *m = MetricSpec{} }
+func (*MetricSpec) ProtoMessage() {}
+func (*MetricSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} }
+
+func (m *MetricStatus) Reset() { *m = MetricStatus{} }
+func (*MetricStatus) ProtoMessage() {}
+func (*MetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} }
+
+func (m *MetricTarget) Reset() { *m = MetricTarget{} }
+func (*MetricTarget) ProtoMessage() {}
+func (*MetricTarget) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} }
+
+func (m *MetricValueStatus) Reset() { *m = MetricValueStatus{} }
+func (*MetricValueStatus) ProtoMessage() {}
+func (*MetricValueStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} }
+
+func (m *ObjectMetricSource) Reset() { *m = ObjectMetricSource{} }
+func (*ObjectMetricSource) ProtoMessage() {}
+func (*ObjectMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} }
+
+func (m *ObjectMetricStatus) Reset() { *m = ObjectMetricStatus{} }
+func (*ObjectMetricStatus) ProtoMessage() {}
+func (*ObjectMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} }
+
+func (m *PodsMetricSource) Reset() { *m = PodsMetricSource{} }
+func (*PodsMetricSource) ProtoMessage() {}
+func (*PodsMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} }
+
+func (m *PodsMetricStatus) Reset() { *m = PodsMetricStatus{} }
+func (*PodsMetricStatus) ProtoMessage() {}
+func (*PodsMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} }
+
+func (m *ResourceMetricSource) Reset() { *m = ResourceMetricSource{} }
+func (*ResourceMetricSource) ProtoMessage() {}
+func (*ResourceMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{17} }
+
+func (m *ResourceMetricStatus) Reset() { *m = ResourceMetricStatus{} }
+func (*ResourceMetricStatus) ProtoMessage() {}
+func (*ResourceMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{18} }
+
+func init() {
+ proto.RegisterType((*CrossVersionObjectReference)(nil), "k8s.io.api.autoscaling.v2beta2.CrossVersionObjectReference")
+ proto.RegisterType((*ExternalMetricSource)(nil), "k8s.io.api.autoscaling.v2beta2.ExternalMetricSource")
+ proto.RegisterType((*ExternalMetricStatus)(nil), "k8s.io.api.autoscaling.v2beta2.ExternalMetricStatus")
+ proto.RegisterType((*HorizontalPodAutoscaler)(nil), "k8s.io.api.autoscaling.v2beta2.HorizontalPodAutoscaler")
+ proto.RegisterType((*HorizontalPodAutoscalerCondition)(nil), "k8s.io.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition")
+ proto.RegisterType((*HorizontalPodAutoscalerList)(nil), "k8s.io.api.autoscaling.v2beta2.HorizontalPodAutoscalerList")
+ proto.RegisterType((*HorizontalPodAutoscalerSpec)(nil), "k8s.io.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec")
+ proto.RegisterType((*HorizontalPodAutoscalerStatus)(nil), "k8s.io.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus")
+ proto.RegisterType((*MetricIdentifier)(nil), "k8s.io.api.autoscaling.v2beta2.MetricIdentifier")
+ proto.RegisterType((*MetricSpec)(nil), "k8s.io.api.autoscaling.v2beta2.MetricSpec")
+ proto.RegisterType((*MetricStatus)(nil), "k8s.io.api.autoscaling.v2beta2.MetricStatus")
+ proto.RegisterType((*MetricTarget)(nil), "k8s.io.api.autoscaling.v2beta2.MetricTarget")
+ proto.RegisterType((*MetricValueStatus)(nil), "k8s.io.api.autoscaling.v2beta2.MetricValueStatus")
+ proto.RegisterType((*ObjectMetricSource)(nil), "k8s.io.api.autoscaling.v2beta2.ObjectMetricSource")
+ proto.RegisterType((*ObjectMetricStatus)(nil), "k8s.io.api.autoscaling.v2beta2.ObjectMetricStatus")
+ proto.RegisterType((*PodsMetricSource)(nil), "k8s.io.api.autoscaling.v2beta2.PodsMetricSource")
+ proto.RegisterType((*PodsMetricStatus)(nil), "k8s.io.api.autoscaling.v2beta2.PodsMetricStatus")
+ proto.RegisterType((*ResourceMetricSource)(nil), "k8s.io.api.autoscaling.v2beta2.ResourceMetricSource")
+ proto.RegisterType((*ResourceMetricStatus)(nil), "k8s.io.api.autoscaling.v2beta2.ResourceMetricStatus")
+}
+func (m *CrossVersionObjectReference) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *CrossVersionObjectReference) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind)))
+ i += copy(dAtA[i:], m.Kind)
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i += copy(dAtA[i:], m.Name)
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIVersion)))
+ i += copy(dAtA[i:], m.APIVersion)
+ return i, nil
+}
+
+func (m *ExternalMetricSource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ExternalMetricSource) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n1, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n1
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
+ n2, err := m.Target.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n2
+ return i, nil
+}
+
+func (m *ExternalMetricStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ExternalMetricStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n3, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n3
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Current.Size()))
+ n4, err := m.Current.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n4
+ return i, nil
+}
+
+func (m *HorizontalPodAutoscaler) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *HorizontalPodAutoscaler) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size()))
+ n5, err := m.ObjectMeta.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n5
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size()))
+ n6, err := m.Spec.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n6
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size()))
+ n7, err := m.Status.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n7
+ return i, nil
+}
+
+func (m *HorizontalPodAutoscalerCondition) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *HorizontalPodAutoscalerCondition) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
+ i += copy(dAtA[i:], m.Type)
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status)))
+ i += copy(dAtA[i:], m.Status)
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size()))
+ n8, err := m.LastTransitionTime.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n8
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason)))
+ i += copy(dAtA[i:], m.Reason)
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message)))
+ i += copy(dAtA[i:], m.Message)
+ return i, nil
+}
+
+func (m *HorizontalPodAutoscalerList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *HorizontalPodAutoscalerList) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
+ n9, err := m.ListMeta.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n9
+ if len(m.Items) > 0 {
+ for _, msg := range m.Items {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func (m *HorizontalPodAutoscalerSpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *HorizontalPodAutoscalerSpec) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ScaleTargetRef.Size()))
+ n10, err := m.ScaleTargetRef.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n10
+ if m.MinReplicas != nil {
+ dAtA[i] = 0x10
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.MinReplicas))
+ }
+ dAtA[i] = 0x18
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.MaxReplicas))
+ if len(m.Metrics) > 0 {
+ for _, msg := range m.Metrics {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func (m *HorizontalPodAutoscalerStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *HorizontalPodAutoscalerStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if m.ObservedGeneration != nil {
+ dAtA[i] = 0x8
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.ObservedGeneration))
+ }
+ if m.LastScaleTime != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.LastScaleTime.Size()))
+ n11, err := m.LastScaleTime.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n11
+ }
+ dAtA[i] = 0x18
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentReplicas))
+ dAtA[i] = 0x20
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.DesiredReplicas))
+ if len(m.CurrentMetrics) > 0 {
+ for _, msg := range m.CurrentMetrics {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ if len(m.Conditions) > 0 {
+ for _, msg := range m.Conditions {
+ dAtA[i] = 0x32
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func (m *MetricIdentifier) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricIdentifier) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i += copy(dAtA[i:], m.Name)
+ if m.Selector != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n12, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n12
+ }
+ return i, nil
+}
+
+func (m *MetricSpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricSpec) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
+ i += copy(dAtA[i:], m.Type)
+ if m.Object != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size()))
+ n13, err := m.Object.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n13
+ }
+ if m.Pods != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size()))
+ n14, err := m.Pods.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n14
+ }
+ if m.Resource != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size()))
+ n15, err := m.Resource.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n15
+ }
+ if m.External != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size()))
+ n16, err := m.External.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n16
+ }
+ return i, nil
+}
+
+func (m *MetricStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
+ i += copy(dAtA[i:], m.Type)
+ if m.Object != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size()))
+ n17, err := m.Object.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n17
+ }
+ if m.Pods != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size()))
+ n18, err := m.Pods.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n18
+ }
+ if m.Resource != nil {
+ dAtA[i] = 0x22
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size()))
+ n19, err := m.Resource.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n19
+ }
+ if m.External != nil {
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size()))
+ n20, err := m.External.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n20
+ }
+ return i, nil
+}
+
+func (m *MetricTarget) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricTarget) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
+ i += copy(dAtA[i:], m.Type)
+ if m.Value != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Value.Size()))
+ n21, err := m.Value.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n21
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n22, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n22
+ }
+ if m.AverageUtilization != nil {
+ dAtA[i] = 0x20
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.AverageUtilization))
+ }
+ return i, nil
+}
+
+func (m *MetricValueStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricValueStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if m.Value != nil {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Value.Size()))
+ n23, err := m.Value.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n23
+ }
+ if m.AverageValue != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.AverageValue.Size()))
+ n24, err := m.AverageValue.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n24
+ }
+ if m.AverageUtilization != nil {
+ dAtA[i] = 0x18
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.AverageUtilization))
+ }
+ return i, nil
+}
+
+func (m *ObjectMetricSource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.DescribedObject.Size()))
+ n25, err := m.DescribedObject.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n25
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
+ n26, err := m.Target.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n26
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n27, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n27
+ return i, nil
+}
+
+func (m *ObjectMetricStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n28, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n28
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Current.Size()))
+ n29, err := m.Current.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n29
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.DescribedObject.Size()))
+ n30, err := m.DescribedObject.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n30
+ return i, nil
+}
+
+func (m *PodsMetricSource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *PodsMetricSource) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n31, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n31
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
+ n32, err := m.Target.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n32
+ return i, nil
+}
+
+func (m *PodsMetricStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *PodsMetricStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n33, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n33
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Current.Size()))
+ n34, err := m.Current.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n34
+ return i, nil
+}
+
+func (m *ResourceMetricSource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceMetricSource) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i += copy(dAtA[i:], m.Name)
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size()))
+ n35, err := m.Target.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n35
+ return i, nil
+}
+
+func (m *ResourceMetricStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceMetricStatus) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i += copy(dAtA[i:], m.Name)
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Current.Size()))
+ n36, err := m.Current.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n36
+ return i, nil
+}
+
+func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ dAtA[offset+4] = uint8(v >> 32)
+ dAtA[offset+5] = uint8(v >> 40)
+ dAtA[offset+6] = uint8(v >> 48)
+ dAtA[offset+7] = uint8(v >> 56)
+ return offset + 8
+}
+func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ return offset + 4
+}
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return offset + 1
+}
+func (m *CrossVersionObjectReference) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Kind)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.APIVersion)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ExternalMetricSource) Size() (n int) {
+ var l int
+ _ = l
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Target.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ExternalMetricStatus) Size() (n int) {
+ var l int
+ _ = l
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Current.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *HorizontalPodAutoscaler) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Status.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *HorizontalPodAutoscalerCondition) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Type)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Status)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.LastTransitionTime.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Reason)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Message)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *HorizontalPodAutoscalerList) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *HorizontalPodAutoscalerSpec) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ScaleTargetRef.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.MinReplicas != nil {
+ n += 1 + sovGenerated(uint64(*m.MinReplicas))
+ }
+ n += 1 + sovGenerated(uint64(m.MaxReplicas))
+ if len(m.Metrics) > 0 {
+ for _, e := range m.Metrics {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *HorizontalPodAutoscalerStatus) Size() (n int) {
+ var l int
+ _ = l
+ if m.ObservedGeneration != nil {
+ n += 1 + sovGenerated(uint64(*m.ObservedGeneration))
+ }
+ if m.LastScaleTime != nil {
+ l = m.LastScaleTime.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ n += 1 + sovGenerated(uint64(m.CurrentReplicas))
+ n += 1 + sovGenerated(uint64(m.DesiredReplicas))
+ if len(m.CurrentMetrics) > 0 {
+ for _, e := range m.CurrentMetrics {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.Conditions) > 0 {
+ for _, e := range m.Conditions {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *MetricIdentifier) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *MetricSpec) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Type)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Object != nil {
+ l = m.Object.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.Pods != nil {
+ l = m.Pods.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.Resource != nil {
+ l = m.Resource.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.External != nil {
+ l = m.External.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *MetricStatus) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Type)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Object != nil {
+ l = m.Object.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.Pods != nil {
+ l = m.Pods.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.Resource != nil {
+ l = m.Resource.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.External != nil {
+ l = m.External.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *MetricTarget) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Type)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Value != nil {
+ l = m.Value.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageUtilization != nil {
+ n += 1 + sovGenerated(uint64(*m.AverageUtilization))
+ }
+ return n
+}
+
+func (m *MetricValueStatus) Size() (n int) {
+ var l int
+ _ = l
+ if m.Value != nil {
+ l = m.Value.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageValue != nil {
+ l = m.AverageValue.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.AverageUtilization != nil {
+ n += 1 + sovGenerated(uint64(*m.AverageUtilization))
+ }
+ return n
+}
+
+func (m *ObjectMetricSource) Size() (n int) {
+ var l int
+ _ = l
+ l = m.DescribedObject.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Target.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ObjectMetricStatus) Size() (n int) {
+ var l int
+ _ = l
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Current.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.DescribedObject.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *PodsMetricSource) Size() (n int) {
+ var l int
+ _ = l
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Target.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *PodsMetricStatus) Size() (n int) {
+ var l int
+ _ = l
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Current.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ResourceMetricSource) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Target.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ResourceMetricStatus) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Current.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ for {
+ n++
+ x >>= 7
+ if x == 0 {
+ break
+ }
+ }
+ return n
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *CrossVersionObjectReference) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&CrossVersionObjectReference{`,
+ `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `APIVersion:` + fmt.Sprintf("%v", this.APIVersion) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ExternalMetricSource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ExternalMetricSource{`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Target:` + strings.Replace(strings.Replace(this.Target.String(), "MetricTarget", "MetricTarget", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ExternalMetricStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ExternalMetricStatus{`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Current:` + strings.Replace(strings.Replace(this.Current.String(), "MetricValueStatus", "MetricValueStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HorizontalPodAutoscaler) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HorizontalPodAutoscaler{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "HorizontalPodAutoscalerSpec", "HorizontalPodAutoscalerSpec", 1), `&`, ``, 1) + `,`,
+ `Status:` + strings.Replace(strings.Replace(this.Status.String(), "HorizontalPodAutoscalerStatus", "HorizontalPodAutoscalerStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HorizontalPodAutoscalerCondition) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HorizontalPodAutoscalerCondition{`,
+ `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
+ `Status:` + fmt.Sprintf("%v", this.Status) + `,`,
+ `LastTransitionTime:` + strings.Replace(strings.Replace(this.LastTransitionTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
+ `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`,
+ `Message:` + fmt.Sprintf("%v", this.Message) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HorizontalPodAutoscalerList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HorizontalPodAutoscalerList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "HorizontalPodAutoscaler", "HorizontalPodAutoscaler", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HorizontalPodAutoscalerSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HorizontalPodAutoscalerSpec{`,
+ `ScaleTargetRef:` + strings.Replace(strings.Replace(this.ScaleTargetRef.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
+ `MinReplicas:` + valueToStringGenerated(this.MinReplicas) + `,`,
+ `MaxReplicas:` + fmt.Sprintf("%v", this.MaxReplicas) + `,`,
+ `Metrics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Metrics), "MetricSpec", "MetricSpec", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HorizontalPodAutoscalerStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HorizontalPodAutoscalerStatus{`,
+ `ObservedGeneration:` + valueToStringGenerated(this.ObservedGeneration) + `,`,
+ `LastScaleTime:` + strings.Replace(fmt.Sprintf("%v", this.LastScaleTime), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1) + `,`,
+ `CurrentReplicas:` + fmt.Sprintf("%v", this.CurrentReplicas) + `,`,
+ `DesiredReplicas:` + fmt.Sprintf("%v", this.DesiredReplicas) + `,`,
+ `CurrentMetrics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CurrentMetrics), "MetricStatus", "MetricStatus", 1), `&`, ``, 1) + `,`,
+ `Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "HorizontalPodAutoscalerCondition", "HorizontalPodAutoscalerCondition", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricIdentifier) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricIdentifier{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricSpec{`,
+ `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
+ `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricSource", "ObjectMetricSource", 1) + `,`,
+ `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricSource", "PodsMetricSource", 1) + `,`,
+ `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricSource", "ResourceMetricSource", 1) + `,`,
+ `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricSource", "ExternalMetricSource", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricStatus{`,
+ `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
+ `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricStatus", "ObjectMetricStatus", 1) + `,`,
+ `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricStatus", "PodsMetricStatus", 1) + `,`,
+ `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricStatus", "ResourceMetricStatus", 1) + `,`,
+ `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricStatus", "ExternalMetricStatus", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricTarget) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricTarget{`,
+ `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
+ `Value:` + strings.Replace(fmt.Sprintf("%v", this.Value), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
+ `AverageUtilization:` + valueToStringGenerated(this.AverageUtilization) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricValueStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricValueStatus{`,
+ `Value:` + strings.Replace(fmt.Sprintf("%v", this.Value), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
+ `AverageValue:` + strings.Replace(fmt.Sprintf("%v", this.AverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`,
+ `AverageUtilization:` + valueToStringGenerated(this.AverageUtilization) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ObjectMetricSource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ObjectMetricSource{`,
+ `DescribedObject:` + strings.Replace(strings.Replace(this.DescribedObject.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
+ `Target:` + strings.Replace(strings.Replace(this.Target.String(), "MetricTarget", "MetricTarget", 1), `&`, ``, 1) + `,`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ObjectMetricStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ObjectMetricStatus{`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Current:` + strings.Replace(strings.Replace(this.Current.String(), "MetricValueStatus", "MetricValueStatus", 1), `&`, ``, 1) + `,`,
+ `DescribedObject:` + strings.Replace(strings.Replace(this.DescribedObject.String(), "CrossVersionObjectReference", "CrossVersionObjectReference", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *PodsMetricSource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&PodsMetricSource{`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Target:` + strings.Replace(strings.Replace(this.Target.String(), "MetricTarget", "MetricTarget", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *PodsMetricStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&PodsMetricStatus{`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Current:` + strings.Replace(strings.Replace(this.Current.String(), "MetricValueStatus", "MetricValueStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ResourceMetricSource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ResourceMetricSource{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Target:` + strings.Replace(strings.Replace(this.Target.String(), "MetricTarget", "MetricTarget", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ResourceMetricStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ResourceMetricStatus{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Current:` + strings.Replace(strings.Replace(this.Current.String(), "MetricValueStatus", "MetricValueStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *CrossVersionObjectReference) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: CrossVersionObjectReference: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: CrossVersionObjectReference: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Kind = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field APIVersion", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.APIVersion = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ExternalMetricSource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ExternalMetricSource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ExternalMetricSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ExternalMetricStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ExternalMetricStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ExternalMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HorizontalPodAutoscaler: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HorizontalPodAutoscaler: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Type = HorizontalPodAutoscalerConditionType(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Reason = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Message = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HorizontalPodAutoscalerList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, HorizontalPodAutoscaler{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HorizontalPodAutoscalerSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ScaleTargetRef", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ScaleTargetRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MinReplicas", wireType)
+ }
+ var v int32
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.MinReplicas = &v
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MaxReplicas", wireType)
+ }
+ m.MaxReplicas = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.MaxReplicas |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Metrics = append(m.Metrics, MetricSpec{})
+ if err := m.Metrics[len(m.Metrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HorizontalPodAutoscalerStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HorizontalPodAutoscalerStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType)
+ }
+ var v int64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= (int64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.ObservedGeneration = &v
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LastScaleTime", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.LastScaleTime == nil {
+ m.LastScaleTime = &k8s_io_apimachinery_pkg_apis_meta_v1.Time{}
+ }
+ if err := m.LastScaleTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CurrentReplicas", wireType)
+ }
+ m.CurrentReplicas = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.CurrentReplicas |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 4:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DesiredReplicas", wireType)
+ }
+ m.DesiredReplicas = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.DesiredReplicas |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CurrentMetrics", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.CurrentMetrics = append(m.CurrentMetrics, MetricStatus{})
+ if err := m.CurrentMetrics[len(m.CurrentMetrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Conditions = append(m.Conditions, HorizontalPodAutoscalerCondition{})
+ if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricIdentifier) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricIdentifier: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricIdentifier: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Type = MetricSourceType(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Object == nil {
+ m.Object = &ObjectMetricSource{}
+ }
+ if err := m.Object.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pods", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Pods == nil {
+ m.Pods = &PodsMetricSource{}
+ }
+ if err := m.Pods.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Resource == nil {
+ m.Resource = &ResourceMetricSource{}
+ }
+ if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field External", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.External == nil {
+ m.External = &ExternalMetricSource{}
+ }
+ if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Type = MetricSourceType(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Object == nil {
+ m.Object = &ObjectMetricStatus{}
+ }
+ if err := m.Object.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pods", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Pods == nil {
+ m.Pods = &PodsMetricStatus{}
+ }
+ if err := m.Pods.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Resource == nil {
+ m.Resource = &ResourceMetricStatus{}
+ }
+ if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field External", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.External == nil {
+ m.External = &ExternalMetricStatus{}
+ }
+ if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricTarget) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricTarget: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricTarget: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Type = MetricTargetType(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Value == nil {
+ m.Value = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageUtilization", wireType)
+ }
+ var v int32
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.AverageUtilization = &v
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricValueStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricValueStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricValueStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Value == nil {
+ m.Value = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageValue", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.AverageValue == nil {
+ m.AverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{}
+ }
+ if err := m.AverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AverageUtilization", wireType)
+ }
+ var v int32
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= (int32(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.AverageUtilization = &v
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ObjectMetricSource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ObjectMetricSource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ObjectMetricSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DescribedObject", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.DescribedObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ObjectMetricStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ObjectMetricStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ObjectMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DescribedObject", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.DescribedObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *PodsMetricSource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: PodsMetricSource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: PodsMetricSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *PodsMetricStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: PodsMetricStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: PodsMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ResourceMetricSource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ResourceMetricSource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ResourceMetricSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ResourceMetricStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ResourceMetricStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ResourceMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ return iNdEx, nil
+ case 1:
+ iNdEx += 8
+ return iNdEx, nil
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ iNdEx += length
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ return iNdEx, nil
+ case 3:
+ for {
+ var innerWire uint64
+ var start int = iNdEx
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ innerWire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ innerWireType := int(innerWire & 0x7)
+ if innerWireType == 4 {
+ break
+ }
+ next, err := skipGenerated(dAtA[start:])
+ if err != nil {
+ return 0, err
+ }
+ iNdEx = start + next
+ }
+ return iNdEx, nil
+ case 4:
+ return iNdEx, nil
+ case 5:
+ iNdEx += 4
+ return iNdEx, nil
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ }
+ panic("unreachable")
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+)
+
+func init() {
+ proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto", fileDescriptorGenerated)
+}
+
+var fileDescriptorGenerated = []byte{
+ // 1425 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xdd, 0x6f, 0x1b, 0xc5,
+ 0x16, 0xcf, 0xda, 0x8e, 0x93, 0x8e, 0xd3, 0x24, 0x9d, 0x5b, 0xb5, 0x56, 0xaa, 0x6b, 0x47, 0xab,
+ 0xab, 0xab, 0x52, 0xd1, 0x35, 0x31, 0xe1, 0x43, 0x42, 0x48, 0xc4, 0x01, 0xda, 0x8a, 0xa4, 0x2d,
+ 0x93, 0xb4, 0x42, 0xa8, 0x45, 0x8c, 0x77, 0x4f, 0xdc, 0x21, 0xde, 0x5d, 0x6b, 0x76, 0x6c, 0x35,
+ 0x45, 0x42, 0xbc, 0xf0, 0x8e, 0x40, 0xfc, 0x13, 0x88, 0x17, 0x5e, 0x90, 0x78, 0xe4, 0x43, 0xa8,
+ 0x42, 0x08, 0xf5, 0xb1, 0x08, 0xc9, 0xa2, 0xe6, 0xbf, 0xe8, 0x13, 0xda, 0x99, 0xd9, 0xf5, 0xae,
+ 0xed, 0xc4, 0x4e, 0x95, 0x14, 0xf5, 0xcd, 0x33, 0xe7, 0x9c, 0xdf, 0xf9, 0x9c, 0x73, 0xce, 0x1a,
+ 0x5d, 0xda, 0x7d, 0x35, 0xb0, 0x98, 0x5f, 0xd9, 0x6d, 0xd7, 0x81, 0x7b, 0x20, 0x20, 0xa8, 0x74,
+ 0xc0, 0x73, 0x7c, 0x5e, 0xd1, 0x04, 0xda, 0x62, 0x15, 0xda, 0x16, 0x7e, 0x60, 0xd3, 0x26, 0xf3,
+ 0x1a, 0x95, 0x4e, 0xb5, 0x0e, 0x82, 0x56, 0x2b, 0x0d, 0xf0, 0x80, 0x53, 0x01, 0x8e, 0xd5, 0xe2,
+ 0xbe, 0xf0, 0x71, 0x49, 0xf1, 0x5b, 0xb4, 0xc5, 0xac, 0x04, 0xbf, 0xa5, 0xf9, 0x97, 0x2e, 0x36,
+ 0x98, 0xb8, 0xd3, 0xae, 0x5b, 0xb6, 0xef, 0x56, 0x1a, 0x7e, 0xc3, 0xaf, 0x48, 0xb1, 0x7a, 0x7b,
+ 0x47, 0x9e, 0xe4, 0x41, 0xfe, 0x52, 0x70, 0x4b, 0x66, 0x42, 0xbd, 0xed, 0x73, 0xa8, 0x74, 0x56,
+ 0x06, 0x55, 0x2e, 0xad, 0xf6, 0x79, 0x5c, 0x6a, 0xdf, 0x61, 0x1e, 0xf0, 0xbd, 0x4a, 0x6b, 0xb7,
+ 0x21, 0x85, 0x38, 0x04, 0x7e, 0x9b, 0xdb, 0x70, 0x28, 0xa9, 0xa0, 0xe2, 0x82, 0xa0, 0xa3, 0x74,
+ 0x55, 0xf6, 0x93, 0xe2, 0x6d, 0x4f, 0x30, 0x77, 0x58, 0xcd, 0xcb, 0xe3, 0x04, 0x02, 0xfb, 0x0e,
+ 0xb8, 0x74, 0x50, 0xce, 0xfc, 0xca, 0x40, 0xe7, 0xd6, 0xb9, 0x1f, 0x04, 0x37, 0x81, 0x07, 0xcc,
+ 0xf7, 0xae, 0xd5, 0x3f, 0x02, 0x5b, 0x10, 0xd8, 0x01, 0x0e, 0x9e, 0x0d, 0x78, 0x19, 0xe5, 0x76,
+ 0x99, 0xe7, 0x14, 0x8d, 0x65, 0xe3, 0xfc, 0x89, 0xda, 0xdc, 0xfd, 0x6e, 0x79, 0xaa, 0xd7, 0x2d,
+ 0xe7, 0xde, 0x61, 0x9e, 0x43, 0x24, 0x25, 0xe4, 0xf0, 0xa8, 0x0b, 0xc5, 0x4c, 0x9a, 0xe3, 0x2a,
+ 0x75, 0x81, 0x48, 0x0a, 0xae, 0x22, 0x44, 0x5b, 0x4c, 0x2b, 0x28, 0x66, 0x25, 0x1f, 0xd6, 0x7c,
+ 0x68, 0xed, 0xfa, 0x15, 0x4d, 0x21, 0x09, 0x2e, 0xf3, 0x17, 0x03, 0x9d, 0x7e, 0xeb, 0xae, 0x00,
+ 0xee, 0xd1, 0xe6, 0x26, 0x08, 0xce, 0xec, 0x2d, 0x19, 0x5f, 0xfc, 0x1e, 0xca, 0xbb, 0xf2, 0x2c,
+ 0x4d, 0x2a, 0x54, 0x5f, 0xb0, 0x0e, 0xae, 0x04, 0x4b, 0x49, 0x5f, 0x71, 0xc0, 0x13, 0x6c, 0x87,
+ 0x01, 0xaf, 0xcd, 0x6b, 0xd5, 0x79, 0x45, 0x21, 0x1a, 0x0f, 0x6f, 0xa3, 0xbc, 0xa0, 0xbc, 0x01,
+ 0x42, 0xba, 0x52, 0xa8, 0x3e, 0x3f, 0x19, 0xf2, 0xb6, 0x94, 0xe9, 0xa3, 0xaa, 0x33, 0xd1, 0x58,
+ 0xe6, 0xef, 0xc3, 0x8e, 0x08, 0x2a, 0xda, 0xc1, 0x31, 0x3a, 0x72, 0x0b, 0xcd, 0xd8, 0x6d, 0xce,
+ 0xc1, 0x8b, 0x3c, 0x59, 0x99, 0x0c, 0xfa, 0x26, 0x6d, 0xb6, 0x41, 0x59, 0x57, 0x5b, 0xd0, 0xd8,
+ 0x33, 0xeb, 0x0a, 0x89, 0x44, 0x90, 0xe6, 0x0f, 0x19, 0x74, 0xf6, 0xb2, 0xcf, 0xd9, 0x3d, 0xdf,
+ 0x13, 0xb4, 0x79, 0xdd, 0x77, 0xd6, 0x34, 0x20, 0x70, 0xfc, 0x21, 0x9a, 0x0d, 0x2b, 0xda, 0xa1,
+ 0x82, 0x8e, 0xf0, 0x2a, 0x2e, 0x4c, 0xab, 0xb5, 0xdb, 0x08, 0x2f, 0x02, 0x2b, 0xe4, 0xb6, 0x3a,
+ 0x2b, 0x96, 0x2a, 0xbb, 0x4d, 0x10, 0xb4, 0x5f, 0x19, 0xfd, 0x3b, 0x12, 0xa3, 0xe2, 0xdb, 0x28,
+ 0x17, 0xb4, 0xc0, 0xd6, 0x8e, 0xbd, 0x36, 0xce, 0xb1, 0x7d, 0x0c, 0xdd, 0x6a, 0x81, 0xdd, 0x2f,
+ 0xd5, 0xf0, 0x44, 0x24, 0x2c, 0x06, 0x94, 0x0f, 0x64, 0x00, 0x64, 0x99, 0x16, 0xaa, 0xaf, 0x3f,
+ 0xa9, 0x02, 0x15, 0xc5, 0x38, 0x43, 0xea, 0x4c, 0x34, 0xb8, 0xf9, 0x59, 0x16, 0x2d, 0xef, 0x23,
+ 0xb9, 0xee, 0x7b, 0x0e, 0x13, 0xcc, 0xf7, 0xf0, 0x65, 0x94, 0x13, 0x7b, 0x2d, 0xd0, 0x4f, 0x6f,
+ 0x35, 0xb2, 0x76, 0x7b, 0xaf, 0x05, 0x8f, 0xbb, 0xe5, 0xff, 0x8d, 0x93, 0x0f, 0xf9, 0x88, 0x44,
+ 0xc0, 0x1b, 0xb1, 0x57, 0x99, 0x14, 0x96, 0x36, 0xeb, 0x71, 0xb7, 0x3c, 0xa2, 0xff, 0x59, 0x31,
+ 0x52, 0xda, 0x78, 0xdc, 0x41, 0xb8, 0x49, 0x03, 0xb1, 0xcd, 0xa9, 0x17, 0x28, 0x4d, 0xcc, 0x05,
+ 0x1d, 0xaf, 0x0b, 0x93, 0xa5, 0x3b, 0x94, 0xa8, 0x2d, 0x69, 0x2b, 0xf0, 0xc6, 0x10, 0x1a, 0x19,
+ 0xa1, 0x01, 0xff, 0x1f, 0xe5, 0x39, 0xd0, 0xc0, 0xf7, 0x8a, 0x39, 0xe9, 0x45, 0x1c, 0x5c, 0x22,
+ 0x6f, 0x89, 0xa6, 0xe2, 0xe7, 0xd0, 0x8c, 0x0b, 0x41, 0x40, 0x1b, 0x50, 0x9c, 0x96, 0x8c, 0x71,
+ 0x2d, 0x6f, 0xaa, 0x6b, 0x12, 0xd1, 0xcd, 0x3f, 0x0c, 0x74, 0x6e, 0x9f, 0x38, 0x6e, 0xb0, 0x40,
+ 0xe0, 0x5b, 0x43, 0xf5, 0x6c, 0x4d, 0xe6, 0x60, 0x28, 0x2d, 0xab, 0x79, 0x51, 0xeb, 0x9e, 0x8d,
+ 0x6e, 0x12, 0xb5, 0x7c, 0x0b, 0x4d, 0x33, 0x01, 0x6e, 0x98, 0x95, 0xec, 0xf9, 0x42, 0xf5, 0x95,
+ 0x27, 0xac, 0xb5, 0xda, 0x49, 0xad, 0x63, 0xfa, 0x4a, 0x88, 0x46, 0x14, 0xa8, 0xf9, 0x67, 0x66,
+ 0x5f, 0xdf, 0xc2, 0x82, 0xc7, 0x1f, 0xa3, 0x79, 0x79, 0xd2, 0xfd, 0x0a, 0x76, 0xb4, 0x87, 0x63,
+ 0xdf, 0xd4, 0x01, 0xe3, 0xa2, 0x76, 0x46, 0x9b, 0x32, 0xbf, 0x95, 0x82, 0x26, 0x03, 0xaa, 0xf0,
+ 0x0a, 0x2a, 0xb8, 0xcc, 0x23, 0xd0, 0x6a, 0x32, 0x9b, 0xaa, 0xb2, 0x9c, 0xae, 0x2d, 0xf4, 0xba,
+ 0xe5, 0xc2, 0x66, 0xff, 0x9a, 0x24, 0x79, 0xf0, 0x4b, 0xa8, 0xe0, 0xd2, 0xbb, 0xb1, 0x48, 0x56,
+ 0x8a, 0xfc, 0x47, 0xeb, 0x2b, 0x6c, 0xf6, 0x49, 0x24, 0xc9, 0x87, 0x6f, 0x84, 0xd5, 0x10, 0x76,
+ 0xb7, 0xa0, 0x98, 0x93, 0x61, 0xbe, 0x30, 0x59, 0x33, 0x94, 0x2d, 0x22, 0x51, 0x39, 0x12, 0x82,
+ 0x44, 0x58, 0xe6, 0x77, 0x39, 0xf4, 0xdf, 0x03, 0xdf, 0x3e, 0x7e, 0x1b, 0x61, 0xbf, 0x1e, 0x00,
+ 0xef, 0x80, 0x73, 0x49, 0x0d, 0xdd, 0x70, 0xfa, 0x85, 0x31, 0xce, 0xd6, 0xce, 0x84, 0x65, 0x7f,
+ 0x6d, 0x88, 0x4a, 0x46, 0x48, 0x60, 0x1b, 0x9d, 0x0c, 0x1f, 0x83, 0x0a, 0x28, 0xd3, 0x83, 0xf6,
+ 0x70, 0x2f, 0xed, 0x54, 0xaf, 0x5b, 0x3e, 0xb9, 0x91, 0x04, 0x21, 0x69, 0x4c, 0xbc, 0x86, 0x16,
+ 0x74, 0x7f, 0x1f, 0x08, 0xf0, 0x59, 0x1d, 0x81, 0x85, 0xf5, 0x34, 0x99, 0x0c, 0xf2, 0x87, 0x10,
+ 0x0e, 0x04, 0x8c, 0x83, 0x13, 0x43, 0xe4, 0xd2, 0x10, 0x6f, 0xa6, 0xc9, 0x64, 0x90, 0x1f, 0x37,
+ 0xd1, 0xbc, 0x46, 0xd5, 0xf1, 0x2e, 0x4e, 0xcb, 0x94, 0x4d, 0x38, 0x89, 0x75, 0xd3, 0x8d, 0x6b,
+ 0x70, 0x3d, 0x85, 0x45, 0x06, 0xb0, 0xb1, 0x40, 0xc8, 0x8e, 0x5a, 0x5c, 0x50, 0xcc, 0x4b, 0x4d,
+ 0x6f, 0x3c, 0xe1, 0x1b, 0x8c, 0x7b, 0x65, 0x7f, 0x7c, 0xc5, 0x57, 0x01, 0x49, 0xe8, 0x31, 0xbf,
+ 0x34, 0xd0, 0xe2, 0xe0, 0x24, 0x8f, 0x77, 0x28, 0x63, 0xdf, 0x1d, 0xea, 0x36, 0x9a, 0x0d, 0xa0,
+ 0x09, 0xb6, 0xf0, 0xb9, 0x2e, 0x80, 0x17, 0x27, 0xec, 0x44, 0xb4, 0x0e, 0xcd, 0x2d, 0x2d, 0x5a,
+ 0x9b, 0x0b, 0x5b, 0x51, 0x74, 0x22, 0x31, 0xa4, 0xf9, 0x75, 0x16, 0xa1, 0x7e, 0xdd, 0xe3, 0xd5,
+ 0xd4, 0xe8, 0x59, 0x1e, 0x18, 0x3d, 0x8b, 0xc9, 0x85, 0x2c, 0x31, 0x66, 0x6e, 0xa2, 0xbc, 0x2f,
+ 0xfb, 0x81, 0xb6, 0xb0, 0x3a, 0x2e, 0x98, 0xf1, 0x84, 0x8f, 0xd1, 0x6a, 0x28, 0x6c, 0xe8, 0xba,
+ 0xab, 0x68, 0x34, 0x7c, 0x15, 0xe5, 0x5a, 0xbe, 0x13, 0x8d, 0xe4, 0xb1, 0x7b, 0xd2, 0x75, 0xdf,
+ 0x09, 0x52, 0x98, 0xb3, 0xa1, 0xed, 0xe1, 0x2d, 0x91, 0x38, 0xf8, 0x03, 0x34, 0x1b, 0xad, 0xeb,
+ 0xb2, 0x44, 0x0b, 0xd5, 0xd5, 0x71, 0x98, 0x44, 0xf3, 0xa7, 0x70, 0x65, 0x30, 0x23, 0x0a, 0x89,
+ 0x31, 0x43, 0x7c, 0xd0, 0x1b, 0x9f, 0x9c, 0x40, 0x13, 0xe0, 0x8f, 0x5a, 0x75, 0x15, 0x7e, 0x44,
+ 0x21, 0x31, 0xa6, 0xf9, 0x4d, 0x16, 0xcd, 0xa5, 0x56, 0xc9, 0x7f, 0x23, 0x5d, 0xea, 0xad, 0x1d,
+ 0x6d, 0xba, 0x14, 0xe6, 0xd1, 0xa7, 0x4b, 0xe1, 0x1e, 0x5f, 0xba, 0x12, 0xf8, 0x23, 0xd2, 0xf5,
+ 0x53, 0x26, 0x4a, 0x97, 0x9a, 0x7f, 0x93, 0xa5, 0x4b, 0xf1, 0x26, 0xd2, 0x75, 0x0d, 0x4d, 0x77,
+ 0xc2, 0x05, 0x5d, 0x67, 0xeb, 0xc0, 0x45, 0xc4, 0x8a, 0x9c, 0xb3, 0xde, 0x6d, 0x53, 0x4f, 0x30,
+ 0xb1, 0x57, 0x3b, 0x11, 0x2e, 0x08, 0x72, 0xc3, 0x27, 0x0a, 0x07, 0x3b, 0x68, 0x8e, 0x76, 0x80,
+ 0xd3, 0x06, 0xc8, 0x6b, 0x9d, 0xaf, 0xc3, 0xe2, 0x2e, 0xf6, 0xba, 0xe5, 0xb9, 0xb5, 0x04, 0x0e,
+ 0x49, 0xa1, 0x86, 0x63, 0x50, 0x9f, 0x6f, 0x08, 0xd6, 0x64, 0xf7, 0xd4, 0x18, 0x54, 0x93, 0x41,
+ 0x8e, 0xc1, 0xb5, 0x21, 0x2a, 0x19, 0x21, 0x61, 0x7e, 0x91, 0x41, 0xa7, 0x86, 0x3e, 0x53, 0xfa,
+ 0x41, 0x31, 0x8e, 0x29, 0x28, 0x99, 0xa7, 0x18, 0x94, 0xec, 0xa1, 0x83, 0xf2, 0x73, 0x06, 0xe1,
+ 0xe1, 0x26, 0x8a, 0x3f, 0x91, 0xa3, 0xd8, 0xe6, 0xac, 0x0e, 0x8e, 0x22, 0x1f, 0xc5, 0x6e, 0x97,
+ 0x9c, 0xe3, 0x49, 0x6c, 0x32, 0xa8, 0xec, 0x78, 0xbe, 0xa4, 0x13, 0x1f, 0xcc, 0xd9, 0xa3, 0xfd,
+ 0x60, 0x36, 0x7f, 0x1b, 0x0c, 0xe3, 0x33, 0xfd, 0x85, 0x3e, 0x2a, 0xfd, 0xd9, 0xa7, 0x98, 0x7e,
+ 0xf3, 0x47, 0x03, 0x2d, 0x0e, 0x0e, 0xe1, 0x67, 0xee, 0x7f, 0x9b, 0x5f, 0xd3, 0x4e, 0x3c, 0xdb,
+ 0xff, 0xd9, 0x7c, 0x6b, 0xa0, 0xd3, 0xa3, 0x56, 0x18, 0xbc, 0x9e, 0x5a, 0x3c, 0x2b, 0xc9, 0xc5,
+ 0xf3, 0x71, 0xb7, 0x5c, 0x1e, 0xf1, 0xaf, 0x40, 0x04, 0x93, 0xd8, 0x4d, 0x8f, 0x27, 0x01, 0xdf,
+ 0x0f, 0xdb, 0xac, 0x92, 0x70, 0x24, 0x36, 0x1f, 0x6b, 0xbc, 0x6b, 0x17, 0xef, 0x3f, 0x2a, 0x4d,
+ 0x3d, 0x78, 0x54, 0x9a, 0x7a, 0xf8, 0xa8, 0x34, 0xf5, 0x69, 0xaf, 0x64, 0xdc, 0xef, 0x95, 0x8c,
+ 0x07, 0xbd, 0x92, 0xf1, 0xb0, 0x57, 0x32, 0xfe, 0xea, 0x95, 0x8c, 0xcf, 0xff, 0x2e, 0x4d, 0xbd,
+ 0x3f, 0xa3, 0xa1, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xa0, 0xce, 0xf5, 0x16, 0x17, 0x00,
+ 0x00,
+}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/generated.proto b/staging/src/k8s.io/api/autoscaling/v2beta2/generated.proto
new file mode 100644
index 00000000000..38f099ae74b
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/generated.proto
@@ -0,0 +1,363 @@
+/*
+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.autoscaling.v2beta2;
+
+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 = "v2beta2";
+
+// CrossVersionObjectReference contains enough information to let you identify the referred resource.
+message CrossVersionObjectReference {
+ // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ optional string kind = 1;
+
+ // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ optional string name = 2;
+
+ // API version of the referent
+ // +optional
+ optional string apiVersion = 3;
+}
+
+// ExternalMetricSource indicates how to scale on a metric not associated with
+// any Kubernetes object (for example length of queue in cloud
+// messaging service, or QPS from loadbalancer running outside of cluster).
+message ExternalMetricSource {
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 1;
+
+ // target specifies the target value for the given metric
+ optional MetricTarget target = 2;
+}
+
+// ExternalMetricStatus indicates the current value of a global metric
+// not associated with any Kubernetes object.
+message ExternalMetricStatus {
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 1;
+
+ // current contains the current value for the given metric
+ optional MetricValueStatus current = 2;
+}
+
+// HorizontalPodAutoscaler is the configuration for a horizontal pod
+// autoscaler, which automatically manages the replica count of any resource
+// implementing the scale subresource based on the metrics specified.
+message HorizontalPodAutoscaler {
+ // metadata is the standard object metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // spec is the specification for the behaviour of the autoscaler.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
+ // +optional
+ optional HorizontalPodAutoscalerSpec spec = 2;
+
+ // status is the current information about the autoscaler.
+ // +optional
+ optional HorizontalPodAutoscalerStatus status = 3;
+}
+
+// HorizontalPodAutoscalerCondition describes the state of
+// a HorizontalPodAutoscaler at a certain point.
+message HorizontalPodAutoscalerCondition {
+ // type describes the current condition
+ optional string type = 1;
+
+ // status is the status of the condition (True, False, Unknown)
+ optional string status = 2;
+
+ // lastTransitionTime is the last time the condition transitioned from
+ // one status to another
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+
+ // reason is the reason for the condition's last transition.
+ // +optional
+ optional string reason = 4;
+
+ // message is a human-readable explanation containing details about
+ // the transition
+ // +optional
+ optional string message = 5;
+}
+
+// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
+message HorizontalPodAutoscalerList {
+ // metadata is the standard list metadata.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is the list of horizontal pod autoscaler objects.
+ repeated HorizontalPodAutoscaler items = 2;
+}
+
+// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
+message HorizontalPodAutoscalerSpec {
+ // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
+ // should be collected, as well as to actually change the replica count.
+ optional CrossVersionObjectReference scaleTargetRef = 1;
+
+ // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
+ // It defaults to 1 pod.
+ // +optional
+ optional int32 minReplicas = 2;
+
+ // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
+ // It cannot be less that minReplicas.
+ optional int32 maxReplicas = 3;
+
+ // metrics contains the specifications for which to use to calculate the
+ // desired replica count (the maximum replica count across all metrics will
+ // be used). The desired replica count is calculated multiplying the
+ // ratio between the target value and the current value by the current
+ // number of pods. Ergo, metrics used must decrease as the pod count is
+ // increased, and vice-versa. See the individual metric source types for
+ // more information about how each type of metric must respond.
+ // If not set, the default metric will be set to 80% average CPU utilization.
+ // +optional
+ repeated MetricSpec metrics = 4;
+}
+
+// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
+message HorizontalPodAutoscalerStatus {
+ // observedGeneration is the most recent generation observed by this autoscaler.
+ // +optional
+ optional int64 observedGeneration = 1;
+
+ // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
+ // used by the autoscaler to control how often the number of pods is changed.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
+
+ // currentReplicas is current number of replicas of pods managed by this autoscaler,
+ // as last seen by the autoscaler.
+ optional int32 currentReplicas = 3;
+
+ // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
+ // as last calculated by the autoscaler.
+ optional int32 desiredReplicas = 4;
+
+ // currentMetrics is the last read state of the metrics used by this autoscaler.
+ // +optional
+ repeated MetricStatus currentMetrics = 5;
+
+ // conditions is the set of conditions required for this autoscaler to scale its target,
+ // and indicates whether or not those conditions are met.
+ repeated HorizontalPodAutoscalerCondition conditions = 6;
+}
+
+// MetricIdentifier defines the name and optionally selector for a metric
+message MetricIdentifier {
+ // name is the name of the given metric
+ optional string name = 1;
+
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+}
+
+// MetricSpec specifies how to scale based on a single metric
+// (only `type` and one other matching field should be set at once).
+message MetricSpec {
+ // type is the type of metric source. It should be one of "Object",
+ // "Pods" or "Resource", each mapping to a matching field in the object.
+ optional string type = 1;
+
+ // object refers to a metric describing a single kubernetes object
+ // (for example, hits-per-second on an Ingress object).
+ // +optional
+ optional ObjectMetricSource object = 2;
+
+ // pods refers to a metric describing each pod in the current scale target
+ // (for example, transactions-processed-per-second). The values will be
+ // averaged together before being compared to the target value.
+ // +optional
+ optional PodsMetricSource pods = 3;
+
+ // resource refers to a resource metric (such as those specified in
+ // requests and limits) known to Kubernetes describing each pod in the
+ // current scale target (e.g. CPU or memory). Such metrics are built in to
+ // Kubernetes, and have special scaling options on top of those available
+ // to normal per-pod metrics using the "pods" source.
+ // +optional
+ optional ResourceMetricSource resource = 4;
+
+ // external refers to a global metric that is not associated
+ // with any Kubernetes object. It allows autoscaling based on information
+ // coming from components running outside of cluster
+ // (for example length of queue in cloud messaging service, or
+ // QPS from loadbalancer running outside of cluster).
+ // +optional
+ optional ExternalMetricSource external = 5;
+}
+
+// MetricStatus describes the last-read state of a single metric.
+message MetricStatus {
+ // type is the type of metric source. It will be one of "Object",
+ // "Pods" or "Resource", each corresponds to a matching field in the object.
+ optional string type = 1;
+
+ // object refers to a metric describing a single kubernetes object
+ // (for example, hits-per-second on an Ingress object).
+ // +optional
+ optional ObjectMetricStatus object = 2;
+
+ // pods refers to a metric describing each pod in the current scale target
+ // (for example, transactions-processed-per-second). The values will be
+ // averaged together before being compared to the target value.
+ // +optional
+ optional PodsMetricStatus pods = 3;
+
+ // resource refers to a resource metric (such as those specified in
+ // requests and limits) known to Kubernetes describing each pod in the
+ // current scale target (e.g. CPU or memory). Such metrics are built in to
+ // Kubernetes, and have special scaling options on top of those available
+ // to normal per-pod metrics using the "pods" source.
+ // +optional
+ optional ResourceMetricStatus resource = 4;
+
+ // external refers to a global metric that is not associated
+ // with any Kubernetes object. It allows autoscaling based on information
+ // coming from components running outside of cluster
+ // (for example length of queue in cloud messaging service, or
+ // QPS from loadbalancer running outside of cluster).
+ // +optional
+ optional ExternalMetricStatus external = 5;
+}
+
+// MetricTarget defines the target value, average value, or average utilization of a specific metric
+message MetricTarget {
+ // type represents whether the metric type is Utilization, Value, or AverageValue
+ optional string type = 1;
+
+ // value is the target value of the metric (as a quantity).
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
+
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
+
+ // averageUtilization is the target value of the average of the
+ // resource metric across all relevant pods, represented as a percentage of
+ // the requested value of the resource for the pods.
+ // Currently only valid for Resource metric source type
+ optional int32 averageUtilization = 4;
+}
+
+// MetricValueStatus holds the current value for a metric
+message MetricValueStatus {
+ // value is the current value of the metric (as a quantity).
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
+
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
+
+ // currentAverageUtilization is the current value of the average of the
+ // resource metric across all relevant pods, represented as a percentage of
+ // the requested value of the resource for the pods.
+ optional int32 averageUtilization = 3;
+}
+
+// ObjectMetricSource indicates how to scale on a metric describing a
+// kubernetes object (for example, hits-per-second on an Ingress object).
+message ObjectMetricSource {
+ optional CrossVersionObjectReference describedObject = 1;
+
+ // target specifies the target value for the given metric
+ optional MetricTarget target = 2;
+
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 3;
+}
+
+// ObjectMetricStatus indicates the current value of a metric describing a
+// kubernetes object (for example, hits-per-second on an Ingress object).
+message ObjectMetricStatus {
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 1;
+
+ // current contains the current value for the given metric
+ optional MetricValueStatus current = 2;
+
+ optional CrossVersionObjectReference describedObject = 3;
+}
+
+// PodsMetricSource indicates how to scale on a metric describing each pod in
+// the current scale target (for example, transactions-processed-per-second).
+// The values will be averaged together before being compared to the target
+// value.
+message PodsMetricSource {
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 1;
+
+ // target specifies the target value for the given metric
+ optional MetricTarget target = 2;
+}
+
+// PodsMetricStatus indicates the current value of a metric describing each pod in
+// the current scale target (for example, transactions-processed-per-second).
+message PodsMetricStatus {
+ // metric identifies the target metric by name and selector
+ optional MetricIdentifier metric = 1;
+
+ // current contains the current value for the given metric
+ optional MetricValueStatus current = 2;
+}
+
+// ResourceMetricSource indicates how to scale on a resource metric known to
+// Kubernetes, as specified in requests and limits, describing each pod in the
+// current scale target (e.g. CPU or memory). The values will be averaged
+// together before being compared to the target. Such metrics are built in to
+// Kubernetes, and have special scaling options on top of those available to
+// normal per-pod metrics using the "pods" source. Only one "target" type
+// should be set.
+message ResourceMetricSource {
+ // name is the name of the resource in question.
+ optional string name = 1;
+
+ // target specifies the target value for the given metric
+ optional MetricTarget target = 2;
+}
+
+// ResourceMetricStatus indicates the current value of a resource metric known to
+// Kubernetes, as specified in requests and limits, describing each pod in the
+// current scale target (e.g. CPU or memory). Such metrics are built in to
+// Kubernetes, and have special scaling options on top of those available to
+// normal per-pod metrics using the "pods" source.
+message ResourceMetricStatus {
+ // Name is the name of the resource in question.
+ optional string name = 1;
+
+ // current contains the current value for the given metric
+ optional MetricValueStatus current = 2;
+}
+
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/register.go b/staging/src/k8s.io/api/autoscaling/v2beta2/register.go
new file mode 100644
index 00000000000..eb1265c168c
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2018 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 v2beta2
+
+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 = "autoscaling"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta2"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ localSchemeBuilder = &SchemeBuilder
+ AddToScheme = localSchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to the given scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &HorizontalPodAutoscaler{},
+ &HorizontalPodAutoscalerList{},
+ )
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/types.go b/staging/src/k8s.io/api/autoscaling/v2beta2/types.go
new file mode 100644
index 00000000000..e873971f3fb
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/types.go
@@ -0,0 +1,388 @@
+/*
+Copyright 2018 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:openapi-gen=true
+
+package v2beta2
+
+import (
+ "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// HorizontalPodAutoscaler is the configuration for a horizontal pod
+// autoscaler, which automatically manages the replica count of any resource
+// implementing the scale subresource based on the metrics specified.
+type HorizontalPodAutoscaler struct {
+ metav1.TypeMeta `json:",inline"`
+ // metadata is the standard object metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // spec is the specification for the behaviour of the autoscaler.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
+ // +optional
+ Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+
+ // status is the current information about the autoscaler.
+ // +optional
+ Status HorizontalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
+}
+
+// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
+type HorizontalPodAutoscalerSpec struct {
+ // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
+ // should be collected, as well as to actually change the replica count.
+ ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef" protobuf:"bytes,1,opt,name=scaleTargetRef"`
+ // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
+ // It defaults to 1 pod.
+ // +optional
+ MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
+ // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
+ // It cannot be less that minReplicas.
+ MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
+ // metrics contains the specifications for which to use to calculate the
+ // desired replica count (the maximum replica count across all metrics will
+ // be used). The desired replica count is calculated multiplying the
+ // ratio between the target value and the current value by the current
+ // number of pods. Ergo, metrics used must decrease as the pod count is
+ // increased, and vice-versa. See the individual metric source types for
+ // more information about how each type of metric must respond.
+ // If not set, the default metric will be set to 80% average CPU utilization.
+ // +optional
+ Metrics []MetricSpec `json:"metrics,omitempty" protobuf:"bytes,4,rep,name=metrics"`
+}
+
+// CrossVersionObjectReference contains enough information to let you identify the referred resource.
+type CrossVersionObjectReference struct {
+ // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
+ Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
+ // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
+ // API version of the referent
+ // +optional
+ APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"`
+}
+
+// MetricSpec specifies how to scale based on a single metric
+// (only `type` and one other matching field should be set at once).
+type MetricSpec struct {
+ // type is the type of metric source. It should be one of "Object",
+ // "Pods" or "Resource", each mapping to a matching field in the object.
+ Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"`
+
+ // object refers to a metric describing a single kubernetes object
+ // (for example, hits-per-second on an Ingress object).
+ // +optional
+ Object *ObjectMetricSource `json:"object,omitempty" protobuf:"bytes,2,opt,name=object"`
+ // pods refers to a metric describing each pod in the current scale target
+ // (for example, transactions-processed-per-second). The values will be
+ // averaged together before being compared to the target value.
+ // +optional
+ Pods *PodsMetricSource `json:"pods,omitempty" protobuf:"bytes,3,opt,name=pods"`
+ // resource refers to a resource metric (such as those specified in
+ // requests and limits) known to Kubernetes describing each pod in the
+ // current scale target (e.g. CPU or memory). Such metrics are built in to
+ // Kubernetes, and have special scaling options on top of those available
+ // to normal per-pod metrics using the "pods" source.
+ // +optional
+ Resource *ResourceMetricSource `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"`
+ // external refers to a global metric that is not associated
+ // with any Kubernetes object. It allows autoscaling based on information
+ // coming from components running outside of cluster
+ // (for example length of queue in cloud messaging service, or
+ // QPS from loadbalancer running outside of cluster).
+ // +optional
+ External *ExternalMetricSource `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"`
+}
+
+// MetricSourceType indicates the type of metric.
+type MetricSourceType string
+
+var (
+ // ObjectMetricSourceType is a metric describing a kubernetes object
+ // (for example, hits-per-second on an Ingress object).
+ ObjectMetricSourceType MetricSourceType = "Object"
+ // PodsMetricSourceType is a metric describing each pod in the current scale
+ // target (for example, transactions-processed-per-second). The values
+ // will be averaged together before being compared to the target value.
+ PodsMetricSourceType MetricSourceType = "Pods"
+ // ResourceMetricSourceType is a resource metric known to Kubernetes, as
+ // specified in requests and limits, describing each pod in the current
+ // scale target (e.g. CPU or memory). Such metrics are built in to
+ // Kubernetes, and have special scaling options on top of those available
+ // to normal per-pod metrics (the "pods" source).
+ ResourceMetricSourceType MetricSourceType = "Resource"
+ // ExternalMetricSourceType is a global metric that is not associated
+ // with any Kubernetes object. It allows autoscaling based on information
+ // coming from components running outside of cluster
+ // (for example length of queue in cloud messaging service, or
+ // QPS from loadbalancer running outside of cluster).
+ ExternalMetricSourceType MetricSourceType = "External"
+)
+
+// ObjectMetricSource indicates how to scale on a metric describing a
+// kubernetes object (for example, hits-per-second on an Ingress object).
+type ObjectMetricSource struct {
+ DescribedObject CrossVersionObjectReference `json:"describedObject" protobuf:"bytes,1,name=describedObject"`
+ // target specifies the target value for the given metric
+ Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"`
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,3,name=metric"`
+}
+
+// PodsMetricSource indicates how to scale on a metric describing each pod in
+// the current scale target (for example, transactions-processed-per-second).
+// The values will be averaged together before being compared to the target
+// value.
+type PodsMetricSource struct {
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"`
+ // target specifies the target value for the given metric
+ Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"`
+}
+
+// ResourceMetricSource indicates how to scale on a resource metric known to
+// Kubernetes, as specified in requests and limits, describing each pod in the
+// current scale target (e.g. CPU or memory). The values will be averaged
+// together before being compared to the target. Such metrics are built in to
+// Kubernetes, and have special scaling options on top of those available to
+// normal per-pod metrics using the "pods" source. Only one "target" type
+// should be set.
+type ResourceMetricSource struct {
+ // name is the name of the resource in question.
+ Name v1.ResourceName `json:"name" protobuf:"bytes,1,name=name"`
+ // target specifies the target value for the given metric
+ Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"`
+}
+
+// ExternalMetricSource indicates how to scale on a metric not associated with
+// any Kubernetes object (for example length of queue in cloud
+// messaging service, or QPS from loadbalancer running outside of cluster).
+type ExternalMetricSource struct {
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"`
+ // target specifies the target value for the given metric
+ Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"`
+}
+
+// MetricIdentifier defines the name and optionally selector for a metric
+type MetricIdentifier struct {
+ // name is the name of the given metric
+ Name string `json:"name" protobuf:"bytes,1,name=name"`
+ // selector is the string-encoded form of a standard kubernetes label selector for the given metric
+ // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
+ // When unset, just the metricName will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,name=selector"`
+}
+
+// MetricTarget defines the target value, average value, or average utilization of a specific metric
+type MetricTarget struct {
+ // type represents whether the metric type is Utilization, Value, or AverageValue
+ Type MetricTargetType `json:"type" protobuf:"bytes,1,name=type"`
+ // value is the target value of the metric (as a quantity).
+ Value *resource.Quantity `json:"value,omitempty" protobuf:"bytes,2,name=value"`
+ // averageValue is the target value of the average of the
+ // metric across all relevant pods (as a quantity)
+ AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,3,name=averageValue"`
+
+ // averageUtilization is the target value of the average of the
+ // resource metric across all relevant pods, represented as a percentage of
+ // the requested value of the resource for the pods.
+ // Currently only valid for Resource metric source type
+ AverageUtilization *int32 `json:"averageUtilization,omitempty" protobuf:"bytes,4,name=averageUtilization"`
+}
+
+// MetricTargetType specifies the type of metric being targeted, and should be either
+// "Value", "AverageValue", or "Utilization"
+type MetricTargetType string
+
+var (
+ // UtilizationMetricType declares a MetricTarget is an AverageUtilization value
+ UtilizationMetricType MetricTargetType = "Utilization"
+ // ValueMetricType declares a MetricTarget is a raw value
+ ValueMetricType MetricTargetType = "Value"
+ // AverageValueMetricType declares a MetricTarget is an
+ AverageValueMetricType MetricTargetType = "AverageValue"
+)
+
+// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
+type HorizontalPodAutoscalerStatus struct {
+ // observedGeneration is the most recent generation observed by this autoscaler.
+ // +optional
+ ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
+
+ // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
+ // used by the autoscaler to control how often the number of pods is changed.
+ // +optional
+ LastScaleTime *metav1.Time `json:"lastScaleTime,omitempty" protobuf:"bytes,2,opt,name=lastScaleTime"`
+
+ // currentReplicas is current number of replicas of pods managed by this autoscaler,
+ // as last seen by the autoscaler.
+ CurrentReplicas int32 `json:"currentReplicas" protobuf:"varint,3,opt,name=currentReplicas"`
+
+ // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
+ // as last calculated by the autoscaler.
+ DesiredReplicas int32 `json:"desiredReplicas" protobuf:"varint,4,opt,name=desiredReplicas"`
+
+ // currentMetrics is the last read state of the metrics used by this autoscaler.
+ // +optional
+ CurrentMetrics []MetricStatus `json:"currentMetrics" protobuf:"bytes,5,rep,name=currentMetrics"`
+
+ // conditions is the set of conditions required for this autoscaler to scale its target,
+ // and indicates whether or not those conditions are met.
+ Conditions []HorizontalPodAutoscalerCondition `json:"conditions" protobuf:"bytes,6,rep,name=conditions"`
+}
+
+// HorizontalPodAutoscalerConditionType are the valid conditions of
+// a HorizontalPodAutoscaler.
+type HorizontalPodAutoscalerConditionType string
+
+var (
+ // ScalingActive indicates that the HPA controller is able to scale if necessary:
+ // it's correctly configured, can fetch the desired metrics, and isn't disabled.
+ ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive"
+ // AbleToScale indicates a lack of transient issues which prevent scaling from occurring,
+ // such as being in a backoff window, or being unable to access/update the target scale.
+ AbleToScale HorizontalPodAutoscalerConditionType = "AbleToScale"
+ // ScalingLimited indicates that the calculated scale based on metrics would be above or
+ // below the range for the HPA, and has thus been capped.
+ ScalingLimited HorizontalPodAutoscalerConditionType = "ScalingLimited"
+)
+
+// HorizontalPodAutoscalerCondition describes the state of
+// a HorizontalPodAutoscaler at a certain point.
+type HorizontalPodAutoscalerCondition struct {
+ // type describes the current condition
+ Type HorizontalPodAutoscalerConditionType `json:"type" protobuf:"bytes,1,name=type"`
+ // status is the status of the condition (True, False, Unknown)
+ Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,name=status"`
+ // lastTransitionTime is the last time the condition transitioned from
+ // one status to another
+ // +optional
+ LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
+ // reason is the reason for the condition's last transition.
+ // +optional
+ Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
+ // message is a human-readable explanation containing details about
+ // the transition
+ // +optional
+ Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
+}
+
+// MetricStatus describes the last-read state of a single metric.
+type MetricStatus struct {
+ // type is the type of metric source. It will be one of "Object",
+ // "Pods" or "Resource", each corresponds to a matching field in the object.
+ Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"`
+
+ // object refers to a metric describing a single kubernetes object
+ // (for example, hits-per-second on an Ingress object).
+ // +optional
+ Object *ObjectMetricStatus `json:"object,omitempty" protobuf:"bytes,2,opt,name=object"`
+ // pods refers to a metric describing each pod in the current scale target
+ // (for example, transactions-processed-per-second). The values will be
+ // averaged together before being compared to the target value.
+ // +optional
+ Pods *PodsMetricStatus `json:"pods,omitempty" protobuf:"bytes,3,opt,name=pods"`
+ // resource refers to a resource metric (such as those specified in
+ // requests and limits) known to Kubernetes describing each pod in the
+ // current scale target (e.g. CPU or memory). Such metrics are built in to
+ // Kubernetes, and have special scaling options on top of those available
+ // to normal per-pod metrics using the "pods" source.
+ // +optional
+ Resource *ResourceMetricStatus `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"`
+ // external refers to a global metric that is not associated
+ // with any Kubernetes object. It allows autoscaling based on information
+ // coming from components running outside of cluster
+ // (for example length of queue in cloud messaging service, or
+ // QPS from loadbalancer running outside of cluster).
+ // +optional
+ External *ExternalMetricStatus `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"`
+}
+
+// ObjectMetricStatus indicates the current value of a metric describing a
+// kubernetes object (for example, hits-per-second on an Ingress object).
+type ObjectMetricStatus struct {
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"`
+ // current contains the current value for the given metric
+ Current MetricValueStatus `json:"current" protobuf:"bytes,2,name=current"`
+
+ DescribedObject CrossVersionObjectReference `json:"describedObject" protobuf:"bytes,3,name=describedObject"`
+}
+
+// PodsMetricStatus indicates the current value of a metric describing each pod in
+// the current scale target (for example, transactions-processed-per-second).
+type PodsMetricStatus struct {
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"`
+ // current contains the current value for the given metric
+ Current MetricValueStatus `json:"current" protobuf:"bytes,2,name=current"`
+}
+
+// ResourceMetricStatus indicates the current value of a resource metric known to
+// Kubernetes, as specified in requests and limits, describing each pod in the
+// current scale target (e.g. CPU or memory). Such metrics are built in to
+// Kubernetes, and have special scaling options on top of those available to
+// normal per-pod metrics using the "pods" source.
+type ResourceMetricStatus struct {
+ // Name is the name of the resource in question.
+ Name v1.ResourceName `json:"name" protobuf:"bytes,1,name=name"`
+ // current contains the current value for the given metric
+ Current MetricValueStatus `json:"current" protobuf:"bytes,2,name=current"`
+}
+
+// ExternalMetricStatus indicates the current value of a global metric
+// not associated with any Kubernetes object.
+type ExternalMetricStatus struct {
+ // metric identifies the target metric by name and selector
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"`
+ // current contains the current value for the given metric
+ Current MetricValueStatus `json:"current" protobuf:"bytes,2,name=current"`
+}
+
+// MetricValueStatus holds the current value for a metric
+type MetricValueStatus struct {
+ // value is the current value of the metric (as a quantity).
+ Value *resource.Quantity `json:"value" protobuf:"bytes,1,name=value"`
+ // averageValue is the current value of the average of the
+ // metric across all relevant pods (as a quantity)
+ AverageValue *resource.Quantity `json:"averageValue" protobuf:"bytes,2,name=averageValue"`
+ // currentAverageUtilization is the current value of the average of the
+ // resource metric across all relevant pods, represented as a percentage of
+ // the requested value of the resource for the pods.
+ AverageUtilization *int32 `json:"averageUtilization" protobuf:"bytes,3,name=averageUtilization"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
+type HorizontalPodAutoscalerList struct {
+ metav1.TypeMeta `json:",inline"`
+ // metadata is the standard list metadata.
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // items is the list of horizontal pod autoscaler objects.
+ Items []HorizontalPodAutoscaler `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/types_swagger_doc_generated.go b/staging/src/k8s.io/api/autoscaling/v2beta2/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..996dc18401d
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/types_swagger_doc_generated.go
@@ -0,0 +1,240 @@
+/*
+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 v2beta2
+
+// 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_CrossVersionObjectReference = map[string]string{
+ "": "CrossVersionObjectReference contains enough information to let you identify the referred resource.",
+ "kind": "Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\"",
+ "name": "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names",
+ "apiVersion": "API version of the referent",
+}
+
+func (CrossVersionObjectReference) SwaggerDoc() map[string]string {
+ return map_CrossVersionObjectReference
+}
+
+var map_ExternalMetricSource = map[string]string{
+ "": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+ "metric": "metric identifies the target metric by name and selector",
+ "target": "target specifies the target value for the given metric",
+}
+
+func (ExternalMetricSource) SwaggerDoc() map[string]string {
+ return map_ExternalMetricSource
+}
+
+var map_ExternalMetricStatus = map[string]string{
+ "": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.",
+ "metric": "metric identifies the target metric by name and selector",
+ "current": "current contains the current value for the given metric",
+}
+
+func (ExternalMetricStatus) SwaggerDoc() map[string]string {
+ return map_ExternalMetricStatus
+}
+
+var map_HorizontalPodAutoscaler = map[string]string{
+ "": "HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.",
+ "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
+ "spec": "spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.",
+ "status": "status is the current information about the autoscaler.",
+}
+
+func (HorizontalPodAutoscaler) SwaggerDoc() map[string]string {
+ return map_HorizontalPodAutoscaler
+}
+
+var map_HorizontalPodAutoscalerCondition = map[string]string{
+ "": "HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.",
+ "type": "type describes the current condition",
+ "status": "status is the status of the condition (True, False, Unknown)",
+ "lastTransitionTime": "lastTransitionTime is the last time the condition transitioned from one status to another",
+ "reason": "reason is the reason for the condition's last transition.",
+ "message": "message is a human-readable explanation containing details about the transition",
+}
+
+func (HorizontalPodAutoscalerCondition) SwaggerDoc() map[string]string {
+ return map_HorizontalPodAutoscalerCondition
+}
+
+var map_HorizontalPodAutoscalerList = map[string]string{
+ "": "HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.",
+ "metadata": "metadata is the standard list metadata.",
+ "items": "items is the list of horizontal pod autoscaler objects.",
+}
+
+func (HorizontalPodAutoscalerList) SwaggerDoc() map[string]string {
+ return map_HorizontalPodAutoscalerList
+}
+
+var map_HorizontalPodAutoscalerSpec = map[string]string{
+ "": "HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.",
+ "scaleTargetRef": "scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count.",
+ "minReplicas": "minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod.",
+ "maxReplicas": "maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.",
+ "metrics": "metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.",
+}
+
+func (HorizontalPodAutoscalerSpec) SwaggerDoc() map[string]string {
+ return map_HorizontalPodAutoscalerSpec
+}
+
+var map_HorizontalPodAutoscalerStatus = map[string]string{
+ "": "HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.",
+ "observedGeneration": "observedGeneration is the most recent generation observed by this autoscaler.",
+ "lastScaleTime": "lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed.",
+ "currentReplicas": "currentReplicas is current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler.",
+ "desiredReplicas": "desiredReplicas is the desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler.",
+ "currentMetrics": "currentMetrics is the last read state of the metrics used by this autoscaler.",
+ "conditions": "conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.",
+}
+
+func (HorizontalPodAutoscalerStatus) SwaggerDoc() map[string]string {
+ return map_HorizontalPodAutoscalerStatus
+}
+
+var map_MetricIdentifier = map[string]string{
+ "": "MetricIdentifier defines the name and optionally selector for a metric",
+ "name": "name is the name of the given metric",
+ "selector": "selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.",
+}
+
+func (MetricIdentifier) SwaggerDoc() map[string]string {
+ return map_MetricIdentifier
+}
+
+var map_MetricSpec = map[string]string{
+ "": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).",
+ "type": "type is the type of metric source. It should be one of \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.",
+ "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
+ "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+}
+
+func (MetricSpec) SwaggerDoc() map[string]string {
+ return map_MetricSpec
+}
+
+var map_MetricStatus = map[string]string{
+ "": "MetricStatus describes the last-read state of a single metric.",
+ "type": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.",
+ "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
+ "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).",
+}
+
+func (MetricStatus) SwaggerDoc() map[string]string {
+ return map_MetricStatus
+}
+
+var map_MetricTarget = map[string]string{
+ "": "MetricTarget defines the target value, average value, or average utilization of a specific metric",
+ "type": "type represents whether the metric type is Utilization, Value, or AverageValue",
+ "value": "value is the target value of the metric (as a quantity).",
+ "averageValue": "averageValue is the target value of the average of the metric across all relevant pods (as a quantity)",
+ "averageUtilization": "averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type",
+}
+
+func (MetricTarget) SwaggerDoc() map[string]string {
+ return map_MetricTarget
+}
+
+var map_MetricValueStatus = map[string]string{
+ "": "MetricValueStatus holds the current value for a metric",
+ "value": "value is the current value of the metric (as a quantity).",
+ "averageValue": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)",
+ "averageUtilization": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.",
+}
+
+func (MetricValueStatus) SwaggerDoc() map[string]string {
+ return map_MetricValueStatus
+}
+
+var map_ObjectMetricSource = map[string]string{
+ "": "ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "target": "target specifies the target value for the given metric",
+ "metric": "metric identifies the target metric by name and selector",
+}
+
+func (ObjectMetricSource) SwaggerDoc() map[string]string {
+ return map_ObjectMetricSource
+}
+
+var map_ObjectMetricStatus = map[string]string{
+ "": "ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).",
+ "metric": "metric identifies the target metric by name and selector",
+ "current": "current contains the current value for the given metric",
+}
+
+func (ObjectMetricStatus) SwaggerDoc() map[string]string {
+ return map_ObjectMetricStatus
+}
+
+var map_PodsMetricSource = map[string]string{
+ "": "PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.",
+ "metric": "metric identifies the target metric by name and selector",
+ "target": "target specifies the target value for the given metric",
+}
+
+func (PodsMetricSource) SwaggerDoc() map[string]string {
+ return map_PodsMetricSource
+}
+
+var map_PodsMetricStatus = map[string]string{
+ "": "PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).",
+ "metric": "metric identifies the target metric by name and selector",
+ "current": "current contains the current value for the given metric",
+}
+
+func (PodsMetricStatus) SwaggerDoc() map[string]string {
+ return map_PodsMetricStatus
+}
+
+var map_ResourceMetricSource = map[string]string{
+ "": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.",
+ "name": "name is the name of the resource in question.",
+ "target": "target specifies the target value for the given metric",
+}
+
+func (ResourceMetricSource) SwaggerDoc() map[string]string {
+ return map_ResourceMetricSource
+}
+
+var map_ResourceMetricStatus = map[string]string{
+ "": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
+ "name": "Name is the name of the resource in question.",
+ "current": "current contains the current value for the given metric",
+}
+
+func (ResourceMetricStatus) SwaggerDoc() map[string]string {
+ return map_ResourceMetricStatus
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/zz_generated.deepcopy.go b/staging/src/k8s.io/api/autoscaling/v2beta2/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..a6a95653a3a
--- /dev/null
+++ b/staging/src/k8s.io/api/autoscaling/v2beta2/zz_generated.deepcopy.go
@@ -0,0 +1,487 @@
+// +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 v2beta2
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/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 *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossVersionObjectReference.
+func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference {
+ if in == nil {
+ return nil
+ }
+ out := new(CrossVersionObjectReference)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) {
+ *out = *in
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Target.DeepCopyInto(&out.Target)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricSource.
+func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ExternalMetricSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) {
+ *out = *in
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricStatus.
+func (in *ExternalMetricStatus) DeepCopy() *ExternalMetricStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ExternalMetricStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HorizontalPodAutoscaler) DeepCopyInto(out *HorizontalPodAutoscaler) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ in.Status.DeepCopyInto(&out.Status)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscaler.
+func (in *HorizontalPodAutoscaler) DeepCopy() *HorizontalPodAutoscaler {
+ if in == nil {
+ return nil
+ }
+ out := new(HorizontalPodAutoscaler)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *HorizontalPodAutoscaler) 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 *HorizontalPodAutoscalerCondition) DeepCopyInto(out *HorizontalPodAutoscalerCondition) {
+ *out = *in
+ in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerCondition.
+func (in *HorizontalPodAutoscalerCondition) DeepCopy() *HorizontalPodAutoscalerCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(HorizontalPodAutoscalerCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HorizontalPodAutoscalerList) DeepCopyInto(out *HorizontalPodAutoscalerList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]HorizontalPodAutoscaler, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerList.
+func (in *HorizontalPodAutoscalerList) DeepCopy() *HorizontalPodAutoscalerList {
+ if in == nil {
+ return nil
+ }
+ out := new(HorizontalPodAutoscalerList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *HorizontalPodAutoscalerList) 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 *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscalerSpec) {
+ *out = *in
+ out.ScaleTargetRef = in.ScaleTargetRef
+ if in.MinReplicas != nil {
+ in, out := &in.MinReplicas, &out.MinReplicas
+ *out = new(int32)
+ **out = **in
+ }
+ if in.Metrics != nil {
+ in, out := &in.Metrics, &out.Metrics
+ *out = make([]MetricSpec, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerSpec.
+func (in *HorizontalPodAutoscalerSpec) DeepCopy() *HorizontalPodAutoscalerSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(HorizontalPodAutoscalerSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscalerStatus) {
+ *out = *in
+ if in.ObservedGeneration != nil {
+ in, out := &in.ObservedGeneration, &out.ObservedGeneration
+ *out = new(int64)
+ **out = **in
+ }
+ if in.LastScaleTime != nil {
+ in, out := &in.LastScaleTime, &out.LastScaleTime
+ *out = (*in).DeepCopy()
+ }
+ if in.CurrentMetrics != nil {
+ in, out := &in.CurrentMetrics, &out.CurrentMetrics
+ *out = make([]MetricStatus, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]HorizontalPodAutoscalerCondition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerStatus.
+func (in *HorizontalPodAutoscalerStatus) DeepCopy() *HorizontalPodAutoscalerStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(HorizontalPodAutoscalerStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricIdentifier) DeepCopyInto(out *MetricIdentifier) {
+ *out = *in
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
+func (in *MetricIdentifier) DeepCopy() *MetricIdentifier {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricIdentifier)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricSpec) DeepCopyInto(out *MetricSpec) {
+ *out = *in
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(ObjectMetricSource)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(PodsMetricSource)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(ResourceMetricSource)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(ExternalMetricSource)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSpec.
+func (in *MetricSpec) DeepCopy() *MetricSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricStatus) DeepCopyInto(out *MetricStatus) {
+ *out = *in
+ if in.Object != nil {
+ in, out := &in.Object, &out.Object
+ *out = new(ObjectMetricStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Pods != nil {
+ in, out := &in.Pods, &out.Pods
+ *out = new(PodsMetricStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Resource != nil {
+ in, out := &in.Resource, &out.Resource
+ *out = new(ResourceMetricStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.External != nil {
+ in, out := &in.External, &out.External
+ *out = new(ExternalMetricStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricStatus.
+func (in *MetricStatus) DeepCopy() *MetricStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricTarget) DeepCopyInto(out *MetricTarget) {
+ *out = *in
+ if in.Value != nil {
+ in, out := &in.Value, &out.Value
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageUtilization != nil {
+ in, out := &in.AverageUtilization, &out.AverageUtilization
+ *out = new(int32)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricTarget.
+func (in *MetricTarget) DeepCopy() *MetricTarget {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricTarget)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricValueStatus) DeepCopyInto(out *MetricValueStatus) {
+ *out = *in
+ if in.Value != nil {
+ in, out := &in.Value, &out.Value
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageValue != nil {
+ in, out := &in.AverageValue, &out.AverageValue
+ x := (*in).DeepCopy()
+ *out = &x
+ }
+ if in.AverageUtilization != nil {
+ in, out := &in.AverageUtilization, &out.AverageUtilization
+ *out = new(int32)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricValueStatus.
+func (in *MetricValueStatus) DeepCopy() *MetricValueStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricValueStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource) {
+ *out = *in
+ out.DescribedObject = in.DescribedObject
+ in.Target.DeepCopyInto(&out.Target)
+ in.Metric.DeepCopyInto(&out.Metric)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMetricSource.
+func (in *ObjectMetricSource) DeepCopy() *ObjectMetricSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ObjectMetricSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ObjectMetricStatus) DeepCopyInto(out *ObjectMetricStatus) {
+ *out = *in
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
+ out.DescribedObject = in.DescribedObject
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMetricStatus.
+func (in *ObjectMetricStatus) DeepCopy() *ObjectMetricStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ObjectMetricStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource) {
+ *out = *in
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Target.DeepCopyInto(&out.Target)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodsMetricSource.
+func (in *PodsMetricSource) DeepCopy() *PodsMetricSource {
+ if in == nil {
+ return nil
+ }
+ out := new(PodsMetricSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus) {
+ *out = *in
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Current.DeepCopyInto(&out.Current)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodsMetricStatus.
+func (in *PodsMetricStatus) DeepCopy() *PodsMetricStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(PodsMetricStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) {
+ *out = *in
+ in.Target.DeepCopyInto(&out.Target)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceMetricSource.
+func (in *ResourceMetricSource) DeepCopy() *ResourceMetricSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceMetricSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus) {
+ *out = *in
+ in.Current.DeepCopyInto(&out.Current)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceMetricStatus.
+func (in *ResourceMetricStatus) DeepCopy() *ResourceMetricStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceMetricStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
index 8d45965fc2c..9b89dd19a27 100644
--- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
+++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
@@ -882,6 +882,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1602,6 +1606,10 @@
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1782,6 +1790,10 @@
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1886,6 +1898,10 @@
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json
index 4cb1be073ea..b273dc2de46 100644
--- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json
+++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json
@@ -902,6 +902,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1238,6 +1242,10 @@
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1462,6 +1470,14 @@
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1642,6 +1658,10 @@
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json
index c82d75c56f1..133310f134b 100644
--- a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json
+++ b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json
@@ -246,6 +246,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json
index 06b0fc2cdae..7966502990b 100644
--- a/staging/src/k8s.io/client-go/Godeps/Godeps.json
+++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json
@@ -314,6 +314,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/client-go/informers/BUILD b/staging/src/k8s.io/client-go/informers/BUILD
index d134632bb00..d5654768687 100644
--- a/staging/src/k8s.io/client-go/informers/BUILD
+++ b/staging/src/k8s.io/client-go/informers/BUILD
@@ -1,9 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -13,6 +8,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers",
importpath = "k8s.io/client-go/informers",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/admissionregistration/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
@@ -21,6 +17,7 @@ go_library(
"//staging/src/k8s.io/api/apps/v1beta2:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/batch/v2alpha1:go_default_library",
@@ -93,4 +90,5 @@ filegroup(
"//staging/src/k8s.io/client-go/informers/storage:all-srcs",
],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/client-go/informers/autoscaling/BUILD b/staging/src/k8s.io/client-go/informers/autoscaling/BUILD
index b9d272f3501..66f6ca746ce 100644
--- a/staging/src/k8s.io/client-go/informers/autoscaling/BUILD
+++ b/staging/src/k8s.io/client-go/informers/autoscaling/BUILD
@@ -9,6 +9,7 @@ go_library(
deps = [
"//staging/src/k8s.io/client-go/informers/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/client-go/informers/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/client-go/informers/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
],
)
@@ -26,6 +27,7 @@ filegroup(
":package-srcs",
"//staging/src/k8s.io/client-go/informers/autoscaling/v1:all-srcs",
"//staging/src/k8s.io/client-go/informers/autoscaling/v2beta1:all-srcs",
+ "//staging/src/k8s.io/client-go/informers/autoscaling/v2beta2:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
diff --git a/staging/src/k8s.io/client-go/informers/autoscaling/interface.go b/staging/src/k8s.io/client-go/informers/autoscaling/interface.go
index 1494d19d679..81e8390147d 100644
--- a/staging/src/k8s.io/client-go/informers/autoscaling/interface.go
+++ b/staging/src/k8s.io/client-go/informers/autoscaling/interface.go
@@ -21,6 +21,7 @@ package autoscaling
import (
v1 "k8s.io/client-go/informers/autoscaling/v1"
v2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1"
+ v2beta2 "k8s.io/client-go/informers/autoscaling/v2beta2"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
)
@@ -30,6 +31,8 @@ type Interface interface {
V1() v1.Interface
// V2beta1 provides access to shared informers for resources in V2beta1.
V2beta1() v2beta1.Interface
+ // V2beta2 provides access to shared informers for resources in V2beta2.
+ V2beta2() v2beta2.Interface
}
type group struct {
@@ -52,3 +55,8 @@ func (g *group) V1() v1.Interface {
func (g *group) V2beta1() v2beta1.Interface {
return v2beta1.New(g.factory, g.namespace, g.tweakListOptions)
}
+
+// V2beta2 returns a new v2beta2.Interface.
+func (g *group) V2beta2() v2beta2.Interface {
+ return v2beta2.New(g.factory, g.namespace, g.tweakListOptions)
+}
diff --git a/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/BUILD b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/BUILD
new file mode 100644
index 00000000000..78bdf909744
--- /dev/null
+++ b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/BUILD
@@ -0,0 +1,36 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "horizontalpodautoscaler.go",
+ "interface.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/autoscaling/v2beta2",
+ importpath = "k8s.io/client-go/informers/autoscaling/v2beta2",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/api/autoscaling/v2beta2: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/autoscaling/v2beta2: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"],
+)
diff --git a/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go
new file mode 100644
index 00000000000..b4863f9b74d
--- /dev/null
+++ b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go
@@ -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 v2beta2
+
+import (
+ time "time"
+
+ autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
+ v1 "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"
+ v2beta2 "k8s.io/client-go/listers/autoscaling/v2beta2"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// HorizontalPodAutoscalerInformer provides access to a shared informer and lister for
+// HorizontalPodAutoscalers.
+type HorizontalPodAutoscalerInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v2beta2.HorizontalPodAutoscalerLister
+}
+
+type horizontalPodAutoscalerInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler 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 NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredHorizontalPodAutoscalerInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler 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 NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(options)
+ },
+ },
+ &autoscalingv2beta2.HorizontalPodAutoscaler{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredHorizontalPodAutoscalerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&autoscalingv2beta2.HorizontalPodAutoscaler{}, f.defaultInformer)
+}
+
+func (f *horizontalPodAutoscalerInformer) Lister() v2beta2.HorizontalPodAutoscalerLister {
+ return v2beta2.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer())
+}
diff --git a/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/interface.go b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/interface.go
new file mode 100644
index 00000000000..e482c57925f
--- /dev/null
+++ b/staging/src/k8s.io/client-go/informers/autoscaling/v2beta2/interface.go
@@ -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 v2beta2
+
+import (
+ internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer.
+ HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer
+}
+
+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}
+}
+
+// HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer.
+func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer {
+ return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
diff --git a/staging/src/k8s.io/client-go/informers/generic.go b/staging/src/k8s.io/client-go/informers/generic.go
index 5e6ee1c23d7..3af96304a5c 100644
--- a/staging/src/k8s.io/client-go/informers/generic.go
+++ b/staging/src/k8s.io/client-go/informers/generic.go
@@ -28,6 +28,7 @@ import (
v1beta2 "k8s.io/api/apps/v1beta2"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v2beta1 "k8s.io/api/autoscaling/v2beta1"
+ v2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
v2alpha1 "k8s.io/api/batch/v2alpha1"
@@ -127,6 +128,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case v2beta1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2beta1().HorizontalPodAutoscalers().Informer()}, nil
+ // Group=autoscaling, Version=v2beta2
+ case v2beta2.SchemeGroupVersion.WithResource("horizontalpodautoscalers"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2beta2().HorizontalPodAutoscalers().Informer()}, nil
+
// Group=batch, Version=v1
case batchv1.SchemeGroupVersion.WithResource("jobs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1().Jobs().Informer()}, nil
diff --git a/staging/src/k8s.io/client-go/kubernetes/BUILD b/staging/src/k8s.io/client-go/kubernetes/BUILD
index 8fa50b4de2d..fc7ed0d7448 100644
--- a/staging/src/k8s.io/client-go/kubernetes/BUILD
+++ b/staging/src/k8s.io/client-go/kubernetes/BUILD
@@ -1,9 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -14,6 +9,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes",
importpath = "k8s.io/client-go/kubernetes",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/client-go/discovery:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1:go_default_library",
@@ -27,6 +23,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1:go_default_library",
@@ -75,6 +72,7 @@ filegroup(
"//staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1:all-srcs",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:all-srcs",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1:all-srcs",
@@ -96,4 +94,5 @@ filegroup(
"//staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1:all-srcs",
],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/client-go/kubernetes/clientset.go b/staging/src/k8s.io/client-go/kubernetes/clientset.go
index c0416fc3edc..122e4bb7f19 100644
--- a/staging/src/k8s.io/client-go/kubernetes/clientset.go
+++ b/staging/src/k8s.io/client-go/kubernetes/clientset.go
@@ -31,6 +31,7 @@ import (
authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1"
autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1"
autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1"
+ autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2"
batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1"
batchv2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1"
@@ -77,6 +78,7 @@ type Interface interface {
// Deprecated: please explicitly pick a version if possible.
Autoscaling() autoscalingv1.AutoscalingV1Interface
AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface
+ AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface
BatchV1() batchv1.BatchV1Interface
// Deprecated: please explicitly pick a version if possible.
Batch() batchv1.BatchV1Interface
@@ -137,6 +139,7 @@ type Clientset struct {
authorizationV1beta1 *authorizationv1beta1.AuthorizationV1beta1Client
autoscalingV1 *autoscalingv1.AutoscalingV1Client
autoscalingV2beta1 *autoscalingv2beta1.AutoscalingV2beta1Client
+ autoscalingV2beta2 *autoscalingv2beta2.AutoscalingV2beta2Client
batchV1 *batchv1.BatchV1Client
batchV1beta1 *batchv1beta1.BatchV1beta1Client
batchV2alpha1 *batchv2alpha1.BatchV2alpha1Client
@@ -243,6 +246,11 @@ func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1In
return c.autoscalingV2beta1
}
+// AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client
+func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface {
+ return c.autoscalingV2beta2
+}
+
// BatchV1 retrieves the BatchV1Client
func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
return c.batchV1
@@ -470,6 +478,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
+ cs.autoscalingV2beta2, err = autoscalingv2beta2.NewForConfig(&configShallowCopy)
+ if err != nil {
+ return nil, err
+ }
cs.batchV1, err = batchv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@@ -569,6 +581,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.authorizationV1beta1 = authorizationv1beta1.NewForConfigOrDie(c)
cs.autoscalingV1 = autoscalingv1.NewForConfigOrDie(c)
cs.autoscalingV2beta1 = autoscalingv2beta1.NewForConfigOrDie(c)
+ cs.autoscalingV2beta2 = autoscalingv2beta2.NewForConfigOrDie(c)
cs.batchV1 = batchv1.NewForConfigOrDie(c)
cs.batchV1beta1 = batchv1beta1.NewForConfigOrDie(c)
cs.batchV2alpha1 = batchv2alpha1.NewForConfigOrDie(c)
@@ -607,6 +620,7 @@ func New(c rest.Interface) *Clientset {
cs.authorizationV1beta1 = authorizationv1beta1.New(c)
cs.autoscalingV1 = autoscalingv1.New(c)
cs.autoscalingV2beta1 = autoscalingv2beta1.New(c)
+ cs.autoscalingV2beta2 = autoscalingv2beta2.New(c)
cs.batchV1 = batchv1.New(c)
cs.batchV1beta1 = batchv1beta1.New(c)
cs.batchV2alpha1 = batchv2alpha1.New(c)
diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/fake/BUILD
index a5f9385bbac..2acd97972cb 100644
--- a/staging/src/k8s.io/client-go/kubernetes/fake/BUILD
+++ b/staging/src/k8s.io/client-go/kubernetes/fake/BUILD
@@ -1,9 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -14,6 +9,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/fake",
importpath = "k8s.io/client-go/kubernetes/fake",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/admissionregistration/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
@@ -26,6 +22,7 @@ go_library(
"//staging/src/k8s.io/api/authorization/v1beta1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/batch/v2alpha1:go_default_library",
@@ -76,6 +73,8 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library",
@@ -129,4 +128,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go
index 720b98925f9..a23b3165a04 100644
--- a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go
+++ b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go
@@ -46,6 +46,8 @@ import (
fakeautoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake"
autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1"
fakeautoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake"
+ autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2"
+ fakeautoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake"
batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
fakebatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1/fake"
batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1"
@@ -209,6 +211,11 @@ func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1In
return &fakeautoscalingv2beta1.FakeAutoscalingV2beta1{Fake: &c.Fake}
}
+// AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client
+func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface {
+ return &fakeautoscalingv2beta2.FakeAutoscalingV2beta2{Fake: &c.Fake}
+}
+
// BatchV1 retrieves the BatchV1Client
func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
return &fakebatchv1.FakeBatchV1{Fake: &c.Fake}
diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/register.go b/staging/src/k8s.io/client-go/kubernetes/fake/register.go
index a39e7e59b76..c429979688b 100644
--- a/staging/src/k8s.io/client-go/kubernetes/fake/register.go
+++ b/staging/src/k8s.io/client-go/kubernetes/fake/register.go
@@ -30,6 +30,7 @@ import (
authorizationv1beta1 "k8s.io/api/authorization/v1beta1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
@@ -71,6 +72,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
authorizationv1beta1.AddToScheme,
autoscalingv1.AddToScheme,
autoscalingv2beta1.AddToScheme,
+ autoscalingv2beta2.AddToScheme,
batchv1.AddToScheme,
batchv1beta1.AddToScheme,
batchv2alpha1.AddToScheme,
diff --git a/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD b/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD
index bee8cd71a57..3490063e7e0 100644
--- a/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD
+++ b/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD
@@ -1,9 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -13,6 +8,7 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/scheme",
importpath = "k8s.io/client-go/kubernetes/scheme",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/admissionregistration/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
@@ -25,6 +21,7 @@ go_library(
"//staging/src/k8s.io/api/authorization/v1beta1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/batch/v2alpha1:go_default_library",
@@ -63,4 +60,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go
index 78d1d839986..9ca89b76e44 100644
--- a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go
+++ b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go
@@ -30,6 +30,7 @@ import (
authorizationv1beta1 "k8s.io/api/authorization/v1beta1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
+ autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
@@ -71,6 +72,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
authorizationv1beta1.AddToScheme,
autoscalingv1.AddToScheme,
autoscalingv2beta1.AddToScheme,
+ autoscalingv2beta2.AddToScheme,
batchv1.AddToScheme,
batchv1beta1.AddToScheme,
batchv2alpha1.AddToScheme,
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/BUILD
new file mode 100644
index 00000000000..f4b0f0eff6e
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/BUILD
@@ -0,0 +1,40 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "autoscaling_client.go",
+ "doc.go",
+ "generated_expansion.go",
+ "horizontalpodautoscaler.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ importpath = "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer: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/autoscaling/v2beta2/fake:all-srcs",
+ ],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go
new file mode 100644
index 00000000000..03fe25e487e
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go
@@ -0,0 +1,90 @@
+/*
+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 v2beta2
+
+import (
+ v2beta2 "k8s.io/api/autoscaling/v2beta2"
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ "k8s.io/client-go/kubernetes/scheme"
+ rest "k8s.io/client-go/rest"
+)
+
+type AutoscalingV2beta2Interface interface {
+ RESTClient() rest.Interface
+ HorizontalPodAutoscalersGetter
+}
+
+// AutoscalingV2beta2Client is used to interact with features provided by the autoscaling group.
+type AutoscalingV2beta2Client struct {
+ restClient rest.Interface
+}
+
+func (c *AutoscalingV2beta2Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface {
+ return newHorizontalPodAutoscalers(c, namespace)
+}
+
+// NewForConfig creates a new AutoscalingV2beta2Client for the given config.
+func NewForConfig(c *rest.Config) (*AutoscalingV2beta2Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return &AutoscalingV2beta2Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new AutoscalingV2beta2Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *AutoscalingV2beta2Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new AutoscalingV2beta2Client for the given RESTClient.
+func New(c rest.Interface) *AutoscalingV2beta2Client {
+ return &AutoscalingV2beta2Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v2beta2.SchemeGroupVersion
+ config.GroupVersion = &gv
+ config.APIPath = "/apis"
+ config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
+
+ if config.UserAgent == "" {
+ config.UserAgent = rest.DefaultKubernetesUserAgent()
+ }
+
+ return nil
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *AutoscalingV2beta2Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/doc.go
new file mode 100644
index 00000000000..c600965946a
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/doc.go
@@ -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 v2beta2
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/BUILD
new file mode 100644
index 00000000000..5d1ddd5b02c
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/BUILD
@@ -0,0 +1,38 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "fake_autoscaling_client.go",
+ "fake_horizontalpodautoscaler.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake",
+ importpath = "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/api/autoscaling/v2beta2: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/autoscaling/v2beta2: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"],
+)
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go
new file mode 100644
index 00000000000..16f44399065
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go
@@ -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
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go
new file mode 100644
index 00000000000..8c36e0e815a
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go
@@ -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 (
+ v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2"
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+)
+
+type FakeAutoscalingV2beta2 struct {
+ *testing.Fake
+}
+
+func (c *FakeAutoscalingV2beta2) HorizontalPodAutoscalers(namespace string) v2beta2.HorizontalPodAutoscalerInterface {
+ return &FakeHorizontalPodAutoscalers{c, namespace}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeAutoscalingV2beta2) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go
new file mode 100644
index 00000000000..a19b86e2d03
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go
@@ -0,0 +1,140 @@
+/*
+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 (
+ v2beta2 "k8s.io/api/autoscaling/v2beta2"
+ 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"
+)
+
+// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
+type FakeHorizontalPodAutoscalers struct {
+ Fake *FakeAutoscalingV2beta2
+ ns string
+}
+
+var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v2beta2", Resource: "horizontalpodautoscalers"}
+
+var horizontalpodautoscalersKind = schema.GroupVersionKind{Group: "autoscaling", Version: "v2beta2", Kind: "HorizontalPodAutoscaler"}
+
+// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
+func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), err
+}
+
+// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
+func (c *FakeHorizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta2.HorizontalPodAutoscalerList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v2beta2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta2.HorizontalPodAutoscalerList).ListMeta}
+ for _, item := range obj.(*v2beta2.HorizontalPodAutoscalerList).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 horizontalPodAutoscalers.
+func (c *FakeHorizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
+func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), err
+}
+
+// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
+func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), err
+}
+
+// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
+func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched horizontalPodAutoscaler.
+func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v2beta2.HorizontalPodAutoscaler{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), err
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/generated_expansion.go
new file mode 100644
index 00000000000..822e0628721
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/generated_expansion.go
@@ -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 v2beta2
+
+type HorizontalPodAutoscalerExpansion interface{}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go
new file mode 100644
index 00000000000..ddabda7e702
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go
@@ -0,0 +1,174 @@
+/*
+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 v2beta2
+
+import (
+ v2beta2 "k8s.io/api/autoscaling/v2beta2"
+ v1 "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"
+)
+
+// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
+// A group's client should implement this interface.
+type HorizontalPodAutoscalersGetter interface {
+ HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface
+}
+
+// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources.
+type HorizontalPodAutoscalerInterface interface {
+ Create(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error)
+ Update(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error)
+ UpdateStatus(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error)
+ List(opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error)
+ HorizontalPodAutoscalerExpansion
+}
+
+// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
+type horizontalPodAutoscalers struct {
+ client rest.Interface
+ ns string
+}
+
+// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers
+func newHorizontalPodAutoscalers(c *AutoscalingV2beta2Client, namespace string) *horizontalPodAutoscalers {
+ return &horizontalPodAutoscalers{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
+func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ result = &v2beta2.HorizontalPodAutoscaler{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
+func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
+ result = &v2beta2.HorizontalPodAutoscalerList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
+func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
+func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ result = &v2beta2.HorizontalPodAutoscaler{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ Body(horizontalPodAutoscaler).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
+func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ result = &v2beta2.HorizontalPodAutoscaler{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ Name(horizontalPodAutoscaler.Name).
+ Body(horizontalPodAutoscaler).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ result = &v2beta2.HorizontalPodAutoscaler{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ Name(horizontalPodAutoscaler.Name).
+ SubResource("status").
+ Body(horizontalPodAutoscaler).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
+func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched horizontalPodAutoscaler.
+func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) {
+ result = &v2beta2.HorizontalPodAutoscaler{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("horizontalpodautoscalers").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/BUILD b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/BUILD
new file mode 100644
index 00000000000..6ce5db8f769
--- /dev/null
+++ b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/BUILD
@@ -0,0 +1,32 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "expansion_generated.go",
+ "horizontalpodautoscaler.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/listers/autoscaling/v2beta2",
+ importpath = "k8s.io/client-go/listers/autoscaling/v2beta2",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/api/autoscaling/v2beta2: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"],
+)
diff --git a/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/expansion_generated.go b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/expansion_generated.go
new file mode 100644
index 00000000000..5127945a9c7
--- /dev/null
+++ b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/expansion_generated.go
@@ -0,0 +1,27 @@
+/*
+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 v2beta2
+
+// HorizontalPodAutoscalerListerExpansion allows custom methods to be added to
+// HorizontalPodAutoscalerLister.
+type HorizontalPodAutoscalerListerExpansion interface{}
+
+// HorizontalPodAutoscalerNamespaceListerExpansion allows custom methods to be added to
+// HorizontalPodAutoscalerNamespaceLister.
+type HorizontalPodAutoscalerNamespaceListerExpansion interface{}
diff --git a/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/horizontalpodautoscaler.go
new file mode 100644
index 00000000000..9caaed88f7f
--- /dev/null
+++ b/staging/src/k8s.io/client-go/listers/autoscaling/v2beta2/horizontalpodautoscaler.go
@@ -0,0 +1,94 @@
+/*
+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 v2beta2
+
+import (
+ v2beta2 "k8s.io/api/autoscaling/v2beta2"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// HorizontalPodAutoscalerLister helps list HorizontalPodAutoscalers.
+type HorizontalPodAutoscalerLister interface {
+ // List lists all HorizontalPodAutoscalers in the indexer.
+ List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error)
+ // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers.
+ HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister
+ HorizontalPodAutoscalerListerExpansion
+}
+
+// horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface.
+type horizontalPodAutoscalerLister struct {
+ indexer cache.Indexer
+}
+
+// NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister.
+func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister {
+ return &horizontalPodAutoscalerLister{indexer: indexer}
+}
+
+// List lists all HorizontalPodAutoscalers in the indexer.
+func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v2beta2.HorizontalPodAutoscaler))
+ })
+ return ret, err
+}
+
+// HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers.
+func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister {
+ return horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers.
+type HorizontalPodAutoscalerNamespaceLister interface {
+ // List lists all HorizontalPodAutoscalers in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error)
+ // Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name.
+ Get(name string) (*v2beta2.HorizontalPodAutoscaler, error)
+ HorizontalPodAutoscalerNamespaceListerExpansion
+}
+
+// horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister
+// interface.
+type horizontalPodAutoscalerNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all HorizontalPodAutoscalers in the indexer for a given namespace.
+func (s horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v2beta2.HorizontalPodAutoscaler))
+ })
+ return ret, err
+}
+
+// Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name.
+func (s horizontalPodAutoscalerNamespaceLister) Get(name string) (*v2beta2.HorizontalPodAutoscaler, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v2beta2.Resource("horizontalpodautoscaler"), name)
+ }
+ return obj.(*v2beta2.HorizontalPodAutoscaler), nil
+}
diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
index 316aff47486..00518266106 100644
--- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
+++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
@@ -566,6 +566,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1278,6 +1282,10 @@
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1458,6 +1466,10 @@
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1562,6 +1574,10 @@
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/metrics/Godeps/Godeps.json b/staging/src/k8s.io/metrics/Godeps/Godeps.json
index efd78702c28..66c7c984839 100644
--- a/staging/src/k8s.io/metrics/Godeps/Godeps.json
+++ b/staging/src/k8s.io/metrics/Godeps/Godeps.json
@@ -194,6 +194,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/BUILD b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/BUILD
index 1425643527d..bc3be8a03fe 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/BUILD
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/BUILD
@@ -37,6 +37,7 @@ filegroup(
":package-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:all-srcs",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:all-srcs",
],
tags = ["automanaged"],
)
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/BUILD b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/BUILD
index 73b1900bdc3..bb70d7c2f5f 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/BUILD
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/BUILD
@@ -1,20 +1,17 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["install.go"],
importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/install",
importpath = "k8s.io/metrics/pkg/apis/custom_metrics/install",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/custom_metrics:go_default_library",
"//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
],
)
@@ -29,4 +26,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/install.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/install.go
index a20d6e4a5af..ac401be62a6 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/install.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/install/install.go
@@ -23,11 +23,13 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/metrics/pkg/apis/custom_metrics"
"k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
)
// Install registers the API group and adds types to a scheme
func Install(scheme *runtime.Scheme) {
utilruntime.Must(custom_metrics.AddToScheme(scheme))
+ utilruntime.Must(v1beta2.AddToScheme(scheme))
utilruntime.Must(v1beta1.AddToScheme(scheme))
- utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion))
+ utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion, v1beta2.SchemeGroupVersion))
}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go
index 067cadc9856..b426c019954 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go
@@ -22,6 +22,16 @@ import (
"k8s.io/apimachinery/pkg/types"
)
+type MetricIdentifier struct {
+ // name is the name of the given metric
+ Name string
+ // selector represents the label selector that could be used to select
+ // this metric, and will generally just be the selector passed in to
+ // the query used to fetch this metric.
+ // +optional
+ Selector *metav1.LabelSelector
+}
+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// a list of values for a given metric for some set of objects
@@ -42,8 +52,7 @@ type MetricValue struct {
// a reference to the described object
DescribedObject ObjectReference `json:"describedObject"`
- // the name of the metric
- MetricName string `json:"metricName"`
+ Metric MetricIdentifier
// indicates the time at which the metrics were produced
Timestamp metav1.Time `json:"timestamp"`
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/BUILD b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/BUILD
index b61541d9cd0..3212a0d6023 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/BUILD
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/BUILD
@@ -8,6 +8,7 @@ load(
go_library(
name = "go_default_library",
srcs = [
+ "conversion.go",
"doc.go",
"generated.pb.go",
"register.go",
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go
new file mode 100644
index 00000000000..ce624011693
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/conversion.go
@@ -0,0 +1,48 @@
+/*
+Copyright 2018 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 v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/conversion"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/metrics/pkg/apis/custom_metrics"
+)
+
+func addConversionFuncs(scheme *runtime.Scheme) error {
+ // Add non-generated conversion functions
+ err := scheme.AddConversionFuncs(
+ Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue,
+ Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue,
+ )
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
+ out.Metric.Name = in.MetricName
+ out.Metric.Selector = in.Selector
+ return nil
+}
+
+func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
+ out.MetricName = in.Metric.Name
+ out.Selector = in.Metric.Selector
+ return nil
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.pb.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.pb.go
index 2a85e80b831..3191ebd3de2 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.pb.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.pb.go
@@ -34,6 +34,8 @@ import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
+import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
import strings "strings"
import reflect "reflect"
@@ -110,6 +112,16 @@ func (m *MetricValue) MarshalTo(dAtA []byte) (int, error) {
return 0, err
}
i += n3
+ if m.Selector != nil {
+ dAtA[i] = 0x32
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n4, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n4
+ }
return i, nil
}
@@ -131,11 +143,11 @@ func (m *MetricValueList) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
- n4, err := m.ListMeta.MarshalTo(dAtA[i:])
+ n5, err := m.ListMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
- i += n4
+ i += n5
if len(m.Items) > 0 {
for _, msg := range m.Items {
dAtA[i] = 0x12
@@ -192,6 +204,10 @@ func (m *MetricValue) Size() (n int) {
}
l = m.Value.Size()
n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -232,6 +248,7 @@ func (this *MetricValue) String() string {
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
`WindowSeconds:` + valueToStringGenerated(this.WindowSeconds) + `,`,
`Value:` + strings.Replace(strings.Replace(this.Value.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@@ -423,6 +440,39 @@ func (m *MetricValue) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -665,39 +715,41 @@ func init() {
}
var fileDescriptorGenerated = []byte{
- // 531 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x30,
- 0x18, 0xc6, 0x9b, 0x95, 0xc2, 0xe6, 0x69, 0x1a, 0xcb, 0x85, 0xa8, 0x87, 0xb4, 0x2a, 0x97, 0x82,
- 0x34, 0x5b, 0xad, 0x10, 0x42, 0xe2, 0x16, 0x71, 0x41, 0xa2, 0x20, 0xb2, 0x89, 0x49, 0x80, 0x04,
- 0x8e, 0xf3, 0x36, 0x35, 0x25, 0x71, 0x64, 0x3b, 0x9d, 0x76, 0xe3, 0xc4, 0x99, 0x8f, 0xd5, 0xe3,
- 0xb8, 0xed, 0x54, 0xd1, 0xf0, 0x45, 0x50, 0x12, 0xa7, 0xed, 0x36, 0xfe, 0xed, 0x16, 0xdb, 0xef,
- 0xf3, 0xf3, 0xf3, 0x3e, 0xaf, 0x83, 0x4e, 0xa6, 0x4f, 0x14, 0xe6, 0x82, 0x4c, 0xb3, 0x00, 0x64,
- 0x02, 0x1a, 0x14, 0x99, 0x41, 0x12, 0x0a, 0x49, 0xcc, 0x41, 0x0c, 0x5a, 0x72, 0xa6, 0x48, 0x3a,
- 0x8d, 0x08, 0x4d, 0xb9, 0x22, 0x2c, 0x53, 0x5a, 0xc4, 0x1f, 0xea, 0xfd, 0xd9, 0x20, 0x00, 0x4d,
- 0x07, 0x24, 0x82, 0x04, 0x24, 0xd5, 0x10, 0xe2, 0x54, 0x0a, 0x2d, 0x6c, 0x5c, 0xe9, 0xb1, 0xa9,
- 0xc3, 0xe9, 0x34, 0xc2, 0x85, 0x1e, 0x5f, 0xd6, 0x63, 0xa3, 0x6f, 0x1f, 0x46, 0x5c, 0x4f, 0xb2,
- 0x00, 0x33, 0x11, 0x93, 0x48, 0x44, 0x82, 0x94, 0x98, 0x20, 0x1b, 0x97, 0xab, 0x72, 0x51, 0x7e,
- 0x55, 0xf8, 0x76, 0xcf, 0xd8, 0xa3, 0x29, 0x27, 0x4c, 0x48, 0x20, 0xb3, 0x6b, 0x16, 0xda, 0x8f,
- 0xd6, 0x35, 0x31, 0x65, 0x13, 0x9e, 0x80, 0x3c, 0xab, 0xfb, 0x20, 0x12, 0x94, 0xc8, 0x24, 0x83,
- 0x1b, 0xa9, 0x54, 0x11, 0x07, 0xfd, 0xdd, 0x5d, 0xe4, 0x4f, 0x2a, 0x99, 0x25, 0x9a, 0xc7, 0xd7,
- 0xaf, 0x79, 0xfc, 0x2f, 0x81, 0x62, 0x13, 0x88, 0xe9, 0x55, 0x5d, 0xef, 0x6b, 0x13, 0xed, 0x8e,
- 0xca, 0xec, 0xde, 0xd0, 0xcf, 0x19, 0xd8, 0x63, 0xb4, 0x1f, 0x82, 0x62, 0x92, 0x07, 0x10, 0xbe,
- 0x0a, 0x3e, 0x01, 0xd3, 0x8e, 0xd5, 0xb5, 0xfa, 0xbb, 0xc3, 0xfb, 0xf5, 0x04, 0x68, 0xca, 0x71,
- 0x11, 0x11, 0x9e, 0x0d, 0x70, 0x55, 0xe1, 0xc3, 0x18, 0x24, 0x24, 0x0c, 0xbc, 0x7b, 0xf3, 0x45,
- 0xa7, 0x91, 0x2f, 0x3a, 0xfb, 0xcf, 0x2e, 0x33, 0xfc, 0xab, 0x50, 0x7b, 0x88, 0x50, 0x35, 0xb2,
- 0x97, 0x34, 0x06, 0x67, 0xab, 0x6b, 0xf5, 0x77, 0x3c, 0xdb, 0xa8, 0xd1, 0x68, 0x75, 0xe2, 0x6f,
- 0x54, 0xd9, 0xef, 0xd0, 0x4e, 0xd1, 0x8a, 0xd2, 0x34, 0x4e, 0x9d, 0x66, 0xe9, 0xea, 0xe1, 0x86,
- 0xab, 0x55, 0xdf, 0xeb, 0xc7, 0x51, 0xc4, 0x5b, 0xf8, 0x3c, 0xe6, 0x31, 0x78, 0x07, 0x06, 0xbf,
- 0x73, 0x5c, 0x43, 0xfc, 0x35, 0xcf, 0x7e, 0x80, 0x6e, 0x9f, 0xf2, 0x24, 0x14, 0xa7, 0xce, 0xad,
- 0xae, 0xd5, 0x6f, 0x7a, 0x07, 0xf9, 0xa2, 0xb3, 0x77, 0x52, 0xee, 0x1c, 0x01, 0x13, 0x49, 0xa8,
- 0x7c, 0x53, 0x60, 0x1f, 0xa1, 0xd6, 0xac, 0x08, 0xcb, 0x69, 0x95, 0x1e, 0xf0, 0xdf, 0x3c, 0xe0,
- 0xfa, 0x61, 0xe0, 0xd7, 0x19, 0x4d, 0x34, 0xd7, 0x67, 0xde, 0x9e, 0xf1, 0xd1, 0x2a, 0x13, 0xf7,
- 0x2b, 0x56, 0xef, 0xbb, 0x85, 0xf6, 0x37, 0x06, 0xf1, 0x82, 0x2b, 0x6d, 0xbf, 0x47, 0xdb, 0x45,
- 0x07, 0x21, 0xd5, 0xd4, 0x4c, 0x01, 0xff, 0x5f, 0xbf, 0x85, 0x7a, 0x04, 0x9a, 0x7a, 0x77, 0xcd,
- 0x5d, 0xdb, 0xf5, 0x8e, 0xbf, 0x22, 0xda, 0x1f, 0x51, 0x8b, 0x6b, 0x88, 0x95, 0xb3, 0xd5, 0x6d,
- 0xf6, 0x77, 0x87, 0x4f, 0x6f, 0xf8, 0x8b, 0xe1, 0x0d, 0xb7, 0xeb, 0x9e, 0x9e, 0x17, 0x44, 0xbf,
- 0x02, 0x7b, 0x87, 0xf3, 0xa5, 0xdb, 0x38, 0x5f, 0xba, 0x8d, 0x8b, 0xa5, 0xdb, 0xf8, 0x92, 0xbb,
- 0xd6, 0x3c, 0x77, 0xad, 0xf3, 0xdc, 0xb5, 0x2e, 0x72, 0xd7, 0xfa, 0x91, 0xbb, 0xd6, 0xb7, 0x9f,
- 0x6e, 0xe3, 0xed, 0x1d, 0x03, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xe5, 0xb6, 0x67, 0x3d,
- 0x04, 0x00, 0x00,
+ // 566 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x3e,
+ 0x18, 0xc7, 0x9b, 0xf5, 0xd7, 0xfd, 0x3a, 0x8f, 0x69, 0x2c, 0x17, 0xa2, 0x1d, 0xd2, 0x6a, 0x5c,
+ 0x0a, 0xd2, 0x6c, 0x6d, 0x20, 0x84, 0xc4, 0x2d, 0xe2, 0x82, 0xb4, 0x81, 0xc8, 0x26, 0x26, 0xf1,
+ 0x47, 0xe0, 0x38, 0x4f, 0x53, 0xd3, 0x26, 0x8e, 0x6c, 0xa7, 0xd3, 0x6e, 0xbc, 0x04, 0x5e, 0x56,
+ 0x8f, 0xe3, 0xb6, 0x53, 0x45, 0x83, 0x78, 0x1f, 0x28, 0x89, 0xd3, 0x76, 0x1b, 0x7f, 0xb6, 0x5b,
+ 0x6c, 0x3f, 0xdf, 0x8f, 0xbf, 0xcf, 0xf7, 0x71, 0xd0, 0xc9, 0xf0, 0xa9, 0xc2, 0x5c, 0x90, 0x61,
+ 0x16, 0x80, 0x4c, 0x40, 0x83, 0x22, 0x63, 0x48, 0x42, 0x21, 0x89, 0x39, 0x88, 0x41, 0x4b, 0xce,
+ 0x14, 0x49, 0x87, 0x11, 0xa1, 0x29, 0x57, 0x84, 0x65, 0x4a, 0x8b, 0xf8, 0x63, 0xbd, 0x3f, 0xde,
+ 0x0b, 0x40, 0xd3, 0x3d, 0x12, 0x41, 0x02, 0x92, 0x6a, 0x08, 0x71, 0x2a, 0x85, 0x16, 0x36, 0xae,
+ 0xf4, 0xd8, 0xd4, 0xe1, 0x74, 0x18, 0xe1, 0x42, 0x8f, 0x2f, 0xeb, 0xb1, 0xd1, 0x6f, 0xef, 0x46,
+ 0x5c, 0x0f, 0xb2, 0x00, 0x33, 0x11, 0x93, 0x48, 0x44, 0x82, 0x94, 0x98, 0x20, 0xeb, 0x97, 0xab,
+ 0x72, 0x51, 0x7e, 0x55, 0xf8, 0xed, 0x1d, 0x63, 0x8f, 0xa6, 0x9c, 0x30, 0x21, 0x81, 0x8c, 0xaf,
+ 0x59, 0xd8, 0x7e, 0xbc, 0xa8, 0x89, 0x29, 0x1b, 0xf0, 0x04, 0xe4, 0x59, 0xdd, 0x07, 0x91, 0xa0,
+ 0x44, 0x26, 0x19, 0xdc, 0x4a, 0xa5, 0x8a, 0x38, 0xe8, 0xef, 0xee, 0x22, 0x7f, 0x52, 0xc9, 0x2c,
+ 0xd1, 0x3c, 0xbe, 0x7e, 0xcd, 0x93, 0x7f, 0x09, 0x14, 0x1b, 0x40, 0x4c, 0xaf, 0xea, 0x76, 0x7e,
+ 0x36, 0xd1, 0xfa, 0x61, 0x99, 0xdd, 0x1b, 0x3a, 0xca, 0xc0, 0xee, 0xa3, 0xcd, 0x10, 0x14, 0x93,
+ 0x3c, 0x80, 0xf0, 0x55, 0xf0, 0x19, 0x98, 0x76, 0xac, 0xae, 0xd5, 0x5b, 0xdf, 0xbf, 0x5f, 0x4f,
+ 0x80, 0xa6, 0x1c, 0x17, 0x11, 0xe1, 0xf1, 0x1e, 0xae, 0x2a, 0x7c, 0xe8, 0x83, 0x84, 0x84, 0x81,
+ 0x77, 0x6f, 0x32, 0xed, 0x34, 0xf2, 0x69, 0x67, 0xf3, 0xf9, 0x65, 0x86, 0x7f, 0x15, 0x6a, 0xef,
+ 0x23, 0x54, 0x8d, 0xec, 0x25, 0x8d, 0xc1, 0x59, 0xe9, 0x5a, 0xbd, 0x35, 0xcf, 0x36, 0x6a, 0x74,
+ 0x38, 0x3f, 0xf1, 0x97, 0xaa, 0xec, 0x77, 0x68, 0xad, 0x68, 0x45, 0x69, 0x1a, 0xa7, 0x4e, 0xb3,
+ 0x74, 0xf5, 0x70, 0xc9, 0xd5, 0xbc, 0xef, 0xc5, 0xe3, 0x28, 0xe2, 0x2d, 0x7c, 0x1e, 0xf3, 0x18,
+ 0xbc, 0x2d, 0x83, 0x5f, 0x3b, 0xae, 0x21, 0xfe, 0x82, 0x67, 0x3f, 0x40, 0xab, 0xa7, 0x3c, 0x09,
+ 0xc5, 0xa9, 0xf3, 0x5f, 0xd7, 0xea, 0x35, 0xbd, 0xad, 0x7c, 0xda, 0xd9, 0x38, 0x29, 0x77, 0x8e,
+ 0x80, 0x89, 0x24, 0x54, 0xbe, 0x29, 0xb0, 0x8f, 0x50, 0x6b, 0x5c, 0x84, 0xe5, 0xb4, 0x4a, 0x0f,
+ 0xf8, 0x6f, 0x1e, 0x70, 0xfd, 0x30, 0xf0, 0xeb, 0x8c, 0x26, 0x9a, 0xeb, 0x33, 0x6f, 0xc3, 0xf8,
+ 0x68, 0x95, 0x89, 0xfb, 0x15, 0xcb, 0xfe, 0x80, 0xda, 0x0a, 0x46, 0xc0, 0xb4, 0x90, 0xce, 0x6a,
+ 0xc9, 0x7d, 0x74, 0xb3, 0xde, 0x0e, 0x68, 0x00, 0xa3, 0x23, 0x23, 0xf5, 0xee, 0xe4, 0xd3, 0x4e,
+ 0xbb, 0x5e, 0xf9, 0x73, 0xe4, 0xce, 0x37, 0x0b, 0x6d, 0x2e, 0xcd, 0xf9, 0x80, 0x2b, 0x6d, 0xbf,
+ 0x47, 0xed, 0x02, 0x12, 0x52, 0x4d, 0xcd, 0x90, 0xf1, 0x0d, 0xaf, 0xe4, 0x4a, 0x1f, 0x82, 0xa6,
+ 0xde, 0x5d, 0xd3, 0x4a, 0xbb, 0xde, 0xf1, 0xe7, 0x44, 0xfb, 0x13, 0x6a, 0x71, 0x0d, 0xb1, 0x72,
+ 0x56, 0xba, 0xcd, 0xde, 0xfa, 0xfe, 0xb3, 0x5b, 0xfe, 0xc1, 0x78, 0xc9, 0xed, 0x22, 0xb2, 0x17,
+ 0x05, 0xd1, 0xaf, 0xc0, 0xde, 0xee, 0x64, 0xe6, 0x36, 0xce, 0x67, 0x6e, 0xe3, 0x62, 0xe6, 0x36,
+ 0xbe, 0xe4, 0xae, 0x35, 0xc9, 0x5d, 0xeb, 0x3c, 0x77, 0xad, 0x8b, 0xdc, 0xb5, 0xbe, 0xe7, 0xae,
+ 0xf5, 0xf5, 0x87, 0xdb, 0x78, 0xfb, 0xbf, 0x01, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xed,
+ 0x64, 0xfc, 0x9c, 0x04, 0x00, 0x00,
}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
index d05d84acbea..76b8995056d 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
@@ -49,6 +49,13 @@ message MetricValue {
// the value of the metric for this
optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 5;
+
+ // selector represents the label selector that could be used to select
+ // this metric, and will generally just be the selector passed in to
+ // the query used to fetch this metric.
+ // When left blank, only the metric's Name will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 6;
}
// a list of values for a given metric for some set of objects
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/register.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/register.go
index 9594ea9e00c..42fd2b92f02 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/register.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/register.go
@@ -34,7 +34,7 @@ func Resource(resource string) schema.GroupResource {
}
var (
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs)
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/types.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/types.go
index a9c58c89526..8f5901896a2 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/types.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/types.go
@@ -56,6 +56,13 @@ type MetricValue struct {
// the value of the metric for this
Value resource.Quantity `json:"value" protobuf:"bytes,5,name=value"`
+
+ // selector represents the label selector that could be used to select
+ // this metric, and will generally just be the selector passed in to
+ // the query used to fetch this metric.
+ // When left blank, only the metric's Name will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,6,opt,name=selector"`
}
// allObjects is a wildcard used to select metrics
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.conversion.go
index 359af269e44..5122f74d9d6 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.conversion.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.conversion.go
@@ -55,6 +55,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddConversionFunc((*custommetrics.MetricValue)(nil), (*MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(a.(*custommetrics.MetricValue), b.(*MetricValue), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*MetricValue)(nil), (*custommetrics.MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(a.(*MetricValue), b.(*custommetrics.MetricValue), scope)
+ }); err != nil {
+ return err
+ }
return nil
}
@@ -63,38 +73,39 @@ func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricVal
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err
}
- out.MetricName = in.MetricName
+ // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
out.Timestamp = in.Timestamp
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
out.Value = in.Value
+ // WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
-// Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue is an autogenerated conversion function.
-func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error {
- return autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in, out, s)
-}
-
func autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err
}
- out.MetricName = in.MetricName
+ // WARNING: in.Metric requires manual conversion: does not exist in peer-type
out.Timestamp = in.Timestamp
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
out.Value = in.Value
return nil
}
-// Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue is an autogenerated conversion function.
-func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
- return autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in, out, s)
-}
-
func autoConvert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]custommetrics.MetricValue)(unsafe.Pointer(&in.Items))
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]custommetrics.MetricValue, len(*in))
+ for i := range *in {
+ if err := Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Items = nil
+ }
return nil
}
@@ -105,7 +116,17 @@ func Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *Metri
func autoConvert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]MetricValue)(unsafe.Pointer(&in.Items))
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MetricValue, len(*in))
+ for i := range *in {
+ if err := Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.Items = nil
+ }
return nil
}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go
index 7900ec95fe1..c3e6a2614a2 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go
@@ -21,6 +21,7 @@ limitations under the License.
package v1beta1
import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -36,6 +37,11 @@ func (in *MetricValue) DeepCopyInto(out *MetricValue) {
**out = **in
}
out.Value = in.Value.DeepCopy()
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
return
}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/BUILD b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/BUILD
new file mode 100644
index 00000000000..5cf76072da3
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/BUILD
@@ -0,0 +1,46 @@
+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",
+ "zz_generated.conversion.go",
+ "zz_generated.deepcopy.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2",
+ importpath = "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2",
+ 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/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",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics:go_default_library",
+ "//vendor/github.com/gogo/protobuf/proto: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"],
+)
+
+filegroup(
+ name = "go_default_library_protos",
+ srcs = ["generated.proto"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/doc.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/doc.go
new file mode 100644
index 00000000000..e89a945b9e1
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/doc.go
@@ -0,0 +1,21 @@
+/*
+Copyright 2018 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:conversion-gen=k8s.io/metrics/pkg/apis/custom_metrics
+// +k8s:openapi-gen=true
+
+package v1beta2
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.pb.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.pb.go
new file mode 100644
index 00000000000..d0b3e2af6ae
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.pb.go
@@ -0,0 +1,1051 @@
+/*
+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 protoc-gen-gogo.
+// source: k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto
+// DO NOT EDIT!
+
+/*
+ Package v1beta2 is a generated protocol buffer package.
+
+ It is generated from these files:
+ k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto
+
+ It has these top-level messages:
+ MetricIdentifier
+ MetricListOptions
+ MetricValue
+ MetricValueList
+*/
+package v1beta2
+
+import proto "github.com/gogo/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+import strings "strings"
+import reflect "reflect"
+
+import io "io"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
+
+func (m *MetricIdentifier) Reset() { *m = MetricIdentifier{} }
+func (*MetricIdentifier) ProtoMessage() {}
+func (*MetricIdentifier) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
+
+func (m *MetricListOptions) Reset() { *m = MetricListOptions{} }
+func (*MetricListOptions) ProtoMessage() {}
+func (*MetricListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
+
+func (m *MetricValue) Reset() { *m = MetricValue{} }
+func (*MetricValue) ProtoMessage() {}
+func (*MetricValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
+
+func (m *MetricValueList) Reset() { *m = MetricValueList{} }
+func (*MetricValueList) ProtoMessage() {}
+func (*MetricValueList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
+
+func init() {
+ proto.RegisterType((*MetricIdentifier)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta2.MetricIdentifier")
+ proto.RegisterType((*MetricListOptions)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta2.MetricListOptions")
+ proto.RegisterType((*MetricValue)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta2.MetricValue")
+ proto.RegisterType((*MetricValueList)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta2.MetricValueList")
+}
+func (m *MetricIdentifier) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricIdentifier) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i += copy(dAtA[i:], m.Name)
+ if m.Selector != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
+ n1, err := m.Selector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n1
+ }
+ return i, nil
+}
+
+func (m *MetricListOptions) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricListOptions) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.LabelSelector)))
+ i += copy(dAtA[i:], m.LabelSelector)
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricLabelSelector)))
+ i += copy(dAtA[i:], m.MetricLabelSelector)
+ return i, nil
+}
+
+func (m *MetricValue) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricValue) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.DescribedObject.Size()))
+ n2, err := m.DescribedObject.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n2
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Metric.Size()))
+ n3, err := m.Metric.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n3
+ dAtA[i] = 0x1a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Timestamp.Size()))
+ n4, err := m.Timestamp.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n4
+ if m.WindowSeconds != nil {
+ dAtA[i] = 0x20
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.WindowSeconds))
+ }
+ dAtA[i] = 0x2a
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Value.Size()))
+ n5, err := m.Value.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n5
+ return i, nil
+}
+
+func (m *MetricValueList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MetricValueList) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
+ n6, err := m.ListMeta.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n6
+ if len(m.Items) > 0 {
+ for _, msg := range m.Items {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ dAtA[offset+4] = uint8(v >> 32)
+ dAtA[offset+5] = uint8(v >> 40)
+ dAtA[offset+6] = uint8(v >> 48)
+ dAtA[offset+7] = uint8(v >> 56)
+ return offset + 8
+}
+func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ return offset + 4
+}
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return offset + 1
+}
+func (m *MetricIdentifier) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Selector != nil {
+ l = m.Selector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *MetricListOptions) Size() (n int) {
+ var l int
+ _ = l
+ l = len(m.LabelSelector)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.MetricLabelSelector)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *MetricValue) Size() (n int) {
+ var l int
+ _ = l
+ l = m.DescribedObject.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Metric.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Timestamp.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.WindowSeconds != nil {
+ n += 1 + sovGenerated(uint64(*m.WindowSeconds))
+ }
+ l = m.Value.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *MetricValueList) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ for {
+ n++
+ x >>= 7
+ if x == 0 {
+ break
+ }
+ }
+ return n
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *MetricIdentifier) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricIdentifier{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricListOptions) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricListOptions{`,
+ `LabelSelector:` + fmt.Sprintf("%v", this.LabelSelector) + `,`,
+ `MetricLabelSelector:` + fmt.Sprintf("%v", this.MetricLabelSelector) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricValue) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricValue{`,
+ `DescribedObject:` + strings.Replace(strings.Replace(this.DescribedObject.String(), "ObjectReference", "k8s_io_api_core_v1.ObjectReference", 1), `&`, ``, 1) + `,`,
+ `Metric:` + strings.Replace(strings.Replace(this.Metric.String(), "MetricIdentifier", "MetricIdentifier", 1), `&`, ``, 1) + `,`,
+ `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
+ `WindowSeconds:` + valueToStringGenerated(this.WindowSeconds) + `,`,
+ `Value:` + strings.Replace(strings.Replace(this.Value.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MetricValueList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MetricValueList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "MetricValue", "MetricValue", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *MetricIdentifier) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricIdentifier: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricIdentifier: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Selector == nil {
+ m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricListOptions) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricListOptions: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricListOptions: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.LabelSelector = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MetricLabelSelector", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.MetricLabelSelector = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricValue) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricValue: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricValue: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DescribedObject", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.DescribedObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metric.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field WindowSeconds", wireType)
+ }
+ var v int64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= (int64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.WindowSeconds = &v
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MetricValueList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MetricValueList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MetricValueList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, MetricValue{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ return iNdEx, nil
+ case 1:
+ iNdEx += 8
+ return iNdEx, nil
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ iNdEx += length
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ return iNdEx, nil
+ case 3:
+ for {
+ var innerWire uint64
+ var start int = iNdEx
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ innerWire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ innerWireType := int(innerWire & 0x7)
+ if innerWireType == 4 {
+ break
+ }
+ next, err := skipGenerated(dAtA[start:])
+ if err != nil {
+ return 0, err
+ }
+ iNdEx = start + next
+ }
+ return iNdEx, nil
+ case 4:
+ return iNdEx, nil
+ case 5:
+ iNdEx += 4
+ return iNdEx, nil
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ }
+ panic("unreachable")
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+)
+
+func init() {
+ proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto", fileDescriptorGenerated)
+}
+
+var fileDescriptorGenerated = []byte{
+ // 656 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c,
+ 0x14, 0x8d, 0x9b, 0xa6, 0x5f, 0x32, 0x69, 0xbe, 0xb6, 0xae, 0x10, 0x51, 0x91, 0xdc, 0x28, 0x6c,
+ 0x22, 0xa4, 0x8e, 0xd5, 0x80, 0x00, 0xa9, 0x1b, 0x64, 0xb1, 0xa9, 0xd4, 0x50, 0xe1, 0x56, 0x54,
+ 0xe2, 0x47, 0x30, 0xb6, 0x6f, 0x92, 0x21, 0xb1, 0xc7, 0x9a, 0x19, 0xa7, 0xea, 0x8e, 0x47, 0x40,
+ 0xe2, 0x01, 0x78, 0x9d, 0x8a, 0x55, 0xd9, 0x75, 0x55, 0x11, 0xf3, 0x22, 0xc8, 0xf6, 0xb8, 0xf9,
+ 0x69, 0x81, 0x96, 0x9d, 0xc7, 0x73, 0xce, 0xb9, 0xe7, 0xde, 0x73, 0x07, 0x1d, 0x0d, 0x9e, 0x0a,
+ 0x4c, 0x99, 0x39, 0x88, 0x1c, 0xe0, 0x01, 0x48, 0x10, 0xe6, 0x08, 0x02, 0x8f, 0x71, 0x53, 0x5d,
+ 0xf8, 0x20, 0x39, 0x75, 0x85, 0x19, 0x0e, 0x7a, 0x26, 0x09, 0xa9, 0x30, 0xdd, 0x48, 0x48, 0xe6,
+ 0xbf, 0xcf, 0xff, 0x8f, 0xb6, 0x1d, 0x90, 0xa4, 0x6d, 0xf6, 0x20, 0x00, 0x4e, 0x24, 0x78, 0x38,
+ 0xe4, 0x4c, 0x32, 0x1d, 0x67, 0x7c, 0xac, 0x70, 0x38, 0x1c, 0xf4, 0x70, 0xc2, 0xc7, 0xb3, 0x7c,
+ 0xac, 0xf8, 0x1b, 0x5b, 0x3d, 0x2a, 0xfb, 0x91, 0x83, 0x5d, 0xe6, 0x9b, 0x3d, 0xd6, 0x63, 0x66,
+ 0x2a, 0xe3, 0x44, 0xdd, 0xf4, 0x94, 0x1e, 0xd2, 0xaf, 0x4c, 0x7e, 0xa3, 0xa9, 0xec, 0x91, 0x90,
+ 0x9a, 0x2e, 0xe3, 0x60, 0x8e, 0xb6, 0xe7, 0x2d, 0x6c, 0x3c, 0x9a, 0x60, 0x7c, 0xe2, 0xf6, 0x69,
+ 0x00, 0xfc, 0x24, 0xef, 0xc3, 0xe4, 0x20, 0x58, 0xc4, 0x5d, 0xb8, 0x15, 0x4b, 0x24, 0xe3, 0x20,
+ 0xd7, 0xd5, 0x32, 0x7f, 0xc7, 0xe2, 0x51, 0x20, 0xa9, 0x7f, 0xb5, 0xcc, 0xe3, 0xbf, 0x11, 0x84,
+ 0xdb, 0x07, 0x9f, 0xcc, 0xf3, 0x9a, 0x5f, 0x34, 0xb4, 0xda, 0x49, 0x67, 0xb7, 0xeb, 0x41, 0x20,
+ 0x69, 0x97, 0x02, 0xd7, 0x1b, 0x68, 0x31, 0x20, 0x3e, 0xd4, 0xb5, 0x86, 0xd6, 0xaa, 0x58, 0xcb,
+ 0xa7, 0x17, 0x9b, 0x85, 0xf8, 0x62, 0x73, 0xf1, 0x05, 0xf1, 0xc1, 0x4e, 0x6f, 0xf4, 0x77, 0xa8,
+ 0x2c, 0x60, 0x08, 0xae, 0x64, 0xbc, 0xbe, 0xd0, 0xd0, 0x5a, 0xd5, 0xf6, 0xc3, 0x3c, 0xa1, 0x69,
+ 0x07, 0x93, 0x98, 0x92, 0x46, 0xf1, 0x68, 0x1b, 0xef, 0x11, 0x07, 0x86, 0x07, 0x8a, 0x6a, 0x2d,
+ 0xc7, 0x17, 0x9b, 0xe5, 0xfc, 0x64, 0x5f, 0x4a, 0x36, 0xbf, 0x6a, 0x68, 0x2d, 0x73, 0xb5, 0x47,
+ 0x85, 0xdc, 0x0f, 0x25, 0x65, 0x81, 0xd0, 0x77, 0x50, 0x6d, 0x38, 0x4d, 0x57, 0xfe, 0xee, 0x28,
+ 0x7f, 0xb5, 0x19, 0x6d, 0x7b, 0x16, 0xab, 0x77, 0xd0, 0x7a, 0xb6, 0x23, 0x33, 0xa8, 0xd4, 0x7c,
+ 0xc5, 0xba, 0xa7, 0x24, 0xd6, 0x3b, 0x57, 0x21, 0xf6, 0x75, 0xbc, 0xe6, 0xb7, 0x22, 0xaa, 0x66,
+ 0xe0, 0x57, 0x64, 0x18, 0x81, 0xde, 0x45, 0x2b, 0x1e, 0x08, 0x97, 0x53, 0x07, 0xbc, 0x7d, 0xe7,
+ 0x23, 0xb8, 0x32, 0x75, 0x57, 0x6d, 0xdf, 0x9f, 0x9a, 0x0b, 0x4e, 0x56, 0x2b, 0x99, 0x42, 0x86,
+ 0xb0, 0xa1, 0x0b, 0x1c, 0x02, 0x17, 0xac, 0xbb, 0xaa, 0xfe, 0xca, 0xf3, 0x59, 0x0d, 0x7b, 0x5e,
+ 0x54, 0xef, 0xa3, 0xa5, 0xcc, 0x8e, 0x1a, 0xfb, 0xb3, 0x5b, 0x3e, 0x0c, 0x3c, 0x1f, 0xb6, 0xf5,
+ 0xbf, 0xaa, 0xbd, 0x94, 0xdd, 0xd8, 0x4a, 0x5f, 0x7f, 0x83, 0x2a, 0xc9, 0xe2, 0x08, 0x49, 0xfc,
+ 0xb0, 0x5e, 0x4c, 0x8b, 0x3d, 0xb8, 0x59, 0xc6, 0x87, 0xd4, 0x07, 0x6b, 0x4d, 0xc9, 0x56, 0x0e,
+ 0x73, 0x11, 0x7b, 0xa2, 0xa7, 0x3f, 0x41, 0xb5, 0x63, 0x1a, 0x78, 0xec, 0xf8, 0x00, 0x5c, 0x16,
+ 0x78, 0xa2, 0xbe, 0xd8, 0xd0, 0x5a, 0x45, 0x6b, 0x2d, 0x89, 0xf1, 0x68, 0xfa, 0xc2, 0x9e, 0xc5,
+ 0xe9, 0x07, 0xa8, 0x34, 0x4a, 0x06, 0x5e, 0x2f, 0xa5, 0x8e, 0xf0, 0x9f, 0x1c, 0xe1, 0xfc, 0x51,
+ 0xe2, 0x97, 0x11, 0x09, 0x24, 0x95, 0x27, 0x56, 0x4d, 0xb9, 0x2a, 0xa5, 0xa9, 0xd9, 0x99, 0x56,
+ 0xf3, 0xbb, 0x86, 0x56, 0xa6, 0xc2, 0x4c, 0x76, 0x4e, 0x7f, 0x8b, 0xca, 0x49, 0x3f, 0x1e, 0x91,
+ 0x44, 0x25, 0x89, 0x6f, 0xb8, 0xe1, 0x54, 0xc8, 0x0e, 0x48, 0x62, 0xad, 0xaa, 0x5a, 0xe5, 0xfc,
+ 0x8f, 0x7d, 0xa9, 0xa8, 0x7f, 0x40, 0x25, 0x2a, 0xc1, 0x17, 0xf5, 0x85, 0x46, 0xb1, 0x55, 0x6d,
+ 0xef, 0xfc, 0x5b, 0x8a, 0xa9, 0xdb, 0x49, 0x4f, 0xbb, 0x89, 0xa2, 0x9d, 0x09, 0x5b, 0x5b, 0xa7,
+ 0x63, 0xa3, 0x70, 0x36, 0x36, 0x0a, 0xe7, 0x63, 0xa3, 0xf0, 0x29, 0x36, 0xb4, 0xd3, 0xd8, 0xd0,
+ 0xce, 0x62, 0x43, 0x3b, 0x8f, 0x0d, 0xed, 0x47, 0x6c, 0x68, 0x9f, 0x7f, 0x1a, 0x85, 0xd7, 0xff,
+ 0x29, 0xc1, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x65, 0xcd, 0x16, 0xb9, 0x05, 0x00, 0x00,
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto
new file mode 100644
index 00000000000..110f1a75885
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/generated.proto
@@ -0,0 +1,85 @@
+/*
+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.metrics.pkg.apis.custom_metrics.v1beta2;
+
+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 = "v1beta2";
+
+// MetricIdentifier identifies a metric by name and, optionally, selector
+message MetricIdentifier {
+ // name is the name of the given metric
+ optional string name = 1;
+
+ // selector represents the label selector that could be used to select
+ // this metric, and will generally just be the selector passed in to
+ // the query used to fetch this metric.
+ // When left blank, only the metric's Name will be used to gather metrics.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+}
+
+// MetricListOptions is used to select metrics by their label selectors
+message MetricListOptions {
+ // A selector to restrict the list of returned objects by their labels.
+ // Defaults to everything.
+ // +optional
+ optional string labelSelector = 1;
+
+ // A selector to restrict the list of returned metrics by their labels
+ // +optional
+ optional string metricLabelSelector = 2;
+}
+
+// MetricValue is the metric value for some object
+message MetricValue {
+ // a reference to the described object
+ optional k8s.io.api.core.v1.ObjectReference describedObject = 1;
+
+ optional MetricIdentifier metric = 2;
+
+ // indicates the time at which the metrics were produced
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.Time timestamp = 3;
+
+ // indicates the window ([Timestamp-Window, Timestamp]) from
+ // which these metrics were calculated, when returning rate
+ // metrics calculated from cumulative metrics (or zero for
+ // non-calculated instantaneous metrics).
+ optional int64 windowSeconds = 4;
+
+ // the value of the metric for this
+ optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 5;
+}
+
+// MetricValueList is a list of values for a given metric for some set of objects
+message MetricValueList {
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // the value of the metric across the described objects
+ repeated MetricValue items = 2;
+}
+
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/register.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/register.go
new file mode 100644
index 00000000000..69357d43ed7
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2018 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 v1beta2
+
+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 = "custom.metrics.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ localSchemeBuilder = &SchemeBuilder
+ AddToScheme = localSchemeBuilder.AddToScheme
+)
+
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &MetricValue{},
+ &MetricValueList{},
+ &MetricListOptions{},
+ )
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/types.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/types.go
new file mode 100644
index 00000000000..a408617c177
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/types.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2018 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 v1beta2
+
+import (
+ "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// MetricIdentifier identifies a metric by name and, optionally, selector
+type MetricIdentifier struct {
+ // name is the name of the given metric
+ Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
+ // selector represents the label selector that could be used to select
+ // this metric, and will generally just be the selector passed in to
+ // the query used to fetch this metric.
+ // When left blank, only the metric's Name will be used to gather metrics.
+ // +optional
+ Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MetricValueList is a list of values for a given metric for some set of objects
+type MetricValueList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // the value of the metric across the described objects
+ Items []MetricValue `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MetricValue is the metric value for some object
+type MetricValue struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // a reference to the described object
+ DescribedObject v1.ObjectReference `json:"describedObject" protobuf:"bytes,1,name=describedObject"`
+
+ Metric MetricIdentifier `json:"metric" protobuf:"bytes,2,name=metric"`
+
+ // indicates the time at which the metrics were produced
+ Timestamp metav1.Time `json:"timestamp" protobuf:"bytes,3,name=timestamp"`
+
+ // indicates the window ([Timestamp-Window, Timestamp]) from
+ // which these metrics were calculated, when returning rate
+ // metrics calculated from cumulative metrics (or zero for
+ // non-calculated instantaneous metrics).
+ WindowSeconds *int64 `json:"windowSeconds,omitempty" protobuf:"bytes,4,opt,name=windowSeconds"`
+
+ // the value of the metric for this
+ Value resource.Quantity `json:"value" protobuf:"bytes,5,name=value"`
+}
+
+// AllObjects is a wildcard used to select metrics
+// for all objects matching the given label selector
+const AllObjects = "*"
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MetricListOptions is used to select metrics by their label selectors
+type MetricListOptions struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // A selector to restrict the list of returned objects by their labels.
+ // Defaults to everything.
+ // +optional
+ LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"`
+
+ // A selector to restrict the list of returned metrics by their labels
+ // +optional
+ MetricLabelSelector string `json:"metricLabelSelector,omitempty" protobuf:"bytes,2,opt,name=metricLabelSelector"`
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.conversion.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.conversion.go
new file mode 100644
index 00000000000..bb38f4cb312
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.conversion.go
@@ -0,0 +1,152 @@
+// +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 v1beta2
+
+import (
+ unsafe "unsafe"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ custommetrics "k8s.io/metrics/pkg/apis/custom_metrics"
+)
+
+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((*MetricIdentifier)(nil), (*custommetrics.MetricIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(a.(*MetricIdentifier), b.(*custommetrics.MetricIdentifier), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*custommetrics.MetricIdentifier)(nil), (*MetricIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(a.(*custommetrics.MetricIdentifier), b.(*MetricIdentifier), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*MetricValue)(nil), (*custommetrics.MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(a.(*MetricValue), b.(*custommetrics.MetricValue), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValue)(nil), (*MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(a.(*custommetrics.MetricValue), b.(*MetricValue), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*MetricValueList)(nil), (*custommetrics.MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(a.(*MetricValueList), b.(*custommetrics.MetricValueList), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValueList)(nil), (*MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(a.(*custommetrics.MetricValueList), b.(*MetricValueList), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in *MetricIdentifier, out *custommetrics.MetricIdentifier, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector))
+ return nil
+}
+
+// Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier is an autogenerated conversion function.
+func Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in *MetricIdentifier, out *custommetrics.MetricIdentifier, s conversion.Scope) error {
+ return autoConvert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in, out, s)
+}
+
+func autoConvert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in *custommetrics.MetricIdentifier, out *MetricIdentifier, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector))
+ return nil
+}
+
+// Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier is an autogenerated conversion function.
+func Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in *custommetrics.MetricIdentifier, out *MetricIdentifier, s conversion.Scope) error {
+ return autoConvert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in, out, s)
+}
+
+func autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error {
+ // TODO: Inefficient conversion - can we improve it?
+ if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
+ return err
+ }
+ if err := Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil {
+ return err
+ }
+ out.Timestamp = in.Timestamp
+ out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
+ out.Value = in.Value
+ return nil
+}
+
+// Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue is an autogenerated conversion function.
+func Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error {
+ return autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in, out, s)
+}
+
+func autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
+ // TODO: Inefficient conversion - can we improve it?
+ if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
+ return err
+ }
+ if err := Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil {
+ return err
+ }
+ out.Timestamp = in.Timestamp
+ out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
+ out.Value = in.Value
+ return nil
+}
+
+// Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue is an autogenerated conversion function.
+func Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
+ return autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in, out, s)
+}
+
+func autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]custommetrics.MetricValue)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList is an autogenerated conversion function.
+func Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
+ return autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in, out, s)
+}
+
+func autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]MetricValue)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList is an autogenerated conversion function.
+func Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
+ return autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in, out, s)
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.deepcopy.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..4695362b689
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.deepcopy.go
@@ -0,0 +1,139 @@
+// +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 v1beta2
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/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 *MetricIdentifier) DeepCopyInto(out *MetricIdentifier) {
+ *out = *in
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
+func (in *MetricIdentifier) DeepCopy() *MetricIdentifier {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricIdentifier)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MetricListOptions) DeepCopyInto(out *MetricListOptions) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricListOptions.
+func (in *MetricListOptions) DeepCopy() *MetricListOptions {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricListOptions)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MetricListOptions) 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 *MetricValue) DeepCopyInto(out *MetricValue) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.DescribedObject = in.DescribedObject
+ in.Metric.DeepCopyInto(&out.Metric)
+ in.Timestamp.DeepCopyInto(&out.Timestamp)
+ if in.WindowSeconds != nil {
+ in, out := &in.WindowSeconds, &out.WindowSeconds
+ *out = new(int64)
+ **out = **in
+ }
+ out.Value = in.Value.DeepCopy()
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricValue.
+func (in *MetricValue) DeepCopy() *MetricValue {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricValue)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MetricValue) 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 *MetricValueList) DeepCopyInto(out *MetricValueList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MetricValue, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricValueList.
+func (in *MetricValueList) DeepCopy() *MetricValueList {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricValueList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MetricValueList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/zz_generated.deepcopy.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/zz_generated.deepcopy.go
index 70677ca37fc..0c110bbf519 100644
--- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/zz_generated.deepcopy.go
@@ -21,14 +21,37 @@ limitations under the License.
package custom_metrics
import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/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 *MetricIdentifier) DeepCopyInto(out *MetricIdentifier) {
+ *out = *in
+ if in.Selector != nil {
+ in, out := &in.Selector, &out.Selector
+ *out = new(v1.LabelSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
+func (in *MetricIdentifier) DeepCopy() *MetricIdentifier {
+ if in == nil {
+ return nil
+ }
+ out := new(MetricIdentifier)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricValue) DeepCopyInto(out *MetricValue) {
*out = *in
out.TypeMeta = in.TypeMeta
out.DescribedObject = in.DescribedObject
+ in.Metric.DeepCopyInto(&out.Metric)
in.Timestamp.DeepCopyInto(&out.Timestamp)
if in.WindowSeconds != nil {
in, out := &in.WindowSeconds, &out.WindowSeconds
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/BUILD b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/BUILD
index 5900fd3e26d..262d485c936 100644
--- a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/BUILD
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/BUILD
@@ -1,9 +1,4 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -13,16 +8,16 @@ go_library(
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/client/custom_metrics",
importpath = "k8s.io/metrics/pkg/client/custom_metrics",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/api/meta: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/runtime/serializer:go_default_library",
- "//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library",
- "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme:go_default_library",
],
)
@@ -38,6 +33,8 @@ filegroup(
srcs = [
":package-srcs",
"//staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake:all-srcs",
+ "//staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme:all-srcs",
],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/client.go b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/client.go
index 118eeb2bb96..d399ca059c1 100644
--- a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/client.go
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/client.go
@@ -20,14 +20,13 @@ import (
"fmt"
"k8s.io/apimachinery/pkg/api/meta"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/util/flowcontrol"
- "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
+ "k8s.io/metrics/pkg/client/custom_metrics/scheme"
)
type customMetricsClient struct {
@@ -50,7 +49,7 @@ func NewForConfig(c *rest.Config) (CustomMetricsClient, error) {
if configShallowCopy.UserAgent == "" {
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
}
- configShallowCopy.GroupVersion = &v1beta1.SchemeGroupVersion
+ configShallowCopy.GroupVersion = &v1beta2.SchemeGroupVersion
configShallowCopy.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
client, err := rest.RESTClientFor(&configShallowCopy)
@@ -112,12 +111,15 @@ type rootScopedMetrics struct {
client *customMetricsClient
}
-func (m *rootScopedMetrics) getForNamespace(namespace string, metricName string) (*v1beta1.MetricValue, error) {
- res := &v1beta1.MetricValueList{}
+func (m *rootScopedMetrics) getForNamespace(namespace string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error) {
+ res := &v1beta2.MetricValueList{}
err := m.client.client.Get().
Resource("metrics").
Namespace(namespace).
Name(metricName).
+ VersionedParams(&v1beta2.MetricListOptions{
+ MetricLabelSelector: metricSelector.String(),
+ }, scheme.ParameterCodec).
Do().
Into(res)
@@ -132,10 +134,10 @@ func (m *rootScopedMetrics) getForNamespace(namespace string, metricName string)
return &res.Items[0], nil
}
-func (m *rootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string) (*v1beta1.MetricValue, error) {
+func (m *rootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error) {
// handle namespace separately
if groupKind.Kind == "Namespace" && groupKind.Group == "" {
- return m.getForNamespace(name, metricName)
+ return m.getForNamespace(name, metricName, metricSelector)
}
resourceName, err := m.client.qualResourceForKind(groupKind)
@@ -143,11 +145,14 @@ func (m *rootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string
return nil, err
}
- res := &v1beta1.MetricValueList{}
+ res := &v1beta2.MetricValueList{}
err = m.client.client.Get().
Resource(resourceName).
Name(name).
SubResource(metricName).
+ VersionedParams(&v1beta2.MetricListOptions{
+ MetricLabelSelector: metricSelector.String(),
+ }, scheme.ParameterCodec).
Do().
Into(res)
@@ -162,7 +167,7 @@ func (m *rootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string
return &res.Items[0], nil
}
-func (m *rootScopedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string) (*v1beta1.MetricValueList, error) {
+func (m *rootScopedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValueList, error) {
// we can't wildcard-fetch for namespaces
if groupKind.Kind == "Namespace" && groupKind.Group == "" {
return nil, fmt.Errorf("cannot fetch metrics for multiple namespaces at once")
@@ -173,14 +178,15 @@ func (m *rootScopedMetrics) GetForObjects(groupKind schema.GroupKind, selector l
return nil, err
}
- res := &v1beta1.MetricValueList{}
+ res := &v1beta2.MetricValueList{}
err = m.client.client.Get().
Resource(resourceName).
- Name(v1beta1.AllObjects).
+ Name(v1beta2.AllObjects).
SubResource(metricName).
- VersionedParams(&metav1.ListOptions{
- LabelSelector: selector.String(),
- }, metav1.ParameterCodec).
+ VersionedParams(&v1beta2.MetricListOptions{
+ LabelSelector: selector.String(),
+ MetricLabelSelector: metricSelector.String(),
+ }, scheme.ParameterCodec).
Do().
Into(res)
@@ -196,18 +202,21 @@ type namespacedMetrics struct {
namespace string
}
-func (m *namespacedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string) (*v1beta1.MetricValue, error) {
+func (m *namespacedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error) {
resourceName, err := m.client.qualResourceForKind(groupKind)
if err != nil {
return nil, err
}
- res := &v1beta1.MetricValueList{}
+ res := &v1beta2.MetricValueList{}
err = m.client.client.Get().
Resource(resourceName).
Namespace(m.namespace).
Name(name).
SubResource(metricName).
+ VersionedParams(&v1beta2.MetricListOptions{
+ MetricLabelSelector: metricSelector.String(),
+ }, scheme.ParameterCodec).
Do().
Into(res)
@@ -222,21 +231,22 @@ func (m *namespacedMetrics) GetForObject(groupKind schema.GroupKind, name string
return &res.Items[0], nil
}
-func (m *namespacedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string) (*v1beta1.MetricValueList, error) {
+func (m *namespacedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValueList, error) {
resourceName, err := m.client.qualResourceForKind(groupKind)
if err != nil {
return nil, err
}
- res := &v1beta1.MetricValueList{}
+ res := &v1beta2.MetricValueList{}
err = m.client.client.Get().
Resource(resourceName).
Namespace(m.namespace).
- Name(v1beta1.AllObjects).
+ Name(v1beta2.AllObjects).
SubResource(metricName).
- VersionedParams(&metav1.ListOptions{
- LabelSelector: selector.String(),
- }, metav1.ParameterCodec).
+ VersionedParams(&v1beta2.MetricListOptions{
+ LabelSelector: selector.String(),
+ MetricLabelSelector: metricSelector.String(),
+ }, scheme.ParameterCodec).
Do().
Into(res)
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/BUILD b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/BUILD
index 367816baf90..8e2881e445c 100644
--- a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/BUILD
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/BUILD
@@ -1,21 +1,17 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["fake_client.go"],
importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/client/custom_metrics/fake",
importpath = "k8s.io/metrics/pkg/client/custom_metrics/fake",
+ visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/api/meta: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/client-go/testing:go_default_library",
- "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2:go_default_library",
"//staging/src/k8s.io/metrics/pkg/client/custom_metrics:go_default_library",
],
)
@@ -31,4 +27,5 @@ filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
+ visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/fake_client.go b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/fake_client.go
index c44aa931b01..5870b3598ce 100644
--- a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/fake_client.go
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake/fake_client.go
@@ -23,7 +23,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/testing"
- "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
cmclient "k8s.io/metrics/pkg/client/custom_metrics"
)
@@ -72,7 +72,7 @@ func NewGetForAction(groupKind schema.GroupKind, namespace, name string, metricN
Resource: gvr.Resource,
}
resource := schema.GroupResource{
- Group: v1beta1.SchemeGroupVersion.Group,
+ Group: v1beta2.SchemeGroupVersion.Group,
Resource: groupResourceForKind.String(),
}
return GetForActionImpl{
@@ -91,7 +91,7 @@ func NewRootGetForAction(groupKind schema.GroupKind, name string, metricName str
Resource: gvr.Resource,
}
resource := schema.GroupResource{
- Group: v1beta1.SchemeGroupVersion.Group,
+ Group: v1beta2.SchemeGroupVersion.Group,
Resource: groupResourceForKind.String(),
}
return GetForActionImpl{
@@ -123,15 +123,15 @@ type fakeNamespacedMetrics struct {
ns string
}
-func (m *fakeNamespacedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string) (*v1beta1.MetricValue, error) {
+func (m *fakeNamespacedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error) {
obj, err := m.Fake.
- Invokes(NewGetForAction(groupKind, m.ns, name, metricName, nil), &v1beta1.MetricValueList{})
+ Invokes(NewGetForAction(groupKind, m.ns, name, metricName, nil), &v1beta2.MetricValueList{})
if obj == nil {
return nil, err
}
- objList := obj.(*v1beta1.MetricValueList)
+ objList := obj.(*v1beta2.MetricValueList)
if len(objList.Items) != 1 {
return nil, fmt.Errorf("the custom metrics API server returned %v results when we asked for exactly one", len(objList.Items))
}
@@ -139,30 +139,30 @@ func (m *fakeNamespacedMetrics) GetForObject(groupKind schema.GroupKind, name st
return &objList.Items[0], err
}
-func (m *fakeNamespacedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string) (*v1beta1.MetricValueList, error) {
+func (m *fakeNamespacedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValueList, error) {
obj, err := m.Fake.
- Invokes(NewGetForAction(groupKind, m.ns, "*", metricName, selector), &v1beta1.MetricValueList{})
+ Invokes(NewGetForAction(groupKind, m.ns, "*", metricName, selector), &v1beta2.MetricValueList{})
if obj == nil {
return nil, err
}
- return obj.(*v1beta1.MetricValueList), err
+ return obj.(*v1beta2.MetricValueList), err
}
type fakeRootScopedMetrics struct {
Fake *FakeCustomMetricsClient
}
-func (m *fakeRootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string) (*v1beta1.MetricValue, error) {
+func (m *fakeRootScopedMetrics) GetForObject(groupKind schema.GroupKind, name string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error) {
obj, err := m.Fake.
- Invokes(NewRootGetForAction(groupKind, name, metricName, nil), &v1beta1.MetricValueList{})
+ Invokes(NewRootGetForAction(groupKind, name, metricName, nil), &v1beta2.MetricValueList{})
if obj == nil {
return nil, err
}
- objList := obj.(*v1beta1.MetricValueList)
+ objList := obj.(*v1beta2.MetricValueList)
if len(objList.Items) != 1 {
return nil, fmt.Errorf("the custom metrics API server returned %v results when we asked for exactly one", len(objList.Items))
}
@@ -170,13 +170,13 @@ func (m *fakeRootScopedMetrics) GetForObject(groupKind schema.GroupKind, name st
return &objList.Items[0], err
}
-func (m *fakeRootScopedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string) (*v1beta1.MetricValueList, error) {
+func (m *fakeRootScopedMetrics) GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValueList, error) {
obj, err := m.Fake.
- Invokes(NewRootGetForAction(groupKind, "*", metricName, selector), &v1beta1.MetricValueList{})
+ Invokes(NewRootGetForAction(groupKind, "*", metricName, selector), &v1beta2.MetricValueList{})
if obj == nil {
return nil, err
}
- return obj.(*v1beta1.MetricValueList), err
+ return obj.(*v1beta2.MetricValueList), err
}
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/interfaces.go b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/interfaces.go
index 694e11bb171..9f57643bcda 100644
--- a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/interfaces.go
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/interfaces.go
@@ -19,7 +19,7 @@ package custom_metrics
import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
- "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
)
// CustomMetricsClient is a client for fetching metrics
@@ -45,10 +45,10 @@ type NamespacedMetricsGetter interface {
// MetricsInterface provides access to metrics describing Kubernetes objects.
type MetricsInterface interface {
// GetForObject fetchs the given metric describing the given object.
- GetForObject(groupKind schema.GroupKind, name string, metricName string) (*v1beta1.MetricValue, error)
+ GetForObject(groupKind schema.GroupKind, name string, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValue, error)
// GetForObjects fetches the given metric describing all objects of the given
// type matching the given label selector (or simply all objects of the given type
// if the selector is nil).
- GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string) (*v1beta1.MetricValueList, error)
+ GetForObjects(groupKind schema.GroupKind, selector labels.Selector, metricName string, metricSelector labels.Selector) (*v1beta2.MetricValueList, error)
}
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/BUILD b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/BUILD
new file mode 100644
index 00000000000..42e136a6edb
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/BUILD
@@ -0,0 +1,31 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = ["register.go"],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/client/custom_metrics/scheme",
+ importpath = "k8s.io/metrics/pkg/client/custom_metrics/scheme",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//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",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1:go_default_library",
+ "//staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2: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"],
+)
diff --git a/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go
new file mode 100644
index 00000000000..314415517a5
--- /dev/null
+++ b/staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go
@@ -0,0 +1,54 @@
+/*
+Copyright 2018 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 scheme
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ cmv1beta1 "k8s.io/metrics/pkg/apis/custom_metrics/v1beta1"
+ cmv1beta2 "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2"
+)
+
+var Scheme = runtime.NewScheme()
+var Codecs = serializer.NewCodecFactory(Scheme)
+var ParameterCodec = runtime.NewParameterCodec(Scheme)
+
+func init() {
+ metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
+ AddToScheme(Scheme)
+}
+
+// AddToScheme adds all types of this clientset into the given scheme. This allows composition
+// of clientsets, like in:
+//
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
+//
+// kclientset, _ := kubernetes.NewForConfig(c)
+// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+//
+// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
+// correctly.
+func AddToScheme(scheme *runtime.Scheme) {
+ cmv1beta1.AddToScheme(scheme)
+ cmv1beta2.AddToScheme(scheme)
+}
diff --git a/staging/src/k8s.io/metrics/pkg/client/external_metrics/interfaces.go b/staging/src/k8s.io/metrics/pkg/client/external_metrics/interfaces.go
index 42d66e88f32..d98c161aaf4 100644
--- a/staging/src/k8s.io/metrics/pkg/client/external_metrics/interfaces.go
+++ b/staging/src/k8s.io/metrics/pkg/client/external_metrics/interfaces.go
@@ -34,7 +34,7 @@ type NamespacedMetricsGetter interface {
// MetricsInterface provides access to external metrics.
type MetricsInterface interface {
- // Get fetches the metric for the given namespace that maches the given
+ // List fetches the metric for the given namespace that maches the given
// metricSelector.
List(metricName string, metricSelector labels.Selector) (*v1beta1.ExternalMetricValueList, error)
}
diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
index ddad64ab35e..897e1db4d5e 100644
--- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
+++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
@@ -538,6 +538,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1246,6 +1250,10 @@
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1426,6 +1434,10 @@
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -1530,6 +1542,10 @@
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json
index 41ba144a8e1..db59fa5de5e 100644
--- a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json
+++ b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json
@@ -214,6 +214,10 @@
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/api/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -510,6 +514,10 @@
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -738,6 +746,14 @@
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
+ {
+ "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -918,6 +934,10 @@
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
+ {
+ "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2",
+ "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ },
{
"ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go b/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go
index 0e8fa8de48a..6f586b6219d 100644
--- a/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go
+++ b/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go
@@ -187,7 +187,7 @@ func verifyResponsesFromCustomMetricsAPI(f *framework.Framework, customMetricsCl
if !containsResource(resources.APIResources, "*/custom.googleapis.com|"+UnusedMetricName) {
framework.Failf("Metric '%s' expected but not received", UnusedMetricName)
}
- value, err := customMetricsClient.NamespacedMetrics(f.Namespace.Name).GetForObject(schema.GroupKind{Group: "", Kind: "Pod"}, stackdriverExporterPod1, CustomMetricName)
+ value, err := customMetricsClient.NamespacedMetrics(f.Namespace.Name).GetForObject(schema.GroupKind{Group: "", Kind: "Pod"}, stackdriverExporterPod1, CustomMetricName, labels.NewSelector())
if err != nil {
framework.Failf("Failed query: %s", err)
}
@@ -198,7 +198,7 @@ func verifyResponsesFromCustomMetricsAPI(f *framework.Framework, customMetricsCl
if err != nil {
framework.Failf("Couldn't create a label filter")
}
- values, err := customMetricsClient.NamespacedMetrics(f.Namespace.Name).GetForObjects(schema.GroupKind{Group: "", Kind: "Pod"}, labels.NewSelector().Add(*filter), CustomMetricName)
+ values, err := customMetricsClient.NamespacedMetrics(f.Namespace.Name).GetForObjects(schema.GroupKind{Group: "", Kind: "Pod"}, labels.NewSelector().Add(*filter), CustomMetricName, labels.NewSelector())
if err != nil {
framework.Failf("Failed query: %s", err)
}
diff --git a/test/integration/dryrun/dryrun_test.go b/test/integration/dryrun/dryrun_test.go
index 7b2b512b098..1152068428a 100644
--- a/test/integration/dryrun/dryrun_test.go
+++ b/test/integration/dryrun/dryrun_test.go
@@ -165,6 +165,12 @@ var dryrunData = map[schema.GroupVersionResource]struct {
},
// --
+ // k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2
+ gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"): {
+ stub: `{"metadata": {"name": "hpa3"}, "spec": {"maxReplicas": 3, "scaleTargetRef": {"kind": "something", "name": "cross"}}}`,
+ },
+ // --
+
// k8s.io/kubernetes/pkg/apis/batch/v1
gvr("batch", "v1", "jobs"): {
stub: `{"metadata": {"name": "job1"}, "spec": {"manualSelector": true, "selector": {"matchLabels": {"controller-uid": "uid1"}}, "template": {"metadata": {"labels": {"controller-uid": "uid1"}}, "spec": {"containers": [{"image": "fedora:latest", "name": "container1"}], "dnsPolicy": "ClusterFirst", "restartPolicy": "Never"}}}}`,
diff --git a/test/integration/etcd/etcd_storage_path_test.go b/test/integration/etcd/etcd_storage_path_test.go
index a45a660964e..b32e7989c04 100644
--- a/test/integration/etcd/etcd_storage_path_test.go
+++ b/test/integration/etcd/etcd_storage_path_test.go
@@ -210,6 +210,14 @@ var etcdStorageData = map[schema.GroupVersionResource]struct {
},
// --
+ // k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2
+ gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"): {
+ stub: `{"metadata": {"name": "hpa3"}, "spec": {"maxReplicas": 3, "scaleTargetRef": {"kind": "something", "name": "cross"}}}`,
+ expectedEtcdPath: "/registry/horizontalpodautoscalers/etcdstoragepathtestnamespace/hpa3",
+ expectedGVK: gvkP("autoscaling", "v1", "HorizontalPodAutoscaler"),
+ },
+ // --
+
// k8s.io/kubernetes/pkg/apis/batch/v1
gvr("batch", "v1", "jobs"): {
stub: `{"metadata": {"name": "job1"}, "spec": {"manualSelector": true, "selector": {"matchLabels": {"controller-uid": "uid1"}}, "template": {"metadata": {"labels": {"controller-uid": "uid1"}}, "spec": {"containers": [{"image": "fedora:latest", "name": "container1"}], "dnsPolicy": "ClusterFirst", "restartPolicy": "Never"}}}}`,