diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json
index 05479d04ef8..a6370b5cd43 100644
--- a/api/openapi-spec/swagger.json
+++ b/api/openapi-spec/swagger.json
@@ -36418,6 +36418,589 @@
}
}
},
+ "/apis/storage.k8s.io/v1/": {
+ "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": [
+ "storage_v1"
+ ],
+ "operationId": "getStorageV1APIResources",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ }
+ },
+ "/apis/storage.k8s.io/v1/storageclasses": {
+ "get": {
+ "description": "list or watch objects of kind StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "listStorageV1StorageClass",
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClassList"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "post": {
+ "description": "create a StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "createStorageV1StorageClass",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "delete": {
+ "description": "delete collection of StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "deleteStorageV1CollectionStorageClass",
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/storage.k8s.io/v1/storageclasses/{name}": {
+ "get": {
+ "description": "read the specified StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "readStorageV1StorageClass",
+ "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.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "put": {
+ "description": "replace the specified StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "replaceStorageV1StorageClass",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "delete": {
+ "description": "delete a StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "deleteStorageV1StorageClass",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
+ }
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
+ "name": "gracePeriodSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
+ "name": "orphanDependents",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "Whether and how garbage collection will be performed. Defaults to Default. Either this field or OrphanDependents may be set, but not both.",
+ "name": "propagationPolicy",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "patch": {
+ "description": "partially update the specified StorageClass",
+ "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": [
+ "storage_v1"
+ ],
+ "operationId": "patchStorageV1StorageClass",
+ "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.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the StorageClass",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/storage.k8s.io/v1/watch/storageclasses": {
+ "get": {
+ "description": "watch individual changes to a list of StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "watchStorageV1StorageClassList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
+ "/apis/storage.k8s.io/v1/watch/storageclasses/{name}": {
+ "get": {
+ "description": "watch changes to an object of kind StorageClass",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "storage_v1"
+ ],
+ "operationId": "watchStorageV1StorageClass",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
+ "name": "fieldSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
+ "name": "labelSelector",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the StorageClass",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
+ "name": "resourceVersion",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "integer",
+ "description": "Timeout for the list/watch call.",
+ "name": "timeoutSeconds",
+ "in": "query"
+ },
+ {
+ "uniqueItems": true,
+ "type": "boolean",
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
+ "name": "watch",
+ "in": "query"
+ }
+ ]
+ },
"/apis/storage.k8s.io/v1beta1/": {
"get": {
"description": "get available resources",
@@ -46139,6 +46722,78 @@
}
}
},
+ "io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass": {
+ "description": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
+ "required": [
+ "provisioner"
+ ],
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
+ },
+ "parameters": {
+ "description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "provisioner": {
+ "description": "Provisioner indicates the type of the provisioner.",
+ "type": "string"
+ }
+ },
+ "x-kubernetes-group-version-kind": [
+ {
+ "Group": "storage.k8s.io",
+ "Version": "v1",
+ "Kind": "StorageClass"
+ }
+ ]
+ },
+ "io.k8s.kubernetes.pkg.apis.storage.v1.StorageClassList": {
+ "description": "StorageClassList is a collection of storage classes.",
+ "required": [
+ "items"
+ ],
+ "properties": {
+ "apiVersion": {
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources",
+ "type": "string"
+ },
+ "items": {
+ "description": "Items is the list of StorageClasses",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.storage.v1.StorageClass"
+ }
+ },
+ "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
+ }
+ },
+ "x-kubernetes-group-version-kind": [
+ {
+ "Group": "storage.k8s.io",
+ "Version": "v1",
+ "Kind": "StorageClassList"
+ }
+ ]
+ },
"io.k8s.kubernetes.pkg.apis.storage.v1beta1.StorageClass": {
"description": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
"required": [
diff --git a/api/swagger-spec/resourceListing.json b/api/swagger-spec/resourceListing.json
index 5dd4883febf..761bb44535c 100644
--- a/api/swagger-spec/resourceListing.json
+++ b/api/swagger-spec/resourceListing.json
@@ -117,6 +117,10 @@
"path": "/apis/storage.k8s.io/v1beta1",
"description": "API at /apis/storage.k8s.io/v1beta1"
},
+ {
+ "path": "/apis/storage.k8s.io/v1",
+ "description": "API at /apis/storage.k8s.io/v1"
+ },
{
"path": "/apis/storage.k8s.io",
"description": "get information of a group"
diff --git a/api/swagger-spec/storage.k8s.io_v1.json b/api/swagger-spec/storage.k8s.io_v1.json
new file mode 100644
index 00000000000..871d666ac67
--- /dev/null
+++ b/api/swagger-spec/storage.k8s.io_v1.json
@@ -0,0 +1,1024 @@
+{
+ "swaggerVersion": "1.2",
+ "apiVersion": "storage.k8s.io/v1",
+ "basePath": "https://10.10.10.10:6443",
+ "resourcePath": "/apis/storage.k8s.io/v1",
+ "info": {
+ "title": "",
+ "description": ""
+ },
+ "apis": [
+ {
+ "path": "/apis/storage.k8s.io/v1/storageclasses",
+ "description": "API at /apis/storage.k8s.io/v1",
+ "operations": [
+ {
+ "type": "v1.StorageClassList",
+ "method": "GET",
+ "summary": "list or watch objects of kind StorageClass",
+ "nickname": "listStorageClass",
+ "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": "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.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.StorageClassList"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1.StorageClass",
+ "method": "POST",
+ "summary": "create a StorageClass",
+ "nickname": "createStorageClass",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.StorageClass",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.StorageClass"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1.Status",
+ "method": "DELETE",
+ "summary": "delete collection of StorageClass",
+ "nickname": "deletecollectionStorageClass",
+ "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": "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.",
+ "required": false,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/storage.k8s.io/v1/watch/storageclasses",
+ "description": "API at /apis/storage.k8s.io/v1",
+ "operations": [
+ {
+ "type": "v1.WatchEvent",
+ "method": "GET",
+ "summary": "watch individual changes to a list of StorageClass",
+ "nickname": "watchStorageClassList",
+ "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": "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.",
+ "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/storage.k8s.io/v1/storageclasses/{name}",
+ "description": "API at /apis/storage.k8s.io/v1",
+ "operations": [
+ {
+ "type": "v1.StorageClass",
+ "method": "GET",
+ "summary": "read the specified StorageClass",
+ "nickname": "readStorageClass",
+ "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": "name",
+ "description": "name of the StorageClass",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.StorageClass"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1.StorageClass",
+ "method": "PUT",
+ "summary": "replace the specified StorageClass",
+ "nickname": "replaceStorageClass",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.StorageClass",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the StorageClass",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.StorageClass"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1.StorageClass",
+ "method": "PATCH",
+ "summary": "partially update the specified StorageClass",
+ "nickname": "patchStorageClass",
+ "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": "name",
+ "description": "name of the StorageClass",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.StorageClass"
+ }
+ ],
+ "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 StorageClass",
+ "nickname": "deleteStorageClass",
+ "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. Defaults to Default. Either this field or OrphanDependents may be set, but not both.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the StorageClass",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1.Status"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/apis/storage.k8s.io/v1/watch/storageclasses/{name}",
+ "description": "API at /apis/storage.k8s.io/v1",
+ "operations": [
+ {
+ "type": "v1.WatchEvent",
+ "method": "GET",
+ "summary": "watch changes to an object of kind StorageClass",
+ "nickname": "watchStorageClass",
+ "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": "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.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the StorageClass",
+ "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/storage.k8s.io/v1",
+ "description": "API at /apis/storage.k8s.io/v1",
+ "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": {
+ "v1.StorageClassList": {
+ "id": "v1.StorageClassList",
+ "description": "StorageClassList is a collection of storage classes.",
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ListMeta",
+ "description": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "v1.StorageClass"
+ },
+ "description": "Items is the list of StorageClasses"
+ }
+ }
+ },
+ "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency"
+ }
+ }
+ },
+ "v1.StorageClass": {
+ "id": "v1.StorageClass",
+ "description": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
+ "required": [
+ "provisioner"
+ ],
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ObjectMeta",
+ "description": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata"
+ },
+ "provisioner": {
+ "type": "string",
+ "description": "Provisioner indicates the type of the provisioner."
+ },
+ "parameters": {
+ "type": "object",
+ "description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class."
+ }
+ }
+ },
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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 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: http://releases.k8s.io/HEAD/docs/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."
+ },
+ "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: http://releases.k8s.io/HEAD/docs/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.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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
+ },
+ "metadata": {
+ "$ref": "v1.ListMeta",
+ "description": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
+ },
+ "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."
+ }
+ }
+ },
+ "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\""
+ }
+ }
+ },
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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. Defaults to Default. Either this field or OrphanDependents may be set, but not both."
+ }
+ }
+ },
+ "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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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",
+ "namespaced",
+ "kind",
+ "verbs"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name is the name of the resource."
+ },
+ "namespaced": {
+ "type": "boolean",
+ "description": "namespaced indicates if a resource is namespaced or not."
+ },
+ "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."
+ }
+ }
+ }
+ }
+ }
diff --git a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
index 51414fbdbc2..b0ffbf4f91a 100644
--- a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
+++ b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
@@ -87,6 +87,7 @@ func New() *Generator {
`k8s.io/kubernetes/pkg/apis/imagepolicy/v1alpha1`,
`k8s.io/kubernetes/pkg/apis/settings/v1alpha1`,
`k8s.io/kubernetes/pkg/apis/storage/v1beta1`,
+ `k8s.io/kubernetes/pkg/apis/storage/v1`,
}, ","),
DropEmbeddedFields: "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta",
}
diff --git a/docs/api-reference/storage.k8s.io/v1/definitions.html b/docs/api-reference/storage.k8s.io/v1/definitions.html
new file mode 100755
index 00000000000..a5812c83866
--- /dev/null
+++ b/docs/api-reference/storage.k8s.io/v1/definitions.html
@@ -0,0 +1,1245 @@
+
+
+
+
+
+
+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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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 |
+ |
+
+
+
+
+
+
+
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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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. Defaults to Default. Either this field or OrphanDependents may be set, but not both. |
+false |
+v1.DeletionPropagation |
+ |
+
+
+
+
+
+
+
+
+
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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency |
+false |
+string |
+ |
+
+
+
+
+
+
+
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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+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. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
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.Status
+
+
Status is a return value for calls that don’t return other objects.
+
+
+
+
+
+
+
+
+
+
+
+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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources |
+false |
+string |
+ |
+
+
+metadata |
+Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds |
+false |
+v1.ListMeta |
+ |
+
+
+status |
+Status of the operation. One of: "Success" or "Failure". More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status |
+false |
+string |
+ |
+
+
+message |
+A human-readable description of the status of this operation. |
+false |
+string |
+ |
+
+
+reason |
+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. |
+false |
+string |
+ |
+
+
+details |
+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. |
+false |
+v1.StatusDetails |
+ |
+
+
+code |
+Suggested HTTP return code for this status, 0 if not set. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
v1.WatchEvent
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+type |
+ |
+true |
+string |
+ |
+
+
+object |
+ |
+true |
+string |
+ |
+
+
+
+
+
+
+
v1.StorageClassList
+
+
StorageClassList is a collection of storage classes.
+
+
+
+
+
+
v1.StorageClass
+
+
StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.
+
+
+
StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.
+
+
+
+
+
+
+
+
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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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: http://releases.k8s.io/HEAD/docs/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 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: http://releases.k8s.io/HEAD/docs/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 |
+ |
+
+
+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 |
+ |
+
+
+
+
+
+
+
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: http://releases.k8s.io/HEAD/docs/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 |
+
+
+
+
+
+
+
v1.APIResource
+
+
APIResource specifies the name of a resource and whether it is namespaced.
+
+
+
+
+
+
+
+
+
+
+
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+name |
+name is the name of the resource. |
+true |
+string |
+ |
+
+
+namespaced |
+namespaced indicates if a resource is namespaced or not. |
+true |
+boolean |
+false |
+
+
+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 |
+ |
+
+
+
+
+
+
+
types.UID
+
+
+
+
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 |
+ |
+
+
+
+
+
+
+
v1.DeletionPropagation
+
+
+
+
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/storage.k8s.io/v1/operations.html b/docs/api-reference/storage.k8s.io/v1/operations.html
new file mode 100755
index 00000000000..5cd96a4485f
--- /dev/null
+++ b/docs/api-reference/storage.k8s.io/v1/operations.html
@@ -0,0 +1,1677 @@
+
+
+
+
+
+
+Operations
+
+
+
+
+
+
+
Operations
+
+
+
get available resources
+
+
+
GET /apis/storage.k8s.io/v1
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+default |
+success |
+v1.APIResourceList |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
list or watch objects of kind StorageClass
+
+
+
GET /apis/storage.k8s.io/v1/storageclasses
+
+
+
+
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 |
+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. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
delete collection of StorageClass
+
+
+
DELETE /apis/storage.k8s.io/v1/storageclasses
+
+
+
+
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 |
+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. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.Status |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
create a StorageClass
+
+
+
POST /apis/storage.k8s.io/v1/storageclasses
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.StorageClass |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.StorageClass |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
read the specified StorageClass
+
+
+
GET /apis/storage.k8s.io/v1/storageclasses/{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 |
+name |
+name of the StorageClass |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.StorageClass |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
replace the specified StorageClass
+
+
+
PUT /apis/storage.k8s.io/v1/storageclasses/{name}
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.StorageClass |
+ |
+
+
+PathParameter |
+name |
+name of the StorageClass |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.StorageClass |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
delete a StorageClass
+
+
+
DELETE /apis/storage.k8s.io/v1/storageclasses/{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. Defaults to Default. Either this field or OrphanDependents may be set, but not both. |
+false |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the StorageClass |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.Status |
+
+
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
partially update the specified StorageClass
+
+
+
PATCH /apis/storage.k8s.io/v1/storageclasses/{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 |
+name |
+name of the StorageClass |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.StorageClass |
+
+
+
+
+
+
+
Consumes
+
+
+-
+
application/json-patch+json
+
+-
+
application/merge-patch+json
+
+-
+
application/strategic-merge-patch+json
+
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
watch individual changes to a list of StorageClass
+
+
+
GET /apis/storage.k8s.io/v1/watch/storageclasses
+
+
+
+
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 |
+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. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
watch changes to an object of kind StorageClass
+
+
+
GET /apis/storage.k8s.io/v1/watch/storageclasses/{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 |
+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. |
+false |
+integer (int32) |
+ |
+
+
+PathParameter |
+name |
+name of the StorageClass |
+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
+
+
+
+
+
+
+
+
+-
+
apisstorage.k8s.iov1
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hack/.linted_packages b/hack/.linted_packages
index 8bd58f93057..4289acdb81b 100644
--- a/hack/.linted_packages
+++ b/hack/.linted_packages
@@ -108,6 +108,7 @@ pkg/client/informers/informers_generated/externalversions/rbac/v1beta1
pkg/client/informers/informers_generated/externalversions/settings
pkg/client/informers/informers_generated/externalversions/settings/v1alpha1
pkg/client/informers/informers_generated/externalversions/storage
+pkg/client/informers/informers_generated/externalversions/storage/v1
pkg/client/informers/informers_generated/externalversions/storage/v1beta1
pkg/client/informers/informers_generated/internalversion
pkg/client/informers/informers_generated/internalversion/apps
@@ -161,6 +162,7 @@ pkg/client/listers/rbac/v1beta1
pkg/client/listers/settings/internalversion
pkg/client/listers/settings/v1alpha1
pkg/client/listers/storage/internalversion
+pkg/client/listers/storage/v1
pkg/client/listers/storage/v1beta1
pkg/client/metrics
pkg/client/metrics/prometheus
@@ -345,6 +347,7 @@ staging/src/k8s.io/client-go/informers/rbac/v1beta1
staging/src/k8s.io/client-go/informers/settings
staging/src/k8s.io/client-go/informers/settings/v1alpha1
staging/src/k8s.io/client-go/informers/storage
+staging/src/k8s.io/client-go/informers/storage/v1
staging/src/k8s.io/client-go/informers/storage/v1beta1
staging/src/k8s.io/client-go/listers/apps/v1beta1
staging/src/k8s.io/client-go/listers/autoscaling/v1
@@ -358,6 +361,7 @@ staging/src/k8s.io/client-go/listers/policy/v1beta1
staging/src/k8s.io/client-go/listers/rbac/v1alpha1
staging/src/k8s.io/client-go/listers/rbac/v1beta1
staging/src/k8s.io/client-go/listers/settings/v1alpha1
+staging/src/k8s.io/client-go/listers/storage/v1
staging/src/k8s.io/client-go/listers/storage/v1beta1
staging/src/k8s.io/client-go/plugin/pkg/client/auth
staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp
diff --git a/hack/lib/init.sh b/hack/lib/init.sh
index 812c8682b03..a07f6f2e123 100644
--- a/hack/lib/init.sh
+++ b/hack/lib/init.sh
@@ -70,6 +70,7 @@ rbac.authorization.k8s.io/v1beta1 \
rbac.authorization.k8s.io/v1alpha1 \
settings.k8s.io/v1alpha1 \
storage.k8s.io/v1beta1 \
+storage.k8s.io/v1\
}"
# not all group versions are exposed by the server. This list contains those
diff --git a/hack/make-rules/test-cmd-util.sh b/hack/make-rules/test-cmd-util.sh
index e1b8c78ab66..e7cb8407d9f 100644
--- a/hack/make-rules/test-cmd-util.sh
+++ b/hack/make-rules/test-cmd-util.sh
@@ -3282,7 +3282,7 @@ runTests() {
kubectl create -f - "${kube_flags[@]}" << __EOF__
{
"kind": "StorageClass",
- "apiVersion": "storage.k8s.io/v1beta1",
+ "apiVersion": "storage.k8s.io/v1",
"metadata": {
"name": "storage-class-name"
},
diff --git a/pkg/BUILD b/pkg/BUILD
index 3f3bc758b94..83cd2a523df 100644
--- a/pkg/BUILD
+++ b/pkg/BUILD
@@ -72,6 +72,7 @@ filegroup(
"//pkg/client/listers/settings/internalversion:all-srcs",
"//pkg/client/listers/settings/v1alpha1:all-srcs",
"//pkg/client/listers/storage/internalversion:all-srcs",
+ "//pkg/client/listers/storage/v1:all-srcs",
"//pkg/client/listers/storage/v1beta1:all-srcs",
"//pkg/client/metrics:all-srcs",
"//pkg/client/retry:all-srcs",
diff --git a/pkg/api/helpers.go b/pkg/api/helpers.go
index 970792fc74d..4ada0ba3743 100644
--- a/pkg/api/helpers.go
+++ b/pkg/api/helpers.go
@@ -557,3 +557,42 @@ func PodAnnotationsFromSysctls(sysctls []Sysctl) string {
}
return strings.Join(kvs, ",")
}
+
+// GetPersistentVolumeClass returns StorageClassName.
+func GetPersistentVolumeClass(volume *PersistentVolume) string {
+ // Use beta annotation first
+ if class, found := volume.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ return volume.Spec.StorageClassName
+}
+
+// GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was
+// requested, it returns "".
+func GetPersistentVolumeClaimClass(claim *PersistentVolumeClaim) string {
+ // Use beta annotation first
+ if class, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return *claim.Spec.StorageClassName
+ }
+
+ return ""
+}
+
+// PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.
+func PersistentVolumeClaimHasClass(claim *PersistentVolumeClaim) bool {
+ // Use beta annotation first
+ if _, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return true
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return true
+ }
+
+ return false
+}
diff --git a/pkg/api/types.go b/pkg/api/types.go
index 1fa4558be44..1b910e3e4ac 100644
--- a/pkg/api/types.go
+++ b/pkg/api/types.go
@@ -375,6 +375,12 @@ type PersistentVolumeClaimVolumeSource struct {
ReadOnly bool
}
+const (
+ // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
+ // It's currently still used and will be held for backwards compatibility
+ BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
+)
+
// +genclient=true
// +nonNamespaced=true
diff --git a/pkg/api/v1/helpers.go b/pkg/api/v1/helpers.go
index b6443011628..83495de0b4d 100644
--- a/pkg/api/v1/helpers.go
+++ b/pkg/api/v1/helpers.go
@@ -591,3 +591,42 @@ func GetAffinityFromPodAnnotations(annotations map[string]string) (*Affinity, er
}
return nil, nil
}
+
+// GetPersistentVolumeClass returns StorageClassName.
+func GetPersistentVolumeClass(volume *PersistentVolume) string {
+ // Use beta annotation first
+ if class, found := volume.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ return volume.Spec.StorageClassName
+}
+
+// GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was
+// requested, it returns "".
+func GetPersistentVolumeClaimClass(claim *PersistentVolumeClaim) string {
+ // Use beta annotation first
+ if class, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return *claim.Spec.StorageClassName
+ }
+
+ return ""
+}
+
+// PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.
+func PersistentVolumeClaimHasClass(claim *PersistentVolumeClaim) bool {
+ // Use beta annotation first
+ if _, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return true
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return true
+ }
+
+ return false
+}
diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go
index 64842ed6cd5..2efa564d7ce 100644
--- a/pkg/api/v1/types.go
+++ b/pkg/api/v1/types.go
@@ -421,6 +421,17 @@ type PersistentVolumeSource struct {
PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"`
}
+const (
+ // AlphaStorageClassAnnotation represents the previous alpha storage class
+ // annotation. It's currently still used and will be held for backwards
+ // compatibility
+ AlphaStorageClassAnnotation = "volume.alpha.kubernetes.io/storage-class"
+
+ // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
+ // It's currently still used and will be held for backwards compatibility
+ BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
+)
+
// +genclient=true
// +nonNamespaced=true
diff --git a/pkg/api/validation/BUILD b/pkg/api/validation/BUILD
index 2ae94b46b4b..3ac5a3defeb 100644
--- a/pkg/api/validation/BUILD
+++ b/pkg/api/validation/BUILD
@@ -24,7 +24,6 @@ go_library(
"//pkg/api/service:go_default_library",
"//pkg/api/util:go_default_library",
"//pkg/api/v1:go_default_library",
- "//pkg/apis/storage/util:go_default_library",
"//pkg/capabilities:go_default_library",
"//pkg/features:go_default_library",
"//pkg/security/apparmor:go_default_library",
@@ -99,7 +98,6 @@ go_test(
"//pkg/api/testing:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
- "//pkg/apis/storage/util:go_default_library",
"//pkg/capabilities:go_default_library",
"//pkg/security/apparmor:go_default_library",
"//pkg/volume:go_default_library",
diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go
index 6a525d8b22d..1f4d681f29f 100644
--- a/pkg/api/validation/validation.go
+++ b/pkg/api/validation/validation.go
@@ -44,7 +44,6 @@ import (
utilpod "k8s.io/kubernetes/pkg/api/pod"
apiservice "k8s.io/kubernetes/pkg/api/service"
"k8s.io/kubernetes/pkg/api/v1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/util"
"k8s.io/kubernetes/pkg/capabilities"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/security/apparmor"
@@ -248,6 +247,11 @@ var ValidateEndpointsName = NameIsDNSSubdomain
// ValidateClusterName can be used to check whether the given cluster name is valid.
var ValidateClusterName = genericvalidation.ValidateClusterName
+// ValidateClassName can be used to check whether the given class name is valid.
+// It is defined here to avoid import cycle between pkg/apis/storage/validation
+// (where it should be) and this file.
+var ValidateClassName = NameIsDNSSubdomain
+
// TODO update all references to these functions to point to the genericvalidation ones
// NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain.
func NameIsDNSSubdomain(name string, prefix bool) []string {
@@ -1195,6 +1199,12 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList {
allErrs = append(allErrs, field.Forbidden(specPath.Child("persistentVolumeReclaimPolicy"), "may not be 'recycle' for a hostPath mount of '/'"))
}
+ if len(pv.Spec.StorageClassName) > 0 {
+ for _, msg := range ValidateClassName(pv.Spec.StorageClassName, false) {
+ allErrs = append(allErrs, field.Invalid(specPath.Child("storageClassName"), pv.Spec.StorageClassName, msg))
+ }
+ }
+
return allErrs
}
@@ -1245,6 +1255,12 @@ func ValidatePersistentVolumeClaimSpec(spec *api.PersistentVolumeClaimSpec, fldP
} else {
allErrs = append(allErrs, ValidateResourceQuantityValue(string(api.ResourceStorage), storageValue, fldPath.Child("resources").Key(string(api.ResourceStorage)))...)
}
+
+ if spec.StorageClassName != nil && len(*spec.StorageClassName) > 0 {
+ for _, msg := range ValidateClassName(*spec.StorageClassName, false) {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("storageClassName"), *spec.StorageClassName, msg))
+ }
+ }
return allErrs
}
@@ -1267,7 +1283,8 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *api.PersistentVolumeCla
}
// storageclass annotation should be immutable after creation
- allErrs = append(allErrs, ValidateImmutableAnnotation(newPvc.ObjectMeta.Annotations[storageutil.StorageClassAnnotation], oldPvc.ObjectMeta.Annotations[storageutil.StorageClassAnnotation], storageutil.StorageClassAnnotation, field.NewPath("metadata"))...)
+ // TODO: remove Beta when no longer needed
+ allErrs = append(allErrs, ValidateImmutableAnnotation(newPvc.ObjectMeta.Annotations[v1.BetaStorageClassAnnotation], oldPvc.ObjectMeta.Annotations[v1.BetaStorageClassAnnotation], v1.BetaStorageClassAnnotation, field.NewPath("metadata"))...)
newPvc.Status = oldPvc.Status
return allErrs
diff --git a/pkg/api/validation/validation_test.go b/pkg/api/validation/validation_test.go
index c96c0349f76..6d22077cd1c 100644
--- a/pkg/api/validation/validation_test.go
+++ b/pkg/api/validation/validation_test.go
@@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/service"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/util"
+ "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/capabilities"
"k8s.io/kubernetes/pkg/security/apparmor"
"k8s.io/kubernetes/pkg/volume"
@@ -80,6 +80,7 @@ func TestValidatePersistentVolumes(t *testing.T) {
PersistentVolumeSource: api.PersistentVolumeSource{
HostPath: &api.HostPathVolumeSource{Path: "/foo"},
},
+ StorageClassName: "valid",
}),
},
"good-volume-with-retain-policy": {
@@ -230,6 +231,19 @@ func TestValidatePersistentVolumes(t *testing.T) {
},
}),
},
+ "invalid-storage-class-name": {
+ isExpectedFailure: true,
+ volume: testVolume("invalid-storage-class-name", "", api.PersistentVolumeSpec{
+ Capacity: api.ResourceList{
+ api.ResourceName(api.ResourceStorage): resource.MustParse("10G"),
+ },
+ AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
+ PersistentVolumeSource: api.PersistentVolumeSource{
+ HostPath: &api.HostPathVolumeSource{Path: "/foo"},
+ },
+ StorageClassName: "-invalid-",
+ }),
+ },
}
for name, scenario := range scenarios {
@@ -253,7 +267,7 @@ func testVolumeClaim(name string, namespace string, spec api.PersistentVolumeCla
func testVolumeClaimStorageClass(name string, namespace string, annval string, spec api.PersistentVolumeClaimSpec) *api.PersistentVolumeClaim {
annotations := map[string]string{
- storageutil.StorageClassAnnotation: annval,
+ v1.BetaStorageClassAnnotation: annval,
}
return &api.PersistentVolumeClaim{
@@ -301,6 +315,8 @@ func testVolumeClaimAnnotation(name string, namespace string, ann string, annval
}
func TestValidatePersistentVolumeClaim(t *testing.T) {
+ invalidClassName := "-invalid-"
+ validClassName := "valid"
scenarios := map[string]struct {
isExpectedFailure bool
claim *api.PersistentVolumeClaim
@@ -325,6 +341,7 @@ func TestValidatePersistentVolumeClaim(t *testing.T) {
api.ResourceName(api.ResourceStorage): resource.MustParse("10G"),
},
},
+ StorageClassName: &validClassName,
}),
},
"invalid-label-selector": {
@@ -428,6 +445,29 @@ func TestValidatePersistentVolumeClaim(t *testing.T) {
},
}),
},
+ "invalid-storage-class-name": {
+ isExpectedFailure: true,
+ claim: testVolumeClaim("foo", "ns", api.PersistentVolumeClaimSpec{
+ Selector: &metav1.LabelSelector{
+ MatchExpressions: []metav1.LabelSelectorRequirement{
+ {
+ Key: "key2",
+ Operator: "Exists",
+ },
+ },
+ },
+ AccessModes: []api.PersistentVolumeAccessMode{
+ api.ReadWriteOnce,
+ api.ReadOnlyMany,
+ },
+ Resources: api.ResourceRequirements{
+ Requests: api.ResourceList{
+ api.ResourceName(api.ResourceStorage): resource.MustParse("10G"),
+ },
+ },
+ StorageClassName: &invalidClassName,
+ }),
+ },
}
for name, scenario := range scenarios {
diff --git a/pkg/apis/storage/BUILD b/pkg/apis/storage/BUILD
index fc2be2fc8ae..71ee22cd854 100644
--- a/pkg/apis/storage/BUILD
+++ b/pkg/apis/storage/BUILD
@@ -37,6 +37,7 @@ filegroup(
":package-srcs",
"//pkg/apis/storage/install:all-srcs",
"//pkg/apis/storage/util:all-srcs",
+ "//pkg/apis/storage/v1:all-srcs",
"//pkg/apis/storage/v1beta1:all-srcs",
"//pkg/apis/storage/validation:all-srcs",
],
diff --git a/pkg/apis/storage/install/BUILD b/pkg/apis/storage/install/BUILD
index 45a3189cd93..c9b9ddf9382 100644
--- a/pkg/apis/storage/install/BUILD
+++ b/pkg/apis/storage/install/BUILD
@@ -14,6 +14,7 @@ go_library(
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/storage:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/announced",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/registered",
diff --git a/pkg/apis/storage/install/install.go b/pkg/apis/storage/install/install.go
index 955c7e79dbf..8ba3050dcf9 100644
--- a/pkg/apis/storage/install/install.go
+++ b/pkg/apis/storage/install/install.go
@@ -25,6 +25,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/storage"
+ "k8s.io/kubernetes/pkg/apis/storage/v1"
"k8s.io/kubernetes/pkg/apis/storage/v1beta1"
)
@@ -36,13 +37,15 @@ func init() {
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
- GroupName: storage.GroupName,
- VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version},
+ GroupName: storage.GroupName,
+ // TODO: change the order when GKE supports v1
+ VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version, v1.SchemeGroupVersion.Version},
ImportPrefix: "k8s.io/kubernetes/pkg/apis/storage",
RootScopedKinds: sets.NewString("StorageClass"),
AddInternalObjectsToScheme: storage.AddToScheme,
},
announced.VersionToSchemeFunc{
+ v1.SchemeGroupVersion.Version: v1.AddToScheme,
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
},
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
diff --git a/pkg/apis/storage/util/BUILD b/pkg/apis/storage/util/BUILD
index ae41502e2be..954c9976df9 100644
--- a/pkg/apis/storage/util/BUILD
+++ b/pkg/apis/storage/util/BUILD
@@ -11,10 +11,7 @@ go_library(
name = "go_default_library",
srcs = ["helpers.go"],
tags = ["automanaged"],
- deps = [
- "//pkg/api:go_default_library",
- "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
- ],
+ deps = ["//vendor:k8s.io/apimachinery/pkg/apis/meta/v1"],
)
filegroup(
diff --git a/pkg/apis/storage/util/helpers.go b/pkg/apis/storage/util/helpers.go
index 8df24acbf0a..75caea068c3 100644
--- a/pkg/apis/storage/util/helpers.go
+++ b/pkg/apis/storage/util/helpers.go
@@ -16,10 +16,7 @@ limitations under the License.
package util
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/kubernetes/pkg/api"
-)
+import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
// marks a class as the default StorageClass
@@ -27,87 +24,6 @@ import (
const IsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
-// AlphaStorageClassAnnotation represents the previous alpha storage class
-// annotation. it's no longer used and held here for posterity.
-const AlphaStorageClassAnnotation = "volume.alpha.kubernetes.io/storage-class"
-
-// BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
-// It's currently still used and will be held for backwards compatibility
-const BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
-
-// StorageClassAnnotation represents the storage class associated with a resource.
-// It currently matches the Beta value and can change when official is set.
-// - in PersistentVolumeClaim it represents required class to match.
-// Only PersistentVolumes with the same class (i.e. annotation with the same
-// value) can be bound to the claim. In case no such volume exists, the
-// controller will provision a new one using StorageClass instance with
-// the same name as the annotation value.
-// - in PersistentVolume it represents storage class to which the persistent
-// volume belongs.
-//TODO: Update this to final annotation value as it matches BetaStorageClassAnnotation for now
-const StorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
-
-// GetVolumeStorageClass returns value of StorageClassAnnotation or empty string in case
-// the annotation does not exist.
-// TODO: change to PersistentVolume.Spec.Class value when this attribute is
-// introduced.
-func GetVolumeStorageClass(volume *api.PersistentVolume) string {
- if class, found := volume.Annotations[StorageClassAnnotation]; found {
- return class
- }
-
- // 'nil' is interpreted as "", i.e. the volume does not belong to any class.
- return ""
-}
-
-// GetClaimStorageClass returns name of class that is requested by given claim.
-// Request for `nil` class is interpreted as request for class "",
-// i.e. for a classless PV.
-// TODO: change to PersistentVolumeClaim.Spec.Class value when this
-// attribute is introduced.
-func GetClaimStorageClass(claim *api.PersistentVolumeClaim) string {
- if class, found := claim.Annotations[StorageClassAnnotation]; found {
- return class
- }
-
- return ""
-}
-
-// GetStorageClassAnnotation returns the StorageClass value
-// if the annotation is set, empty string if not
-// TODO: remove Alpha and Beta when no longer used or needed
-func GetStorageClassAnnotation(obj metav1.ObjectMeta) string {
- if class, ok := obj.Annotations[StorageClassAnnotation]; ok {
- return class
- }
- if class, ok := obj.Annotations[BetaStorageClassAnnotation]; ok {
- return class
- }
- if class, ok := obj.Annotations[AlphaStorageClassAnnotation]; ok {
- return class
- }
-
- return ""
-}
-
-// HasStorageClassAnnotation returns a boolean
-// if the annotation is set
-// TODO: remove Alpha and Beta when no longer used or needed
-func HasStorageClassAnnotation(obj metav1.ObjectMeta) bool {
- if _, found := obj.Annotations[StorageClassAnnotation]; found {
- return found
- }
- if _, found := obj.Annotations[BetaStorageClassAnnotation]; found {
- return found
- }
- if _, found := obj.Annotations[AlphaStorageClassAnnotation]; found {
- return found
- }
-
- return false
-
-}
-
// IsDefaultAnnotationText returns a pretty Yes/No String if
// the annotation is set
// TODO: remove Beta when no longer needed
diff --git a/pkg/apis/storage/v1/BUILD b/pkg/apis/storage/v1/BUILD
new file mode 100644
index 00000000000..19527f1d0de
--- /dev/null
+++ b/pkg/apis/storage/v1/BUILD
@@ -0,0 +1,48 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "generated.pb.go",
+ "register.go",
+ "types.go",
+ "types_swagger_doc_generated.go",
+ "zz_generated.conversion.go",
+ "zz_generated.deepcopy.go",
+ "zz_generated.defaults.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//pkg/apis/storage:go_default_library",
+ "//vendor:github.com/gogo/protobuf/proto",
+ "//vendor:github.com/gogo/protobuf/sortkeys",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/conversion",
+ "//vendor:k8s.io/apimachinery/pkg/runtime",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [
+ ":package-srcs",
+ "//pkg/apis/storage/v1/util:all-srcs",
+ ],
+ tags = ["automanaged"],
+)
diff --git a/pkg/apis/storage/v1/doc.go b/pkg/apis/storage/v1/doc.go
new file mode 100644
index 00000000000..32f99daea9a
--- /dev/null
+++ b/pkg/apis/storage/v1/doc.go
@@ -0,0 +1,22 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +k8s:deepcopy-gen=package,register
+// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/storage
+// +groupName=storage.k8s.io
+// +k8s:openapi-gen=true
+// +k8s:defaulter-gen=TypeMeta
+package v1
diff --git a/pkg/apis/storage/v1/generated.pb.go b/pkg/apis/storage/v1/generated.pb.go
new file mode 100644
index 00000000000..3228238b7de
--- /dev/null
+++ b/pkg/apis/storage/v1/generated.pb.go
@@ -0,0 +1,730 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo.
+// source: k8s.io/kubernetes/pkg/apis/storage/v1/generated.proto
+// DO NOT EDIT!
+
+/*
+ Package v1 is a generated protocol buffer package.
+
+ It is generated from these files:
+ k8s.io/kubernetes/pkg/apis/storage/v1/generated.proto
+
+ It has these top-level messages:
+ StorageClass
+ StorageClassList
+*/
+package v1
+
+import proto "github.com/gogo/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+import strings "strings"
+import reflect "reflect"
+import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
+
+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.
+const _ = proto.GoGoProtoPackageIsVersion1
+
+func (m *StorageClass) Reset() { *m = StorageClass{} }
+func (*StorageClass) ProtoMessage() {}
+func (*StorageClass) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
+
+func (m *StorageClassList) Reset() { *m = StorageClassList{} }
+func (*StorageClassList) ProtoMessage() {}
+func (*StorageClassList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
+
+func init() {
+ proto.RegisterType((*StorageClass)(nil), "k8s.io.kubernetes.pkg.apis.storage.v1.StorageClass")
+ proto.RegisterType((*StorageClassList)(nil), "k8s.io.kubernetes.pkg.apis.storage.v1.StorageClassList")
+}
+func (m *StorageClass) 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 *StorageClass) 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()))
+ n1, err := m.ObjectMeta.MarshalTo(data[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n1
+ data[i] = 0x12
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(m.Provisioner)))
+ i += copy(data[i:], m.Provisioner)
+ if len(m.Parameters) > 0 {
+ for k := range m.Parameters {
+ data[i] = 0x1a
+ i++
+ v := m.Parameters[k]
+ mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
+ i = encodeVarintGenerated(data, i, uint64(mapSize))
+ data[i] = 0xa
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(k)))
+ i += copy(data[i:], k)
+ data[i] = 0x12
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(v)))
+ i += copy(data[i:], v)
+ }
+ }
+ return i, nil
+}
+
+func (m *StorageClassList) 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 *StorageClassList) 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()))
+ n2, err := m.ListMeta.MarshalTo(data[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n2
+ 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 *StorageClass) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Provisioner)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Parameters) > 0 {
+ for k, v := range m.Parameters {
+ _ = k
+ _ = v
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
+ n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
+ }
+ }
+ return n
+}
+
+func (m *StorageClassList) 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 *StorageClass) String() string {
+ if this == nil {
+ return "nil"
+ }
+ keysForParameters := make([]string, 0, len(this.Parameters))
+ for k := range this.Parameters {
+ keysForParameters = append(keysForParameters, k)
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForParameters)
+ mapStringForParameters := "map[string]string{"
+ for _, k := range keysForParameters {
+ mapStringForParameters += fmt.Sprintf("%v: %v,", k, this.Parameters[k])
+ }
+ mapStringForParameters += "}"
+ s := strings.Join([]string{`&StorageClass{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`,
+ `Parameters:` + mapStringForParameters + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageClassList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&StorageClassList{`,
+ `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), "StorageClass", "StorageClass", 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 *StorageClass) 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: StorageClass: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageClass: 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 Provisioner", 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.Provisioner = string(data[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Parameters", 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
+ }
+ var keykey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ keykey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ var stringLenmapkey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapkey := int(stringLenmapkey)
+ if intStringLenmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapkey := iNdEx + intStringLenmapkey
+ if postStringIndexmapkey > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapkey := string(data[iNdEx:postStringIndexmapkey])
+ iNdEx = postStringIndexmapkey
+ var valuekey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ valuekey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ var stringLenmapvalue uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapvalue := int(stringLenmapvalue)
+ if intStringLenmapvalue < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue
+ if postStringIndexmapvalue > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapvalue := string(data[iNdEx:postStringIndexmapvalue])
+ iNdEx = postStringIndexmapvalue
+ if m.Parameters == nil {
+ m.Parameters = make(map[string]string)
+ }
+ m.Parameters[mapkey] = mapvalue
+ 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 *StorageClassList) 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: StorageClassList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageClassList: 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, StorageClass{})
+ 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")
+)
+
+var fileDescriptorGenerated = []byte{
+ // 474 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x92, 0x4f, 0x6f, 0xd3, 0x30,
+ 0x18, 0xc6, 0xe3, 0x54, 0x95, 0x36, 0x17, 0x44, 0x15, 0x38, 0x54, 0x3d, 0x64, 0xd5, 0x04, 0x52,
+ 0x2f, 0xd8, 0x74, 0x63, 0x68, 0x42, 0xe2, 0xd2, 0x89, 0x03, 0x12, 0x88, 0x29, 0x5c, 0x10, 0xe2,
+ 0x80, 0xdb, 0xbd, 0xa4, 0x26, 0x4d, 0x1c, 0xd9, 0x6f, 0x02, 0xbd, 0xf1, 0x11, 0xf8, 0x58, 0x15,
+ 0xa7, 0x1d, 0x39, 0x0d, 0x1a, 0xbe, 0x08, 0xca, 0x1f, 0x96, 0x88, 0x6c, 0xa2, 0xda, 0x2d, 0xaf,
+ 0xed, 0xdf, 0xe3, 0xe7, 0x79, 0x1c, 0x7a, 0x14, 0x1c, 0x1b, 0x26, 0x15, 0x0f, 0x92, 0x19, 0xe8,
+ 0x08, 0x10, 0x0c, 0x8f, 0x03, 0x9f, 0x8b, 0x58, 0x1a, 0x6e, 0x50, 0x69, 0xe1, 0x03, 0x4f, 0x27,
+ 0xdc, 0x87, 0x08, 0xb4, 0x40, 0x38, 0x63, 0xb1, 0x56, 0xa8, 0x9c, 0x07, 0x25, 0xc6, 0x6a, 0x8c,
+ 0xc5, 0x81, 0xcf, 0x72, 0x8c, 0x55, 0x18, 0x4b, 0x27, 0xc3, 0x87, 0xbe, 0xc4, 0x45, 0x32, 0x63,
+ 0x73, 0x15, 0x72, 0x5f, 0xf9, 0x8a, 0x17, 0xf4, 0x2c, 0xf9, 0x58, 0x4c, 0xc5, 0x50, 0x7c, 0x95,
+ 0xaa, 0xc3, 0xc7, 0x95, 0x19, 0x11, 0xcb, 0x50, 0xcc, 0x17, 0x32, 0x02, 0xbd, 0xaa, 0xed, 0x84,
+ 0x80, 0xe2, 0x0a, 0x2f, 0x43, 0x7e, 0x1d, 0xa5, 0x93, 0x08, 0x65, 0x08, 0x2d, 0xe0, 0xc9, 0xff,
+ 0x00, 0x33, 0x5f, 0x40, 0x28, 0x5a, 0xdc, 0xe1, 0x75, 0x5c, 0x82, 0x72, 0xc9, 0x65, 0x84, 0x06,
+ 0x75, 0x0b, 0x6a, 0x64, 0x32, 0xa0, 0x53, 0xd0, 0x75, 0x20, 0xf8, 0x22, 0xc2, 0x78, 0x79, 0x55,
+ 0xbf, 0xfb, 0x3f, 0x6d, 0x7a, 0xeb, 0x4d, 0xd9, 0xe3, 0xc9, 0x52, 0x18, 0xe3, 0x7c, 0xa0, 0x3b,
+ 0x79, 0xfe, 0x33, 0x81, 0x62, 0x40, 0x46, 0x64, 0xdc, 0x3b, 0x78, 0xc4, 0xaa, 0x37, 0x68, 0xda,
+ 0xa9, 0x5f, 0x21, 0x3f, 0xcd, 0xd2, 0x09, 0x7b, 0x3d, 0xfb, 0x04, 0x73, 0x7c, 0x05, 0x28, 0xa6,
+ 0xce, 0xfa, 0x62, 0xcf, 0xca, 0x2e, 0xf6, 0x68, 0xbd, 0xe6, 0x5d, 0xaa, 0x3a, 0x47, 0xb4, 0x17,
+ 0x6b, 0x95, 0x4a, 0x23, 0x55, 0x04, 0x7a, 0x60, 0x8f, 0xc8, 0x78, 0x77, 0x7a, 0xb7, 0x42, 0x7a,
+ 0xa7, 0xf5, 0x96, 0xd7, 0x3c, 0xe7, 0x7c, 0xa6, 0x34, 0x16, 0x5a, 0x84, 0x80, 0xa0, 0xcd, 0xa0,
+ 0x33, 0xea, 0x8c, 0x7b, 0x07, 0x27, 0x6c, 0xab, 0xdf, 0x83, 0x35, 0x13, 0xb2, 0xd3, 0x4b, 0x95,
+ 0xe7, 0x11, 0xea, 0x55, 0xed, 0xb6, 0xde, 0xf0, 0x1a, 0x57, 0x0d, 0x9f, 0xd1, 0x3b, 0xff, 0x20,
+ 0x4e, 0x9f, 0x76, 0x02, 0x58, 0x15, 0xfd, 0xec, 0x7a, 0xf9, 0xa7, 0x73, 0x8f, 0x76, 0x53, 0xb1,
+ 0x4c, 0xa0, 0x8c, 0xe3, 0x95, 0xc3, 0x53, 0xfb, 0x98, 0xec, 0x7f, 0x27, 0xb4, 0xdf, 0xbc, 0xff,
+ 0xa5, 0x34, 0xe8, 0xbc, 0x6f, 0xb5, 0xcc, 0xb6, 0x6b, 0x39, 0xa7, 0x8b, 0x8e, 0xfb, 0x95, 0xeb,
+ 0x9d, 0xbf, 0x2b, 0x8d, 0x86, 0xdf, 0xd2, 0xae, 0x44, 0x08, 0xcd, 0xc0, 0x2e, 0x5a, 0x3a, 0xbc,
+ 0x41, 0x4b, 0xd3, 0xdb, 0x95, 0x7e, 0xf7, 0x45, 0xae, 0xe4, 0x95, 0x82, 0xd3, 0xfb, 0xeb, 0x8d,
+ 0x6b, 0x9d, 0x6f, 0x5c, 0xeb, 0xc7, 0xc6, 0xb5, 0xbe, 0x66, 0x2e, 0x59, 0x67, 0x2e, 0x39, 0xcf,
+ 0x5c, 0xf2, 0x2b, 0x73, 0xc9, 0xb7, 0xdf, 0xae, 0xf5, 0xce, 0x4e, 0x27, 0x7f, 0x02, 0x00, 0x00,
+ 0xff, 0xff, 0xe8, 0xe1, 0xb9, 0x93, 0xec, 0x03, 0x00, 0x00,
+}
diff --git a/pkg/apis/storage/v1/generated.proto b/pkg/apis/storage/v1/generated.proto
new file mode 100644
index 00000000000..92e18cf9e96
--- /dev/null
+++ b/pkg/apis/storage/v1/generated.proto
@@ -0,0 +1,63 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = 'proto2';
+
+package k8s.io.kubernetes.pkg.apis.storage.v1;
+
+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";
+import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
+import "k8s.io/apiserver/pkg/apis/example/v1/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "v1";
+
+// StorageClass describes the parameters for a class of storage for
+// which PersistentVolumes can be dynamically provisioned.
+//
+// StorageClasses are non-namespaced; the name of the storage class
+// according to etcd is in ObjectMeta.Name.
+message StorageClass {
+ // Standard object's metadata.
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Provisioner indicates the type of the provisioner.
+ optional string provisioner = 2;
+
+ // Parameters holds the parameters for the provisioner that should
+ // create volumes of this storage class.
+ // +optional
+ map parameters = 3;
+}
+
+// StorageClassList is a collection of storage classes.
+message StorageClassList {
+ // Standard list metadata
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of StorageClasses
+ repeated StorageClass items = 2;
+}
+
diff --git a/pkg/apis/storage/v1/register.go b/pkg/apis/storage/v1/register.go
new file mode 100644
index 00000000000..24d6bfa7d3b
--- /dev/null
+++ b/pkg/apis/storage/v1/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "storage.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to api.Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &StorageClass{},
+ &StorageClassList{},
+ )
+
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/pkg/apis/storage/v1/types.go b/pkg/apis/storage/v1/types.go
new file mode 100644
index 00000000000..25b283b81fc
--- /dev/null
+++ b/pkg/apis/storage/v1/types.go
@@ -0,0 +1,57 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient=true
+// +nonNamespaced=true
+
+// StorageClass describes the parameters for a class of storage for
+// which PersistentVolumes can be dynamically provisioned.
+//
+// StorageClasses are non-namespaced; the name of the storage class
+// according to etcd is in ObjectMeta.Name.
+type StorageClass struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // Provisioner indicates the type of the provisioner.
+ Provisioner string `json:"provisioner"`
+
+ // Parameters holds the parameters for the provisioner that should
+ // create volumes of this storage class.
+ // +optional
+ Parameters map[string]string `json:"parameters,omitempty"`
+}
+
+// StorageClassList is a collection of storage classes.
+type StorageClassList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty"`
+
+ // Items is the list of StorageClasses
+ Items []StorageClass `json:"items"`
+}
diff --git a/pkg/apis/storage/v1/types_swagger_doc_generated.go b/pkg/apis/storage/v1/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..6f271770858
--- /dev/null
+++ b/pkg/apis/storage/v1/types_swagger_doc_generated.go
@@ -0,0 +1,51 @@
+/*
+Copyright 2016 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-generated-swagger-docs.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE
+var map_StorageClass = map[string]string{
+ "": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
+ "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "provisioner": "Provisioner indicates the type of the provisioner.",
+ "parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
+}
+
+func (StorageClass) SwaggerDoc() map[string]string {
+ return map_StorageClass
+}
+
+var map_StorageClassList = map[string]string{
+ "": "StorageClassList is a collection of storage classes.",
+ "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "items": "Items is the list of StorageClasses",
+}
+
+func (StorageClassList) SwaggerDoc() map[string]string {
+ return map_StorageClassList
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/pkg/apis/storage/v1/util/BUILD b/pkg/apis/storage/v1/util/BUILD
new file mode 100644
index 00000000000..954c9976df9
--- /dev/null
+++ b/pkg/apis/storage/v1/util/BUILD
@@ -0,0 +1,28 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = ["helpers.go"],
+ tags = ["automanaged"],
+ deps = ["//vendor:k8s.io/apimachinery/pkg/apis/meta/v1"],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+)
diff --git a/pkg/apis/storage/v1/util/helpers.go b/pkg/apis/storage/v1/util/helpers.go
new file mode 100644
index 00000000000..75caea068c3
--- /dev/null
+++ b/pkg/apis/storage/v1/util/helpers.go
@@ -0,0 +1,53 @@
+/*
+Copyright 2016 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 util
+
+import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
+// marks a class as the default StorageClass
+//TODO: Update IsDefaultStorageClassannotation and remove Beta when no longer used
+const IsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
+const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
+
+// IsDefaultAnnotationText returns a pretty Yes/No String if
+// the annotation is set
+// TODO: remove Beta when no longer needed
+func IsDefaultAnnotationText(obj metav1.ObjectMeta) string {
+ if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
+ return "Yes"
+ }
+ if obj.Annotations[BetaIsDefaultStorageClassAnnotation] == "true" {
+ return "Yes"
+ }
+
+ return "No"
+}
+
+// IsDefaultAnnotation returns a boolean if
+// the annotation is set
+// TODO: remove Beta when no longer needed
+func IsDefaultAnnotation(obj metav1.ObjectMeta) bool {
+ if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
+ return true
+ }
+ if obj.Annotations[BetaIsDefaultStorageClassAnnotation] == "true" {
+ return true
+ }
+
+ return false
+}
diff --git a/pkg/apis/storage/v1/zz_generated.conversion.go b/pkg/apis/storage/v1/zz_generated.conversion.go
new file mode 100644
index 00000000000..724b4e74f3d
--- /dev/null
+++ b/pkg/apis/storage/v1/zz_generated.conversion.go
@@ -0,0 +1,85 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by conversion-gen. Do not edit it manually!
+
+package v1
+
+import (
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ storage "k8s.io/kubernetes/pkg/apis/storage"
+ unsafe "unsafe"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedConversionFuncs(
+ Convert_v1_StorageClass_To_storage_StorageClass,
+ Convert_storage_StorageClass_To_v1_StorageClass,
+ Convert_v1_StorageClassList_To_storage_StorageClassList,
+ Convert_storage_StorageClassList_To_v1_StorageClassList,
+ )
+}
+
+func autoConvert_v1_StorageClass_To_storage_StorageClass(in *StorageClass, out *storage.StorageClass, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Provisioner = in.Provisioner
+ out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
+ return nil
+}
+
+func Convert_v1_StorageClass_To_storage_StorageClass(in *StorageClass, out *storage.StorageClass, s conversion.Scope) error {
+ return autoConvert_v1_StorageClass_To_storage_StorageClass(in, out, s)
+}
+
+func autoConvert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClass, out *StorageClass, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Provisioner = in.Provisioner
+ out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
+ return nil
+}
+
+func Convert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClass, out *StorageClass, s conversion.Scope) error {
+ return autoConvert_storage_StorageClass_To_v1_StorageClass(in, out, s)
+}
+
+func autoConvert_v1_StorageClassList_To_storage_StorageClassList(in *StorageClassList, out *storage.StorageClassList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]storage.StorageClass)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+func Convert_v1_StorageClassList_To_storage_StorageClassList(in *StorageClassList, out *storage.StorageClassList, s conversion.Scope) error {
+ return autoConvert_v1_StorageClassList_To_storage_StorageClassList(in, out, s)
+}
+
+func autoConvert_storage_StorageClassList_To_v1_StorageClassList(in *storage.StorageClassList, out *StorageClassList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]StorageClass)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+func Convert_storage_StorageClassList_To_v1_StorageClassList(in *storage.StorageClassList, out *StorageClassList, s conversion.Scope) error {
+ return autoConvert_storage_StorageClassList_To_v1_StorageClassList(in, out, s)
+}
diff --git a/pkg/apis/storage/v1/zz_generated.deepcopy.go b/pkg/apis/storage/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..8b3786ab194
--- /dev/null
+++ b/pkg/apis/storage/v1/zz_generated.deepcopy.go
@@ -0,0 +1,80 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by deepcopy-gen. Do not edit it manually!
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ reflect "reflect"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterDeepCopies)
+}
+
+// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
+// to allow building arbitrary schemes.
+func RegisterDeepCopies(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedDeepCopyFuncs(
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_StorageClass, InType: reflect.TypeOf(&StorageClass{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_StorageClassList, InType: reflect.TypeOf(&StorageClassList{})},
+ )
+}
+
+func DeepCopy_v1_StorageClass(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*StorageClass)
+ out := out.(*StorageClass)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
+ return err
+ } else {
+ out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
+ }
+ if in.Parameters != nil {
+ in, out := &in.Parameters, &out.Parameters
+ *out = make(map[string]string)
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
+ return nil
+ }
+}
+
+func DeepCopy_v1_StorageClassList(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*StorageClassList)
+ out := out.(*StorageClassList)
+ *out = *in
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]StorageClass, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_StorageClass(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
diff --git a/pkg/apis/storage/v1/zz_generated.defaults.go b/pkg/apis/storage/v1/zz_generated.defaults.go
new file mode 100644
index 00000000000..6df448eb9fd
--- /dev/null
+++ b/pkg/apis/storage/v1/zz_generated.defaults.go
@@ -0,0 +1,32 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by defaulter-gen. Do not edit it manually!
+
+package v1
+
+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/storage/v1beta1/util/BUILD b/pkg/apis/storage/v1beta1/util/BUILD
index 3d639390135..954c9976df9 100644
--- a/pkg/apis/storage/v1beta1/util/BUILD
+++ b/pkg/apis/storage/v1beta1/util/BUILD
@@ -11,10 +11,7 @@ go_library(
name = "go_default_library",
srcs = ["helpers.go"],
tags = ["automanaged"],
- deps = [
- "//pkg/api/v1:go_default_library",
- "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
- ],
+ deps = ["//vendor:k8s.io/apimachinery/pkg/apis/meta/v1"],
)
filegroup(
diff --git a/pkg/apis/storage/v1beta1/util/helpers.go b/pkg/apis/storage/v1beta1/util/helpers.go
index 39c4f6f3ed5..75caea068c3 100644
--- a/pkg/apis/storage/v1beta1/util/helpers.go
+++ b/pkg/apis/storage/v1beta1/util/helpers.go
@@ -16,10 +16,7 @@ limitations under the License.
package util
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/kubernetes/pkg/api/v1"
-)
+import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
// marks a class as the default StorageClass
@@ -27,87 +24,6 @@ import (
const IsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
-// AlphaStorageClassAnnotation represents the previous alpha storage class
-// annotation. it's no longer used and held here for posterity.
-const AlphaStorageClassAnnotation = "volume.alpha.kubernetes.io/storage-class"
-
-// BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
-// It's currently still used and will be held for backwards compatibility
-const BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
-
-// StorageClassAnnotation represents the storage class associated with a resource.
-// It currently matches the Beta value and can change when official is set.
-// - in PersistentVolumeClaim it represents required class to match.
-// Only PersistentVolumes with the same class (i.e. annotation with the same
-// value) can be bound to the claim. In case no such volume exists, the
-// controller will provision a new one using StorageClass instance with
-// the same name as the annotation value.
-// - in PersistentVolume it represents storage class to which the persistent
-// volume belongs.
-//TODO: Update this to final annotation value as it matches BetaStorageClassAnnotation for now
-const StorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
-
-// GetVolumeStorageClass returns value of StorageClassAnnotation or empty string in case
-// the annotation does not exist.
-// TODO: change to PersistentVolume.Spec.Class value when this attribute is
-// introduced.
-func GetVolumeStorageClass(volume *v1.PersistentVolume) string {
- if class, found := volume.Annotations[StorageClassAnnotation]; found {
- return class
- }
-
- // 'nil' is interpreted as "", i.e. the volume does not belong to any class.
- return ""
-}
-
-// GetClaimStorageClass returns name of class that is requested by given claim.
-// Request for `nil` class is interpreted as request for class "",
-// i.e. for a classless PV.
-// TODO: change to PersistentVolumeClaim.Spec.Class value when this
-// attribute is introduced.
-func GetClaimStorageClass(claim *v1.PersistentVolumeClaim) string {
- if class, found := claim.Annotations[StorageClassAnnotation]; found {
- return class
- }
-
- return ""
-}
-
-// GetStorageClassAnnotation returns the StorageClass value
-// if the annotation is set, empty string if not
-// TODO: remove Alpha and Beta when no longer used or needed
-func GetStorageClassAnnotation(obj metav1.ObjectMeta) string {
- if class, ok := obj.Annotations[StorageClassAnnotation]; ok {
- return class
- }
- if class, ok := obj.Annotations[BetaStorageClassAnnotation]; ok {
- return class
- }
- if class, ok := obj.Annotations[AlphaStorageClassAnnotation]; ok {
- return class
- }
-
- return ""
-}
-
-// HasStorageClassAnnotation returns a boolean
-// if the annotation is set
-// TODO: remove Alpha and Beta when no longer used or needed
-func HasStorageClassAnnotation(obj metav1.ObjectMeta) bool {
- if _, found := obj.Annotations[StorageClassAnnotation]; found {
- return found
- }
- if _, found := obj.Annotations[BetaStorageClassAnnotation]; found {
- return found
- }
- if _, found := obj.Annotations[AlphaStorageClassAnnotation]; found {
- return found
- }
-
- return false
-
-}
-
// IsDefaultAnnotationText returns a pretty Yes/No String if
// the annotation is set
// TODO: remove Beta when no longer needed
diff --git a/pkg/apis/storage/validation/validation.go b/pkg/apis/storage/validation/validation.go
index 117ec7427bd..d72288f9784 100644
--- a/pkg/apis/storage/validation/validation.go
+++ b/pkg/apis/storage/validation/validation.go
@@ -28,7 +28,7 @@ import (
// ValidateStorageClass validates a StorageClass.
func ValidateStorageClass(storageClass *storage.StorageClass) field.ErrorList {
- allErrs := apivalidation.ValidateObjectMeta(&storageClass.ObjectMeta, false, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
+ allErrs := apivalidation.ValidateObjectMeta(&storageClass.ObjectMeta, false, apivalidation.ValidateClassName, field.NewPath("metadata"))
allErrs = append(allErrs, validateProvisioner(storageClass.Provisioner, field.NewPath("provisioner"))...)
allErrs = append(allErrs, validateParameters(storageClass.Parameters, field.NewPath("parameters"))...)
diff --git a/pkg/client/clientset_generated/clientset/BUILD b/pkg/client/clientset_generated/clientset/BUILD
index f95631c030a..39cc0ffb1b1 100644
--- a/pkg/client/clientset_generated/clientset/BUILD
+++ b/pkg/client/clientset_generated/clientset/BUILD
@@ -45,6 +45,7 @@ go_library(
"//pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:go_default_library",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/client-go/discovery",
@@ -82,6 +83,7 @@ filegroup(
"//pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1:all-srcs",
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1:all-srcs",
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:all-srcs",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1:all-srcs",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:all-srcs",
],
tags = ["automanaged"],
diff --git a/pkg/client/clientset_generated/clientset/clientset.go b/pkg/client/clientset_generated/clientset/clientset.go
index 88a44feff05..88df7ab770d 100644
--- a/pkg/client/clientset_generated/clientset/clientset.go
+++ b/pkg/client/clientset_generated/clientset/clientset.go
@@ -37,6 +37,7 @@ import (
rbacv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1"
rbacv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1"
settingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1"
+ storagev1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1"
storagev1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1"
)
@@ -81,8 +82,9 @@ type Interface interface {
// Deprecated: please explicitly pick a version if possible.
Settings() settingsv1alpha1.SettingsV1alpha1Interface
StorageV1beta1() storagev1beta1.StorageV1beta1Interface
+ StorageV1() storagev1.StorageV1Interface
// Deprecated: please explicitly pick a version if possible.
- Storage() storagev1beta1.StorageV1beta1Interface
+ Storage() storagev1.StorageV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@@ -106,6 +108,7 @@ type Clientset struct {
*rbacv1alpha1.RbacV1alpha1Client
*settingsv1alpha1.SettingsV1alpha1Client
*storagev1beta1.StorageV1beta1Client
+ *storagev1.StorageV1Client
}
// CoreV1 retrieves the CoreV1Client
@@ -343,13 +346,21 @@ func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface {
return c.StorageV1beta1Client
}
-// Deprecated: Storage retrieves the default version of StorageClient.
-// Please explicitly pick a version.
-func (c *Clientset) Storage() storagev1beta1.StorageV1beta1Interface {
+// StorageV1 retrieves the StorageV1Client
+func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
if c == nil {
return nil
}
- return c.StorageV1beta1Client
+ return c.StorageV1Client
+}
+
+// Deprecated: Storage retrieves the default version of StorageClient.
+// Please explicitly pick a version.
+func (c *Clientset) Storage() storagev1.StorageV1Interface {
+ if c == nil {
+ return nil
+ }
+ return c.StorageV1Client
}
// Discovery retrieves the DiscoveryClient
@@ -436,6 +447,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
+ cs.StorageV1Client, err = storagev1.NewForConfig(&configShallowCopy)
+ if err != nil {
+ return nil, err
+ }
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
@@ -466,6 +481,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.RbacV1alpha1Client = rbacv1alpha1.NewForConfigOrDie(c)
cs.SettingsV1alpha1Client = settingsv1alpha1.NewForConfigOrDie(c)
cs.StorageV1beta1Client = storagev1beta1.NewForConfigOrDie(c)
+ cs.StorageV1Client = storagev1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@@ -491,6 +507,7 @@ func New(c rest.Interface) *Clientset {
cs.RbacV1alpha1Client = rbacv1alpha1.New(c)
cs.SettingsV1alpha1Client = settingsv1alpha1.New(c)
cs.StorageV1beta1Client = storagev1beta1.New(c)
+ cs.StorageV1Client = storagev1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
diff --git a/pkg/client/clientset_generated/clientset/fake/BUILD b/pkg/client/clientset_generated/clientset/fake/BUILD
index f8bf3c20b49..a51aabd76dd 100644
--- a/pkg/client/clientset_generated/clientset/fake/BUILD
+++ b/pkg/client/clientset_generated/clientset/fake/BUILD
@@ -61,6 +61,8 @@ go_library(
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/settings/v1alpha1/fake:go_default_library",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1:go_default_library",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1/fake:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1/fake:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/announced",
diff --git a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go
index afa7f7c58d3..55e819bff64 100644
--- a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go
+++ b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go
@@ -55,6 +55,8 @@ import (
fakerbacv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake"
settingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1"
fakesettingsv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/settings/v1alpha1/fake"
+ storagev1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1"
+ fakestoragev1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1/fake"
storagev1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1"
fakestoragev1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1/fake"
)
@@ -232,7 +234,12 @@ func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface {
return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake}
}
-// Storage retrieves the StorageV1beta1Client
-func (c *Clientset) Storage() storagev1beta1.StorageV1beta1Interface {
- return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake}
+// StorageV1 retrieves the StorageV1Client
+func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
+ return &fakestoragev1.FakeStorageV1{Fake: &c.Fake}
+}
+
+// Storage retrieves the StorageV1Client
+func (c *Clientset) Storage() storagev1.StorageV1Interface {
+ return &fakestoragev1.FakeStorageV1{Fake: &c.Fake}
}
diff --git a/pkg/client/clientset_generated/clientset/scheme/BUILD b/pkg/client/clientset_generated/clientset/scheme/BUILD
index 25accf27cf0..aa2be384b20 100644
--- a/pkg/client/clientset_generated/clientset/scheme/BUILD
+++ b/pkg/client/clientset_generated/clientset/scheme/BUILD
@@ -31,6 +31,7 @@ go_library(
"//pkg/apis/rbac/v1alpha1:go_default_library",
"//pkg/apis/rbac/v1beta1:go_default_library",
"//pkg/apis/settings/v1alpha1:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
diff --git a/pkg/client/clientset_generated/clientset/scheme/register.go b/pkg/client/clientset_generated/clientset/scheme/register.go
index 409abe6b0a0..813426e9152 100644
--- a/pkg/client/clientset_generated/clientset/scheme/register.go
+++ b/pkg/client/clientset_generated/clientset/scheme/register.go
@@ -37,6 +37,7 @@ import (
rbacv1alpha1 "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1"
rbacv1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
settingsv1alpha1 "k8s.io/kubernetes/pkg/apis/settings/v1alpha1"
+ storagev1 "k8s.io/kubernetes/pkg/apis/storage/v1"
storagev1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
)
@@ -81,5 +82,6 @@ func AddToScheme(scheme *runtime.Scheme) {
rbacv1alpha1.AddToScheme(scheme)
settingsv1alpha1.AddToScheme(scheme)
storagev1beta1.AddToScheme(scheme)
+ storagev1.AddToScheme(scheme)
}
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/BUILD b/pkg/client/clientset_generated/clientset/typed/storage/v1/BUILD
new file mode 100644
index 00000000000..290a7731c40
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/BUILD
@@ -0,0 +1,44 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "generated_expansion.go",
+ "storage_client.go",
+ "storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//pkg/apis/storage/v1:go_default_library",
+ "//pkg/client/clientset_generated/clientset/scheme:go_default_library",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/serializer",
+ "//vendor:k8s.io/apimachinery/pkg/types",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/rest",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [
+ ":package-srcs",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1/fake:all-srcs",
+ ],
+ tags = ["automanaged"],
+)
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/doc.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/doc.go
new file mode 100644
index 00000000000..54673bfa738
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This package is generated by client-gen with custom arguments.
+
+// This package has the automatically generated typed clients.
+package v1
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/BUILD b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/BUILD
new file mode 100644
index 00000000000..1a5b93d1fd7
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/BUILD
@@ -0,0 +1,42 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "fake_storage_client.go",
+ "fake_storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//pkg/apis/storage/v1:go_default_library",
+ "//pkg/client/clientset_generated/clientset/typed/storage/v1:go_default_library",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/labels",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
+ "//vendor:k8s.io/apimachinery/pkg/types",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/rest",
+ "//vendor:k8s.io/client-go/testing",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+)
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/doc.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/doc.go
new file mode 100644
index 00000000000..c6548330a0d
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This package is generated by client-gen with custom arguments.
+
+// Package fake has the automatically generated clients.
+package fake
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storage_client.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storage_client.go
new file mode 100644
index 00000000000..b159c7f4769
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storage_client.go
@@ -0,0 +1,38 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package fake
+
+import (
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+ v1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1"
+)
+
+type FakeStorageV1 struct {
+ *testing.Fake
+}
+
+func (c *FakeStorageV1) StorageClasses() v1.StorageClassInterface {
+ return &FakeStorageClasses{c}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeStorageV1) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storageclass.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storageclass.go
new file mode 100644
index 00000000000..89eee2e0008
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/fake/fake_storageclass.go
@@ -0,0 +1,110 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package fake
+
+import (
+ meta_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"
+ v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
+)
+
+// FakeStorageClasses implements StorageClassInterface
+type FakeStorageClasses struct {
+ Fake *FakeStorageV1
+}
+
+var storageclassesResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "storageclasses"}
+
+func (c *FakeStorageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) Delete(name string, options *meta_v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewRootDeleteAction(storageclassesResource, name), &v1.StorageClass{})
+ return err
+}
+
+func (c *FakeStorageClasses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
+ action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v1.StorageClassList{})
+ return err
+}
+
+func (c *FakeStorageClasses) Get(name string, options meta_v1.GetOptions) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootGetAction(storageclassesResource, name), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) List(opts meta_v1.ListOptions) (result *v1.StorageClassList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootListAction(storageclassesResource, opts), &v1.StorageClassList{})
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1.StorageClassList{}
+ for _, item := range obj.(*v1.StorageClassList).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 storageClasses.
+func (c *FakeStorageClasses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewRootWatchAction(storageclassesResource, opts))
+}
+
+// Patch applies the patch and returns the patched storageClass.
+func (c *FakeStorageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, data, subresources...), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/generated_expansion.go
new file mode 100644
index 00000000000..39df9fb8791
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/generated_expansion.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+type StorageClassExpansion interface{}
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/storage_client.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/storage_client.go
new file mode 100644
index 00000000000..5d37d8417c2
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/storage_client.go
@@ -0,0 +1,88 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ rest "k8s.io/client-go/rest"
+ v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
+ "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme"
+)
+
+type StorageV1Interface interface {
+ RESTClient() rest.Interface
+ StorageClassesGetter
+}
+
+// StorageV1Client is used to interact with features provided by the storage.k8s.io group.
+type StorageV1Client struct {
+ restClient rest.Interface
+}
+
+func (c *StorageV1Client) StorageClasses() StorageClassInterface {
+ return newStorageClasses(c)
+}
+
+// NewForConfig creates a new StorageV1Client for the given config.
+func NewForConfig(c *rest.Config) (*StorageV1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return &StorageV1Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new StorageV1Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *StorageV1Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new StorageV1Client for the given RESTClient.
+func New(c rest.Interface) *StorageV1Client {
+ return &StorageV1Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v1.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 *StorageV1Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git a/pkg/client/clientset_generated/clientset/typed/storage/v1/storageclass.go b/pkg/client/clientset_generated/clientset/typed/storage/v1/storageclass.go
new file mode 100644
index 00000000000..3a1efa01633
--- /dev/null
+++ b/pkg/client/clientset_generated/clientset/typed/storage/v1/storageclass.go
@@ -0,0 +1,145 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ rest "k8s.io/client-go/rest"
+ v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
+ scheme "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme"
+)
+
+// StorageClassesGetter has a method to return a StorageClassInterface.
+// A group's client should implement this interface.
+type StorageClassesGetter interface {
+ StorageClasses() StorageClassInterface
+}
+
+// StorageClassInterface has methods to work with StorageClass resources.
+type StorageClassInterface interface {
+ Create(*v1.StorageClass) (*v1.StorageClass, error)
+ Update(*v1.StorageClass) (*v1.StorageClass, error)
+ Delete(name string, options *meta_v1.DeleteOptions) error
+ DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
+ Get(name string, options meta_v1.GetOptions) (*v1.StorageClass, error)
+ List(opts meta_v1.ListOptions) (*v1.StorageClassList, error)
+ Watch(opts meta_v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error)
+ StorageClassExpansion
+}
+
+// storageClasses implements StorageClassInterface
+type storageClasses struct {
+ client rest.Interface
+}
+
+// newStorageClasses returns a StorageClasses
+func newStorageClasses(c *StorageV1Client) *storageClasses {
+ return &storageClasses{
+ client: c.RESTClient(),
+ }
+}
+
+// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any.
+func (c *storageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Post().
+ Resource("storageclasses").
+ Body(storageClass).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any.
+func (c *storageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Put().
+ Resource("storageclasses").
+ Name(storageClass.Name).
+ Body(storageClass).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the storageClass and deletes it. Returns an error if one occurs.
+func (c *storageClasses) Delete(name string, options *meta_v1.DeleteOptions) error {
+ return c.client.Delete().
+ Resource("storageclasses").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *storageClasses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
+ return c.client.Delete().
+ Resource("storageclasses").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any.
+func (c *storageClasses) Get(name string, options meta_v1.GetOptions) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Get().
+ Resource("storageclasses").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of StorageClasses that match those selectors.
+func (c *storageClasses) List(opts meta_v1.ListOptions) (result *v1.StorageClassList, err error) {
+ result = &v1.StorageClassList{}
+ err = c.client.Get().
+ Resource("storageclasses").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested storageClasses.
+func (c *storageClasses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Resource("storageclasses").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Patch applies the patch and returns the patched storageClass.
+func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Patch(pt).
+ Resource("storageclasses").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/client/informers/informers_generated/externalversions/BUILD b/pkg/client/informers/informers_generated/externalversions/BUILD
index 93d3e56077a..bc2805c39de 100644
--- a/pkg/client/informers/informers_generated/externalversions/BUILD
+++ b/pkg/client/informers/informers_generated/externalversions/BUILD
@@ -27,6 +27,7 @@ go_library(
"//pkg/apis/rbac/v1alpha1:go_default_library",
"//pkg/apis/rbac/v1beta1:go_default_library",
"//pkg/apis/settings/v1alpha1:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/informers/informers_generated/externalversions/apps:go_default_library",
diff --git a/pkg/client/informers/informers_generated/externalversions/generic.go b/pkg/client/informers/informers_generated/externalversions/generic.go
index c3892299bc3..edabbadfada 100644
--- a/pkg/client/informers/informers_generated/externalversions/generic.go
+++ b/pkg/client/informers/informers_generated/externalversions/generic.go
@@ -34,6 +34,7 @@ import (
v1alpha1 "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1"
rbac_v1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
settings_v1alpha1 "k8s.io/kubernetes/pkg/apis/settings/v1alpha1"
+ storage_v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
storage_v1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
)
@@ -167,6 +168,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case settings_v1alpha1.SchemeGroupVersion.WithResource("podpresets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil
+ // Group=Storage, Version=V1
+ case storage_v1.SchemeGroupVersion.WithResource("storageclasses"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil
+
// Group=Storage, Version=V1beta1
case storage_v1beta1.SchemeGroupVersion.WithResource("storageclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil
diff --git a/pkg/client/informers/informers_generated/externalversions/storage/BUILD b/pkg/client/informers/informers_generated/externalversions/storage/BUILD
index abeaabf5e6e..981d33744ff 100644
--- a/pkg/client/informers/informers_generated/externalversions/storage/BUILD
+++ b/pkg/client/informers/informers_generated/externalversions/storage/BUILD
@@ -13,6 +13,7 @@ go_library(
tags = ["automanaged"],
deps = [
"//pkg/client/informers/informers_generated/externalversions/internalinterfaces:go_default_library",
+ "//pkg/client/informers/informers_generated/externalversions/storage/v1:go_default_library",
"//pkg/client/informers/informers_generated/externalversions/storage/v1beta1:go_default_library",
],
)
@@ -28,6 +29,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
+ "//pkg/client/informers/informers_generated/externalversions/storage/v1:all-srcs",
"//pkg/client/informers/informers_generated/externalversions/storage/v1beta1:all-srcs",
],
tags = ["automanaged"],
diff --git a/pkg/client/informers/informers_generated/externalversions/storage/interface.go b/pkg/client/informers/informers_generated/externalversions/storage/interface.go
index 1d538d1e102..96e8eae8c67 100644
--- a/pkg/client/informers/informers_generated/externalversions/storage/interface.go
+++ b/pkg/client/informers/informers_generated/externalversions/storage/interface.go
@@ -20,11 +20,14 @@ package storage
import (
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
+ v1 "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/storage/v1"
v1beta1 "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/storage/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
+ // V1 provides access to shared informers for resources in V1.
+ V1() v1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
}
@@ -38,6 +41,11 @@ func New(f internalinterfaces.SharedInformerFactory) Interface {
return &group{f}
}
+// V1 returns a new v1.Interface.
+func (g *group) V1() v1.Interface {
+ return v1.New(g.SharedInformerFactory)
+}
+
// V1beta1 returns a new v1beta1.Interface.
func (g *group) V1beta1() v1beta1.Interface {
return v1beta1.New(g.SharedInformerFactory)
diff --git a/pkg/client/informers/informers_generated/externalversions/storage/v1/BUILD b/pkg/client/informers/informers_generated/externalversions/storage/v1/BUILD
new file mode 100644
index 00000000000..8a3e126fb0b
--- /dev/null
+++ b/pkg/client/informers/informers_generated/externalversions/storage/v1/BUILD
@@ -0,0 +1,40 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "interface.go",
+ "storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//pkg/apis/storage/v1:go_default_library",
+ "//pkg/client/clientset_generated/clientset:go_default_library",
+ "//pkg/client/informers/informers_generated/externalversions/internalinterfaces:go_default_library",
+ "//pkg/client/listers/storage/v1:go_default_library",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/runtime",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/tools/cache",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+)
diff --git a/pkg/client/informers/informers_generated/externalversions/storage/v1/interface.go b/pkg/client/informers/informers_generated/externalversions/storage/v1/interface.go
new file mode 100644
index 00000000000..370a0ff4c8f
--- /dev/null
+++ b/pkg/client/informers/informers_generated/externalversions/storage/v1/interface.go
@@ -0,0 +1,43 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by informer-gen
+
+package v1
+
+import (
+ internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // StorageClasses returns a StorageClassInformer.
+ StorageClasses() StorageClassInformer
+}
+
+type version struct {
+ internalinterfaces.SharedInformerFactory
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory) Interface {
+ return &version{f}
+}
+
+// StorageClasses returns a StorageClassInformer.
+func (v *version) StorageClasses() StorageClassInformer {
+ return &storageClassInformer{factory: v.SharedInformerFactory}
+}
diff --git a/pkg/client/informers/informers_generated/externalversions/storage/v1/storageclass.go b/pkg/client/informers/informers_generated/externalversions/storage/v1/storageclass.go
new file mode 100644
index 00000000000..cd3b293397e
--- /dev/null
+++ b/pkg/client/informers/informers_generated/externalversions/storage/v1/storageclass.go
@@ -0,0 +1,68 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by informer-gen
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ storage_v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
+ clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
+ internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces"
+ v1 "k8s.io/kubernetes/pkg/client/listers/storage/v1"
+ time "time"
+)
+
+// StorageClassInformer provides access to a shared informer and lister for
+// StorageClasses.
+type StorageClassInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1.StorageClassLister
+}
+
+type storageClassInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+}
+
+func newStorageClassInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ sharedIndexInformer := cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
+ return client.StorageV1().StorageClasses().List(options)
+ },
+ WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
+ return client.StorageV1().StorageClasses().Watch(options)
+ },
+ },
+ &storage_v1.StorageClass{},
+ resyncPeriod,
+ cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
+ )
+
+ return sharedIndexInformer
+}
+
+func (f *storageClassInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&storage_v1.StorageClass{}, newStorageClassInformer)
+}
+
+func (f *storageClassInformer) Lister() v1.StorageClassLister {
+ return v1.NewStorageClassLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/client/listers/storage/v1/BUILD b/pkg/client/listers/storage/v1/BUILD
new file mode 100644
index 00000000000..7cc47a31ae9
--- /dev/null
+++ b/pkg/client/listers/storage/v1/BUILD
@@ -0,0 +1,38 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "expansion_generated.go",
+ "storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//pkg/apis/storage:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
+ "//vendor:k8s.io/apimachinery/pkg/api/errors",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/labels",
+ "//vendor:k8s.io/client-go/tools/cache",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+)
diff --git a/pkg/client/listers/storage/v1/expansion_generated.go b/pkg/client/listers/storage/v1/expansion_generated.go
new file mode 100644
index 00000000000..2353b59d3f5
--- /dev/null
+++ b/pkg/client/listers/storage/v1/expansion_generated.go
@@ -0,0 +1,23 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by lister-gen
+
+package v1
+
+// StorageClassListerExpansion allows custom methods to be added to
+// StorageClassLister.
+type StorageClassListerExpansion interface{}
diff --git a/pkg/client/listers/storage/v1/storageclass.go b/pkg/client/listers/storage/v1/storageclass.go
new file mode 100644
index 00000000000..4895367c78b
--- /dev/null
+++ b/pkg/client/listers/storage/v1/storageclass.go
@@ -0,0 +1,68 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by lister-gen
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/api/errors"
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+ storage "k8s.io/kubernetes/pkg/apis/storage"
+ v1 "k8s.io/kubernetes/pkg/apis/storage/v1"
+)
+
+// StorageClassLister helps list StorageClasses.
+type StorageClassLister interface {
+ // List lists all StorageClasses in the indexer.
+ List(selector labels.Selector) (ret []*v1.StorageClass, err error)
+ // Get retrieves the StorageClass from the index for a given name.
+ Get(name string) (*v1.StorageClass, error)
+ StorageClassListerExpansion
+}
+
+// storageClassLister implements the StorageClassLister interface.
+type storageClassLister struct {
+ indexer cache.Indexer
+}
+
+// NewStorageClassLister returns a new StorageClassLister.
+func NewStorageClassLister(indexer cache.Indexer) StorageClassLister {
+ return &storageClassLister{indexer: indexer}
+}
+
+// List lists all StorageClasses in the indexer.
+func (s *storageClassLister) List(selector labels.Selector) (ret []*v1.StorageClass, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1.StorageClass))
+ })
+ return ret, err
+}
+
+// Get retrieves the StorageClass from the index for a given name.
+func (s *storageClassLister) Get(name string) (*v1.StorageClass, error) {
+ key := &v1.StorageClass{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
+ obj, exists, err := s.indexer.Get(key)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(storage.Resource("storageclass"), name)
+ }
+ return obj.(*v1.StorageClass), nil
+}
diff --git a/pkg/controller/volume/persistentvolume/BUILD b/pkg/controller/volume/persistentvolume/BUILD
index 2813145d88a..efcbeee9570 100644
--- a/pkg/controller/volume/persistentvolume/BUILD
+++ b/pkg/controller/volume/persistentvolume/BUILD
@@ -21,7 +21,6 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
- "//pkg/apis/storage/v1beta1/util:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/informers/informers_generated/externalversions/core/v1:go_default_library",
"//pkg/client/informers/informers_generated/externalversions/storage/v1beta1:go_default_library",
@@ -68,7 +67,6 @@ go_test(
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
- "//pkg/apis/storage/v1beta1/util:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/client/informers/informers_generated/externalversions:go_default_library",
diff --git a/pkg/controller/volume/persistentvolume/binder_test.go b/pkg/controller/volume/persistentvolume/binder_test.go
index b232b3d903c..07fe19ca306 100644
--- a/pkg/controller/volume/persistentvolume/binder_test.go
+++ b/pkg/controller/volume/persistentvolume/binder_test.go
@@ -21,7 +21,6 @@ import (
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
)
// Test single call to syncClaim and syncVolume methods.
@@ -42,19 +41,19 @@ func TestSync(t *testing.T) {
{
// syncClaim binds to a matching unbound volume.
"1-1 - successful bind",
- newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume1-1", "1Gi", "uid1-1", "claim1-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim1-1", "uid1-1", "1Gi", "volume1-1", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume1-1", "1Gi", "uid1-1", "claim1-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-1", "uid1-1", "1Gi", "volume1-1", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim does not do anything when there is no matching volume.
"1-2 - noop",
- newVolumeArray("volume1-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume1-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim1-2", "uid1-2", "10Gi", "", v1.ClaimPending),
- newClaimArray("claim1-2", "uid1-2", "10Gi", "", v1.ClaimPending),
+ newVolumeArray("volume1-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume1-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim1-2", "uid1-2", "10Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-2", "uid1-2", "10Gi", "", v1.ClaimPending, nil),
[]string{"Normal FailedBinding"},
noerrors, testSyncClaim,
},
@@ -62,10 +61,10 @@ func TestSync(t *testing.T) {
// syncClaim resets claim.Status to Pending when there is no
// matching volume.
"1-3 - reset to Pending",
- newVolumeArray("volume1-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume1-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim1-3", "uid1-3", "10Gi", "", v1.ClaimBound),
- newClaimArray("claim1-3", "uid1-3", "10Gi", "", v1.ClaimPending),
+ newVolumeArray("volume1-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume1-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim1-3", "uid1-3", "10Gi", "", v1.ClaimBound, nil),
+ newClaimArray("claim1-3", "uid1-3", "10Gi", "", v1.ClaimPending, nil),
[]string{"Normal FailedBinding"},
noerrors, testSyncClaim,
},
@@ -73,15 +72,15 @@ func TestSync(t *testing.T) {
// syncClaim binds claims to the smallest matching volume
"1-4 - smallest volume",
[]*v1.PersistentVolume{
- newVolume("volume1-4_1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-4_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume1-4_1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-4_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
[]*v1.PersistentVolume{
- newVolume("volume1-4_1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-4_2", "1Gi", "uid1-4", "claim1-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
+ newVolume("volume1-4_1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-4_2", "1Gi", "uid1-4", "claim1-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
},
- newClaimArray("claim1-4", "uid1-4", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim1-4", "uid1-4", "1Gi", "volume1-4_2", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newClaimArray("claim1-4", "uid1-4", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-4", "uid1-4", "1Gi", "volume1-4_2", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
@@ -89,15 +88,15 @@ func TestSync(t *testing.T) {
// name), even though a smaller one is available.
"1-5 - prebound volume by name - success",
[]*v1.PersistentVolume{
- newVolume("volume1-5_1", "10Gi", "", "claim1-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-5_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume1-5_1", "10Gi", "", "claim1-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-5_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
[]*v1.PersistentVolume{
- newVolume("volume1-5_1", "10Gi", "uid1-5", "claim1-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-5_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume1-5_1", "10Gi", "uid1-5", "claim1-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-5_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
- newClaimArray("claim1-5", "uid1-5", "1Gi", "", v1.ClaimPending),
- withExpectedCapacity("10Gi", newClaimArray("claim1-5", "uid1-5", "1Gi", "volume1-5_1", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newClaimArray("claim1-5", "uid1-5", "1Gi", "", v1.ClaimPending, nil),
+ withExpectedCapacity("10Gi", newClaimArray("claim1-5", "uid1-5", "1Gi", "volume1-5_1", v1.ClaimBound, nil, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
@@ -105,25 +104,25 @@ func TestSync(t *testing.T) {
// UID), even though a smaller one is available.
"1-6 - prebound volume by UID - success",
[]*v1.PersistentVolume{
- newVolume("volume1-6_1", "10Gi", "uid1-6", "claim1-6", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-6_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume1-6_1", "10Gi", "uid1-6", "claim1-6", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-6_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
[]*v1.PersistentVolume{
- newVolume("volume1-6_1", "10Gi", "uid1-6", "claim1-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolume("volume1-6_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume1-6_1", "10Gi", "uid1-6", "claim1-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume1-6_2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
- newClaimArray("claim1-6", "uid1-6", "1Gi", "", v1.ClaimPending),
- withExpectedCapacity("10Gi", newClaimArray("claim1-6", "uid1-6", "1Gi", "volume1-6_1", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newClaimArray("claim1-6", "uid1-6", "1Gi", "", v1.ClaimPending, nil),
+ withExpectedCapacity("10Gi", newClaimArray("claim1-6", "uid1-6", "1Gi", "volume1-6_1", v1.ClaimBound, nil, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim does not bind claim to a volume prebound to a claim with
// same name and different UID
"1-7 - prebound volume to different claim",
- newVolumeArray("volume1-7", "10Gi", "uid1-777", "claim1-7", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume1-7", "10Gi", "uid1-777", "claim1-7", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim1-7", "uid1-7", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim1-7", "uid1-7", "1Gi", "", v1.ClaimPending),
+ newVolumeArray("volume1-7", "10Gi", "uid1-777", "claim1-7", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume1-7", "10Gi", "uid1-777", "claim1-7", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim1-7", "uid1-7", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-7", "uid1-7", "1Gi", "", v1.ClaimPending, nil),
[]string{"Normal FailedBinding"},
noerrors, testSyncClaim,
},
@@ -131,48 +130,48 @@ func TestSync(t *testing.T) {
// syncClaim completes binding - simulates controller crash after
// PV.ClaimRef is saved
"1-8 - complete bind after crash - PV bound",
- newVolumeArray("volume1-8", "1Gi", "uid1-8", "claim1-8", v1.VolumePending, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume1-8", "1Gi", "uid1-8", "claim1-8", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim1-8", "uid1-8", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim1-8", "uid1-8", "1Gi", "volume1-8", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume1-8", "1Gi", "uid1-8", "claim1-8", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume1-8", "1Gi", "uid1-8", "claim1-8", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim1-8", "uid1-8", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-8", "uid1-8", "1Gi", "volume1-8", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim completes binding - simulates controller crash after
// PV.Status is saved
"1-9 - complete bind after crash - PV status saved",
- newVolumeArray("volume1-9", "1Gi", "uid1-9", "claim1-9", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume1-9", "1Gi", "uid1-9", "claim1-9", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim1-9", "uid1-9", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim1-9", "uid1-9", "1Gi", "volume1-9", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume1-9", "1Gi", "uid1-9", "claim1-9", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume1-9", "1Gi", "uid1-9", "claim1-9", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim1-9", "uid1-9", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim1-9", "uid1-9", "1Gi", "volume1-9", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim completes binding - simulates controller crash after
// PVC.VolumeName is saved
"1-10 - complete bind after crash - PVC bound",
- newVolumeArray("volume1-10", "1Gi", "uid1-10", "claim1-10", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume1-10", "1Gi", "uid1-10", "claim1-10", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim1-10", "uid1-10", "1Gi", "volume1-10", v1.ClaimPending, annBoundByController, annBindCompleted),
- newClaimArray("claim1-10", "uid1-10", "1Gi", "volume1-10", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume1-10", "1Gi", "uid1-10", "claim1-10", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume1-10", "1Gi", "uid1-10", "claim1-10", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim1-10", "uid1-10", "1Gi", "volume1-10", v1.ClaimPending, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim1-10", "uid1-10", "1Gi", "volume1-10", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim binds a claim only when the label selector matches the volume
"1-11 - bind when selector matches",
- withLabels(labels, newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain)),
- withLabels(labels, newVolumeArray("volume1-1", "1Gi", "uid1-1", "claim1-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController)),
- withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending)),
- withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "volume1-1", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ withLabels(labels, newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty)),
+ withLabels(labels, newVolumeArray("volume1-1", "1Gi", "uid1-1", "claim1-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController)),
+ withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending, nil)),
+ withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "volume1-1", v1.ClaimBound, nil, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim does not bind a claim when the label selector doesn't match
"1-12 - do not bind when selector does not match",
- newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending)),
- withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending)),
+ newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending, nil)),
+ withLabelSelector(labels, newClaimArray("claim1-1", "uid1-1", "1Gi", "", v1.ClaimPending, nil)),
[]string{"Normal FailedBinding"},
noerrors, testSyncClaim,
},
@@ -185,8 +184,8 @@ func TestSync(t *testing.T) {
"2-1 - claim prebound to non-existing volume - noop",
novolumes,
novolumes,
- newClaimArray("claim2-1", "uid2-1", "10Gi", "volume2-1", v1.ClaimPending),
- newClaimArray("claim2-1", "uid2-1", "10Gi", "volume2-1", v1.ClaimPending),
+ newClaimArray("claim2-1", "uid2-1", "10Gi", "volume2-1", v1.ClaimPending, nil),
+ newClaimArray("claim2-1", "uid2-1", "10Gi", "volume2-1", v1.ClaimPending, nil),
noevents, noerrors, testSyncClaim,
},
{
@@ -195,28 +194,28 @@ func TestSync(t *testing.T) {
"2-2 - claim prebound to non-existing volume - reset status",
novolumes,
novolumes,
- newClaimArray("claim2-2", "uid2-2", "10Gi", "volume2-2", v1.ClaimBound),
- newClaimArray("claim2-2", "uid2-2", "10Gi", "volume2-2", v1.ClaimPending),
+ newClaimArray("claim2-2", "uid2-2", "10Gi", "volume2-2", v1.ClaimBound, nil),
+ newClaimArray("claim2-2", "uid2-2", "10Gi", "volume2-2", v1.ClaimPending, nil),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim with claim pre-bound to a PV that exists and is
// unbound. Check it gets bound and no annBoundByController is set.
"2-3 - claim prebound to unbound volume",
- newVolumeArray("volume2-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-3", "1Gi", "uid2-3", "claim2-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimPending),
- newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimBound, annBindCompleted),
+ newVolumeArray("volume2-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-3", "1Gi", "uid2-3", "claim2-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimPending, nil),
+ newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// claim with claim pre-bound to a PV that is pre-bound to the claim
// by name. Check it gets bound and no annBoundByController is set.
"2-4 - claim prebound to prebound volume by name",
- newVolumeArray("volume2-4", "1Gi", "", "claim2-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-4", "1Gi", "uid2-4", "claim2-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim2-4", "uid2-4", "1Gi", "volume2-4", v1.ClaimPending),
- newClaimArray("claim2-4", "uid2-4", "1Gi", "volume2-4", v1.ClaimBound, annBindCompleted),
+ newVolumeArray("volume2-4", "1Gi", "", "claim2-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-4", "1Gi", "uid2-4", "claim2-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim2-4", "uid2-4", "1Gi", "volume2-4", v1.ClaimPending, nil),
+ newClaimArray("claim2-4", "uid2-4", "1Gi", "volume2-4", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
@@ -224,30 +223,30 @@ func TestSync(t *testing.T) {
// claim by UID. Check it gets bound and no annBoundByController is
// set.
"2-5 - claim prebound to prebound volume by UID",
- newVolumeArray("volume2-5", "1Gi", "uid2-5", "claim2-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-5", "1Gi", "uid2-5", "claim2-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim2-5", "uid2-5", "1Gi", "volume2-5", v1.ClaimPending),
- newClaimArray("claim2-5", "uid2-5", "1Gi", "volume2-5", v1.ClaimBound, annBindCompleted),
+ newVolumeArray("volume2-5", "1Gi", "uid2-5", "claim2-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-5", "1Gi", "uid2-5", "claim2-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim2-5", "uid2-5", "1Gi", "volume2-5", v1.ClaimPending, nil),
+ newClaimArray("claim2-5", "uid2-5", "1Gi", "volume2-5", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim with claim pre-bound to a PV that is bound to different
// claim. Check it's reset to Pending.
"2-6 - claim prebound to already bound volume",
- newVolumeArray("volume2-6", "1Gi", "uid2-6_1", "claim2-6_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-6", "1Gi", "uid2-6_1", "claim2-6_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim2-6", "uid2-6", "1Gi", "volume2-6", v1.ClaimBound),
- newClaimArray("claim2-6", "uid2-6", "1Gi", "volume2-6", v1.ClaimPending),
+ newVolumeArray("volume2-6", "1Gi", "uid2-6_1", "claim2-6_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-6", "1Gi", "uid2-6_1", "claim2-6_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim2-6", "uid2-6", "1Gi", "volume2-6", v1.ClaimBound, nil),
+ newClaimArray("claim2-6", "uid2-6", "1Gi", "volume2-6", v1.ClaimPending, nil),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim with claim bound by controller to a PV that is bound to
// different claim. Check it throws an error.
"2-7 - claim bound by controller to already bound volume",
- newVolumeArray("volume2-7", "1Gi", "uid2-7_1", "claim2-7_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-7", "1Gi", "uid2-7_1", "claim2-7_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim2-7", "uid2-7", "1Gi", "volume2-7", v1.ClaimBound, annBoundByController),
- newClaimArray("claim2-7", "uid2-7", "1Gi", "volume2-7", v1.ClaimBound, annBoundByController),
+ newVolumeArray("volume2-7", "1Gi", "uid2-7_1", "claim2-7_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-7", "1Gi", "uid2-7_1", "claim2-7_1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim2-7", "uid2-7", "1Gi", "volume2-7", v1.ClaimBound, nil, annBoundByController),
+ newClaimArray("claim2-7", "uid2-7", "1Gi", "volume2-7", v1.ClaimBound, nil, annBoundByController),
noevents, noerrors, testSyncClaimError,
},
{
@@ -255,10 +254,10 @@ func TestSync(t *testing.T) {
// unbound, but does not match the selector. Check it gets bound
// and no annBoundByController is set.
"2-8 - claim prebound to unbound volume that does not match the selector",
- newVolumeArray("volume2-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume2-3", "1Gi", "uid2-3", "claim2-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- withLabelSelector(labels, newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimPending)),
- withLabelSelector(labels, newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimBound, annBindCompleted)),
+ newVolumeArray("volume2-3", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume2-3", "1Gi", "uid2-3", "claim2-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ withLabelSelector(labels, newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimPending, nil)),
+ withLabelSelector(labels, newClaimArray("claim2-3", "uid2-3", "1Gi", "volume2-3", v1.ClaimBound, nil, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
@@ -269,8 +268,8 @@ func TestSync(t *testing.T) {
"3-1 - bound claim with missing VolumeName",
novolumes,
novolumes,
- newClaimArray("claim3-1", "uid3-1", "10Gi", "", v1.ClaimBound, annBoundByController, annBindCompleted),
- newClaimArray("claim3-1", "uid3-1", "10Gi", "", v1.ClaimLost, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-1", "uid3-1", "10Gi", "", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-1", "uid3-1", "10Gi", "", v1.ClaimLost, nil, annBoundByController, annBindCompleted),
[]string{"Warning ClaimLost"}, noerrors, testSyncClaim,
},
{
@@ -279,28 +278,28 @@ func TestSync(t *testing.T) {
"3-2 - bound claim with missing volume",
novolumes,
novolumes,
- newClaimArray("claim3-2", "uid3-2", "10Gi", "volume3-2", v1.ClaimBound, annBoundByController, annBindCompleted),
- newClaimArray("claim3-2", "uid3-2", "10Gi", "volume3-2", v1.ClaimLost, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-2", "uid3-2", "10Gi", "volume3-2", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-2", "uid3-2", "10Gi", "volume3-2", v1.ClaimLost, nil, annBoundByController, annBindCompleted),
[]string{"Warning ClaimLost"}, noerrors, testSyncClaim,
},
{
// syncClaim with claim bound to unbound volume. Check it's bound.
// Also check that Pending phase is set to Bound
"3-3 - bound claim with unbound volume",
- newVolumeArray("volume3-3", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume3-3", "10Gi", "uid3-3", "claim3-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimPending, annBoundByController, annBindCompleted),
- newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume3-3", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume3-3", "10Gi", "uid3-3", "claim3-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimPending, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncClaim with claim bound to volume with missing (or different)
// volume.Spec.ClaimRef.UID. Check that the claim is marked as lost.
"3-4 - bound claim with prebound volume",
- newVolumeArray("volume3-4", "10Gi", "claim3-4-x", "claim3-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume3-4", "10Gi", "claim3-4-x", "claim3-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim3-4", "uid3-4", "10Gi", "volume3-4", v1.ClaimPending, annBoundByController, annBindCompleted),
- newClaimArray("claim3-4", "uid3-4", "10Gi", "volume3-4", v1.ClaimLost, annBoundByController, annBindCompleted),
+ newVolumeArray("volume3-4", "10Gi", "claim3-4-x", "claim3-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume3-4", "10Gi", "claim3-4-x", "claim3-4", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim3-4", "uid3-4", "10Gi", "volume3-4", v1.ClaimPending, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim3-4", "uid3-4", "10Gi", "volume3-4", v1.ClaimLost, nil, annBoundByController, annBindCompleted),
[]string{"Warning ClaimMisbound"}, noerrors, testSyncClaim,
},
{
@@ -308,10 +307,10 @@ func TestSync(t *testing.T) {
// controller does not do anything. Also check that Pending phase is
// set to Bound
"3-5 - bound claim with bound volume",
- newVolumeArray("volume3-5", "10Gi", "uid3-5", "claim3-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume3-5", "10Gi", "uid3-5", "claim3-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim3-5", "uid3-5", "10Gi", "volume3-5", v1.ClaimPending, annBindCompleted),
- newClaimArray("claim3-5", "uid3-5", "10Gi", "volume3-5", v1.ClaimBound, annBindCompleted),
+ newVolumeArray("volume3-5", "10Gi", "uid3-5", "claim3-5", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume3-5", "10Gi", "uid3-5", "claim3-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim3-5", "uid3-5", "10Gi", "volume3-5", v1.ClaimPending, nil, annBindCompleted),
+ newClaimArray("claim3-5", "uid3-5", "10Gi", "volume3-5", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
@@ -319,10 +318,10 @@ func TestSync(t *testing.T) {
// claim. Check that the claim is marked as lost.
// TODO: test that an event is emitted
"3-6 - bound claim with bound volume",
- newVolumeArray("volume3-6", "10Gi", "uid3-6-x", "claim3-6-x", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume3-6", "10Gi", "uid3-6-x", "claim3-6-x", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim3-6", "uid3-6", "10Gi", "volume3-6", v1.ClaimPending, annBindCompleted),
- newClaimArray("claim3-6", "uid3-6", "10Gi", "volume3-6", v1.ClaimLost, annBindCompleted),
+ newVolumeArray("volume3-6", "10Gi", "uid3-6-x", "claim3-6-x", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume3-6", "10Gi", "uid3-6-x", "claim3-6-x", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim3-6", "uid3-6", "10Gi", "volume3-6", v1.ClaimPending, nil, annBindCompleted),
+ newClaimArray("claim3-6", "uid3-6", "10Gi", "volume3-6", v1.ClaimLost, nil, annBindCompleted),
[]string{"Warning ClaimMisbound"}, noerrors, testSyncClaim,
},
{
@@ -330,18 +329,18 @@ func TestSync(t *testing.T) {
// even if the claim's selector doesn't match the volume. Also
// check that Pending phase is set to Bound
"3-7 - bound claim with unbound volume where selector doesn't match",
- newVolumeArray("volume3-3", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume3-3", "10Gi", "uid3-3", "claim3-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- withLabelSelector(labels, newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimPending, annBoundByController, annBindCompleted)),
- withLabelSelector(labels, newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newVolumeArray("volume3-3", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume3-3", "10Gi", "uid3-3", "claim3-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ withLabelSelector(labels, newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimPending, nil, annBoundByController, annBindCompleted)),
+ withLabelSelector(labels, newClaimArray("claim3-3", "uid3-3", "10Gi", "volume3-3", v1.ClaimBound, nil, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
// [Unit test set 4] All syncVolume tests.
{
// syncVolume with pending volume. Check it's marked as Available.
"4-1 - pending volume",
- newVolumeArray("volume4-1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-1", "10Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
+ newVolumeArray("volume4-1", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-1", "10Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
noclaims,
noclaims,
noevents, noerrors, testSyncVolume,
@@ -350,8 +349,8 @@ func TestSync(t *testing.T) {
// syncVolume with prebound pending volume. Check it's marked as
// Available.
"4-2 - pending prebound volume",
- newVolumeArray("volume4-2", "10Gi", "", "claim4-2", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-2", "10Gi", "", "claim4-2", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
+ newVolumeArray("volume4-2", "10Gi", "", "claim4-2", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-2", "10Gi", "", "claim4-2", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
noclaims,
noclaims,
noevents, noerrors, testSyncVolume,
@@ -360,8 +359,8 @@ func TestSync(t *testing.T) {
// syncVolume with volume bound to missing claim.
// Check the volume gets Released
"4-3 - bound volume with missing claim",
- newVolumeArray("volume4-3", "10Gi", "uid4-3", "claim4-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-3", "10Gi", "uid4-3", "claim4-3", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain),
+ newVolumeArray("volume4-3", "10Gi", "uid4-3", "claim4-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-3", "10Gi", "uid4-3", "claim4-3", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, classEmpty),
noclaims,
noclaims,
noevents, noerrors, testSyncVolume,
@@ -370,50 +369,50 @@ func TestSync(t *testing.T) {
// syncVolume with volume bound to claim with different UID.
// Check the volume gets Released.
"4-4 - volume bound to claim with different UID",
- newVolumeArray("volume4-4", "10Gi", "uid4-4", "claim4-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-4", "10Gi", "uid4-4", "claim4-4", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim4-4", "uid4-4-x", "10Gi", "volume4-4", v1.ClaimBound, annBindCompleted),
- newClaimArray("claim4-4", "uid4-4-x", "10Gi", "volume4-4", v1.ClaimBound, annBindCompleted),
+ newVolumeArray("volume4-4", "10Gi", "uid4-4", "claim4-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-4", "10Gi", "uid4-4", "claim4-4", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim4-4", "uid4-4-x", "10Gi", "volume4-4", v1.ClaimBound, nil, annBindCompleted),
+ newClaimArray("claim4-4", "uid4-4-x", "10Gi", "volume4-4", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors, testSyncVolume,
},
{
// syncVolume with volume bound by controller to unbound claim.
// Check syncVolume does not do anything.
"4-5 - volume bound by controller to unbound claim",
- newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending),
- newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending),
+ newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending, nil),
noevents, noerrors, testSyncVolume,
},
{
// syncVolume with volume bound by user to unbound claim.
// Check syncVolume does not do anything.
"4-5 - volume bound by user to bound claim",
- newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending),
- newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending),
+ newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-5", "10Gi", "uid4-5", "claim4-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim4-5", "uid4-5", "10Gi", "", v1.ClaimPending, nil),
noevents, noerrors, testSyncVolume,
},
{
// syncVolume with volume bound to bound claim.
// Check that the volume is marked as Bound.
"4-6 - volume bound by to bound claim",
- newVolumeArray("volume4-6", "10Gi", "uid4-6", "claim4-6", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-6", "10Gi", "uid4-6", "claim4-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim4-6", "uid4-6", "10Gi", "volume4-6", v1.ClaimBound),
- newClaimArray("claim4-6", "uid4-6", "10Gi", "volume4-6", v1.ClaimBound),
+ newVolumeArray("volume4-6", "10Gi", "uid4-6", "claim4-6", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-6", "10Gi", "uid4-6", "claim4-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim4-6", "uid4-6", "10Gi", "volume4-6", v1.ClaimBound, nil),
+ newClaimArray("claim4-6", "uid4-6", "10Gi", "volume4-6", v1.ClaimBound, nil),
noevents, noerrors, testSyncVolume,
},
{
// syncVolume with volume bound by controller to claim bound to
// another volume. Check that the volume is rolled back.
"4-7 - volume bound by controller to claim bound somewhere else",
- newVolumeArray("volume4-7", "10Gi", "uid4-7", "claim4-7", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume4-7", "10Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim4-7", "uid4-7", "10Gi", "volume4-7-x", v1.ClaimBound),
- newClaimArray("claim4-7", "uid4-7", "10Gi", "volume4-7-x", v1.ClaimBound),
+ newVolumeArray("volume4-7", "10Gi", "uid4-7", "claim4-7", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume4-7", "10Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim4-7", "uid4-7", "10Gi", "volume4-7-x", v1.ClaimBound, nil),
+ newClaimArray("claim4-7", "uid4-7", "10Gi", "volume4-7-x", v1.ClaimBound, nil),
noevents, noerrors, testSyncVolume,
},
{
@@ -421,10 +420,10 @@ func TestSync(t *testing.T) {
// another volume. Check that the volume is marked as Available
// and its UID is reset.
"4-8 - volume bound by user to claim bound somewhere else",
- newVolumeArray("volume4-8", "10Gi", "uid4-8", "claim4-8", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume4-8", "10Gi", "", "claim4-8", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
- newClaimArray("claim4-8", "uid4-8", "10Gi", "volume4-8-x", v1.ClaimBound),
- newClaimArray("claim4-8", "uid4-8", "10Gi", "volume4-8-x", v1.ClaimBound),
+ newVolumeArray("volume4-8", "10Gi", "uid4-8", "claim4-8", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume4-8", "10Gi", "", "claim4-8", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newClaimArray("claim4-8", "uid4-8", "10Gi", "volume4-8-x", v1.ClaimBound, nil),
+ newClaimArray("claim4-8", "uid4-8", "10Gi", "volume4-8-x", v1.ClaimBound, nil),
noevents, noerrors, testSyncVolume,
},
@@ -434,15 +433,15 @@ func TestSync(t *testing.T) {
// smaller PV available
"13-1 - binding to class",
[]*v1.PersistentVolume{
- newVolume("volume13-1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume13-1-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, storageutil.StorageClassAnnotation),
+ newVolume("volume13-1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume13-1-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classGold),
},
[]*v1.PersistentVolume{
- newVolume("volume13-1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume13-1-2", "10Gi", "uid13-1", "claim13-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController, storageutil.StorageClassAnnotation),
+ newVolume("volume13-1-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("volume13-1-2", "10Gi", "uid13-1", "claim13-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classGold, annBoundByController),
},
- newClaimArray("claim13-1", "uid13-1", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- withExpectedCapacity("10Gi", newClaimArray("claim13-1", "uid13-1", "1Gi", "volume13-1-2", v1.ClaimBound, annBoundByController, storageutil.StorageClassAnnotation, annBindCompleted)),
+ newClaimArray("claim13-1", "uid13-1", "1Gi", "", v1.ClaimPending, &classGold),
+ withExpectedCapacity("10Gi", newClaimArray("claim13-1", "uid13-1", "1Gi", "volume13-1-2", v1.ClaimBound, &classGold, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
@@ -450,61 +449,51 @@ func TestSync(t *testing.T) {
// smaller PV with a class available
"13-2 - binding without a class",
[]*v1.PersistentVolume{
- newVolume("volume13-2-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, storageutil.StorageClassAnnotation),
- newVolume("volume13-2-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume13-2-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classGold),
+ newVolume("volume13-2-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
},
[]*v1.PersistentVolume{
- newVolume("volume13-2-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, storageutil.StorageClassAnnotation),
- newVolume("volume13-2-2", "10Gi", "uid13-2", "claim13-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
+ newVolume("volume13-2-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classGold),
+ newVolume("volume13-2-2", "10Gi", "uid13-2", "claim13-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
},
- newClaimArray("claim13-2", "uid13-2", "1Gi", "", v1.ClaimPending),
- withExpectedCapacity("10Gi", newClaimArray("claim13-2", "uid13-2", "1Gi", "volume13-2-2", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newClaimArray("claim13-2", "uid13-2", "1Gi", "", v1.ClaimPending, nil),
+ withExpectedCapacity("10Gi", newClaimArray("claim13-2", "uid13-2", "1Gi", "volume13-2-2", v1.ClaimBound, nil, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
// syncVolume binds a claim with given class even if there is a
// smaller PV with different class available
"13-3 - binding to specific a class",
- volumeWithClass("silver", []*v1.PersistentVolume{
- newVolume("volume13-3-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume13-3-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, storageutil.StorageClassAnnotation),
- }),
- volumeWithClass("silver", []*v1.PersistentVolume{
- newVolume("volume13-3-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("volume13-3-2", "10Gi", "uid13-3", "claim13-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController, storageutil.StorageClassAnnotation),
- }),
- newClaimArray("claim13-3", "uid13-3", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- withExpectedCapacity("10Gi", newClaimArray("claim13-3", "uid13-3", "1Gi", "volume13-3-2", v1.ClaimBound, annBoundByController, annBindCompleted, storageutil.StorageClassAnnotation)),
+ []*v1.PersistentVolume{
+ newVolume("volume13-3-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classSilver),
+ newVolume("volume13-3-2", "10Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classGold),
+ },
+ []*v1.PersistentVolume{
+ newVolume("volume13-3-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classSilver),
+ newVolume("volume13-3-2", "10Gi", "uid13-3", "claim13-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classGold, annBoundByController),
+ },
+ newClaimArray("claim13-3", "uid13-3", "1Gi", "", v1.ClaimPending, &classGold),
+ withExpectedCapacity("10Gi", newClaimArray("claim13-3", "uid13-3", "1Gi", "volume13-3-2", v1.ClaimBound, &classGold, annBoundByController, annBindCompleted)),
noevents, noerrors, testSyncClaim,
},
{
// syncVolume binds claim requesting class "" to claim to PV with
// class=""
"13-4 - empty class",
- volumeWithClass("", newVolumeArray("volume13-4", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain)),
- volumeWithClass("", newVolumeArray("volume13-4", "1Gi", "uid13-4", "claim13-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController)),
- claimWithClass("", newClaimArray("claim13-4", "uid13-4", "1Gi", "", v1.ClaimPending)),
- claimWithClass("", newClaimArray("claim13-4", "uid13-4", "1Gi", "volume13-4", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newVolumeArray("volume13-4", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume13-4", "1Gi", "uid13-4", "claim13-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim13-4", "uid13-4", "1Gi", "", v1.ClaimPending, &classEmpty),
+ newClaimArray("claim13-4", "uid13-4", "1Gi", "volume13-4", v1.ClaimBound, &classEmpty, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
// syncVolume binds claim requesting class nil to claim to PV with
// class = ""
"13-5 - nil class",
- volumeWithClass("", newVolumeArray("volume13-5", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain)),
- volumeWithClass("", newVolumeArray("volume13-5", "1Gi", "uid13-5", "claim13-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController)),
- newClaimArray("claim13-5", "uid13-5", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim13-5", "uid13-5", "1Gi", "volume13-5", v1.ClaimBound, annBoundByController, annBindCompleted),
- noevents, noerrors, testSyncClaim,
- },
- {
- // syncVolume binds claim requesting class "" to claim to PV with
- // class=nil
- "13-6 - nil class in PV, '' class in claim",
- newVolumeArray("volume13-6", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume13-6", "1Gi", "uid13-6", "claim13-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- claimWithClass("", newClaimArray("claim13-6", "uid13-6", "1Gi", "", v1.ClaimPending)),
- claimWithClass("", newClaimArray("claim13-6", "uid13-6", "1Gi", "volume13-6", v1.ClaimBound, annBoundByController, annBindCompleted)),
+ newVolumeArray("volume13-5", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume13-5", "1Gi", "uid13-5", "claim13-5", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim13-5", "uid13-5", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim13-5", "uid13-5", "1Gi", "volume13-5", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
}
@@ -531,10 +520,10 @@ func TestMultiSync(t *testing.T) {
{
// syncClaim binds to a matching unbound volume.
"10-1 - successful bind",
- newVolumeArray("volume10-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume10-1", "1Gi", "uid10-1", "claim10-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim10-1", "uid10-1", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim10-1", "uid10-1", "1Gi", "volume10-1", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume10-1", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume10-1", "1Gi", "uid10-1", "claim10-1", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim10-1", "uid10-1", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim10-1", "uid10-1", "1Gi", "volume10-1", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
{
@@ -542,15 +531,15 @@ func TestMultiSync(t *testing.T) {
// wins and the second rolls back.
"10-2 - bind PV race",
[]*v1.PersistentVolume{
- newVolume("volume10-2-1", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolume("volume10-2-2", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
+ newVolume("volume10-2-1", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolume("volume10-2-2", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
},
[]*v1.PersistentVolume{
- newVolume("volume10-2-1", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolume("volume10-2-2", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
+ newVolume("volume10-2-1", "1Gi", "uid10-2", "claim10-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolume("volume10-2-2", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
},
- newClaimArray("claim10-2", "uid10-2", "1Gi", "volume10-2-1", v1.ClaimBound, annBoundByController, annBindCompleted),
- newClaimArray("claim10-2", "uid10-2", "1Gi", "volume10-2-1", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newClaimArray("claim10-2", "uid10-2", "1Gi", "volume10-2-1", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim10-2", "uid10-2", "1Gi", "volume10-2-1", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors, testSyncClaim,
},
}
diff --git a/pkg/controller/volume/persistentvolume/delete_test.go b/pkg/controller/volume/persistentvolume/delete_test.go
index b4c3effc420..592c51ab941 100644
--- a/pkg/controller/volume/persistentvolume/delete_test.go
+++ b/pkg/controller/volume/persistentvolume/delete_test.go
@@ -33,7 +33,7 @@ func TestDeleteSync(t *testing.T) {
{
// delete volume bound by controller
"8-1 - successful delete",
- newVolumeArray("volume8-1", "1Gi", "uid8-1", "claim8-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController),
+ newVolumeArray("volume8-1", "1Gi", "uid8-1", "claim8-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController),
novolumes,
noclaims,
noclaims,
@@ -45,7 +45,7 @@ func TestDeleteSync(t *testing.T) {
{
// delete volume bound by user
"8-2 - successful delete with prebound volume",
- newVolumeArray("volume8-2", "1Gi", "uid8-2", "claim8-2", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
+ newVolumeArray("volume8-2", "1Gi", "uid8-2", "claim8-2", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
novolumes,
noclaims,
noclaims,
@@ -57,8 +57,8 @@ func TestDeleteSync(t *testing.T) {
{
// delete failure - plugin not found
"8-3 - plugin not found",
- newVolumeArray("volume8-3", "1Gi", "uid8-3", "claim8-3", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
- withMessage("Error getting deleter volume plugin for volume \"volume8-3\": no volume plugin matched", newVolumeArray("volume8-3", "1Gi", "uid8-3", "claim8-3", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete)),
+ newVolumeArray("volume8-3", "1Gi", "uid8-3", "claim8-3", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
+ withMessage("Error getting deleter volume plugin for volume \"volume8-3\": no volume plugin matched", newVolumeArray("volume8-3", "1Gi", "uid8-3", "claim8-3", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedDelete"}, noerrors, testSyncVolume,
@@ -66,8 +66,8 @@ func TestDeleteSync(t *testing.T) {
{
// delete failure - newDeleter returns error
"8-4 - newDeleter returns error",
- newVolumeArray("volume8-4", "1Gi", "uid8-4", "claim8-4", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
- withMessage("Failed to create deleter for volume \"volume8-4\": Mock plugin error: no deleteCalls configured", newVolumeArray("volume8-4", "1Gi", "uid8-4", "claim8-4", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete)),
+ newVolumeArray("volume8-4", "1Gi", "uid8-4", "claim8-4", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
+ withMessage("Failed to create deleter for volume \"volume8-4\": Mock plugin error: no deleteCalls configured", newVolumeArray("volume8-4", "1Gi", "uid8-4", "claim8-4", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedDelete"}, noerrors,
@@ -76,8 +76,8 @@ func TestDeleteSync(t *testing.T) {
{
// delete failure - delete() returns error
"8-5 - delete returns error",
- newVolumeArray("volume8-5", "1Gi", "uid8-5", "claim8-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
- withMessage("Mock delete error", newVolumeArray("volume8-5", "1Gi", "uid8-5", "claim8-5", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete)),
+ newVolumeArray("volume8-5", "1Gi", "uid8-5", "claim8-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
+ withMessage("Mock delete error", newVolumeArray("volume8-5", "1Gi", "uid8-5", "claim8-5", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedDelete"}, noerrors,
@@ -86,7 +86,7 @@ func TestDeleteSync(t *testing.T) {
{
// delete success(?) - volume is deleted before doDelete() starts
"8-6 - volume is deleted before deleting",
- newVolumeArray("volume8-6", "1Gi", "uid8-6", "claim8-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
+ newVolumeArray("volume8-6", "1Gi", "uid8-6", "claim8-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
novolumes,
noclaims,
noclaims,
@@ -103,17 +103,17 @@ func TestDeleteSync(t *testing.T) {
// starts. This simulates "volume no longer needs recycling,
// skipping".
"8-7 - volume is bound before deleting",
- newVolumeArray("volume8-7", "1Gi", "uid8-7", "claim8-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController),
- newVolumeArray("volume8-7", "1Gi", "uid8-7", "claim8-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController),
+ newVolumeArray("volume8-7", "1Gi", "uid8-7", "claim8-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController),
+ newVolumeArray("volume8-7", "1Gi", "uid8-7", "claim8-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController),
noclaims,
- newClaimArray("claim8-7", "uid8-7", "10Gi", "volume8-7", v1.ClaimBound),
+ newClaimArray("claim8-7", "uid8-7", "10Gi", "volume8-7", v1.ClaimBound, nil),
noevents, noerrors,
wrapTestWithInjectedOperation(wrapTestWithReclaimCalls(operationDelete, []error{}, testSyncVolume), func(ctrl *PersistentVolumeController, reactor *volumeReactor) {
reactor.lock.Lock()
defer reactor.lock.Unlock()
// Bind the volume to resurrected claim (this should never
// happen)
- claim := newClaim("claim8-7", "uid8-7", "10Gi", "volume8-7", v1.ClaimBound)
+ claim := newClaim("claim8-7", "uid8-7", "10Gi", "volume8-7", v1.ClaimBound, nil)
reactor.claims[claim.Name] = claim
ctrl.claims.Add(claim)
volume := reactor.volumes["volume8-7"]
@@ -124,10 +124,10 @@ func TestDeleteSync(t *testing.T) {
// delete success - volume bound by user is deleted, while a new
// claim is created with another UID.
"8-9 - prebound volume is deleted while the claim exists",
- newVolumeArray("volume8-9", "1Gi", "uid8-9", "claim8-9", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
+ newVolumeArray("volume8-9", "1Gi", "uid8-9", "claim8-9", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
novolumes,
- newClaimArray("claim8-9", "uid8-9-x", "10Gi", "", v1.ClaimPending),
- newClaimArray("claim8-9", "uid8-9-x", "10Gi", "", v1.ClaimPending),
+ newClaimArray("claim8-9", "uid8-9-x", "10Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim8-9", "uid8-9-x", "10Gi", "", v1.ClaimPending, nil),
noevents, noerrors,
// Inject deleter into the controller and call syncVolume. The
// deleter simulates one delete() call that succeeds.
@@ -136,8 +136,8 @@ func TestDeleteSync(t *testing.T) {
{
// PV requires external deleter
"8-10 - external deleter",
- newVolumeArray("volume8-10", "1Gi", "uid10-1", "claim10-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController),
- newVolumeArray("volume8-10", "1Gi", "uid10-1", "claim10-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, annBoundByController),
+ newVolumeArray("volume8-10", "1Gi", "uid10-1", "claim10-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController),
+ newVolumeArray("volume8-10", "1Gi", "uid10-1", "claim10-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController),
noclaims,
noclaims,
noevents, noerrors,
@@ -153,15 +153,15 @@ func TestDeleteSync(t *testing.T) {
// One of the PVs is deleted.
"8-11 - two PVs provisioned for a single claim",
[]*v1.PersistentVolume{
- newVolume("volume8-11-1", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
- newVolume("volume8-11-2", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
+ newVolume("volume8-11-1", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
+ newVolume("volume8-11-2", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
},
[]*v1.PersistentVolume{
- newVolume("volume8-11-2", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
+ newVolume("volume8-11-2", "1Gi", "uid8-11", "claim8-11", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
},
// the claim is bound to volume8-11-2 -> volume8-11-1 has lost the race and will be deleted
- newClaimArray("claim8-11", "uid8-11", "10Gi", "volume8-11-2", v1.ClaimBound),
- newClaimArray("claim8-11", "uid8-11", "10Gi", "volume8-11-2", v1.ClaimBound),
+ newClaimArray("claim8-11", "uid8-11", "10Gi", "volume8-11-2", v1.ClaimBound, nil),
+ newClaimArray("claim8-11", "uid8-11", "10Gi", "volume8-11-2", v1.ClaimBound, nil),
noevents, noerrors,
// Inject deleter into the controller and call syncVolume. The
// deleter simulates one delete() call that succeeds.
@@ -173,16 +173,16 @@ func TestDeleteSync(t *testing.T) {
// external provisioner.
"8-12 - two PVs externally provisioned for a single claim",
[]*v1.PersistentVolume{
- newVolume("volume8-12-1", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
- newVolume("volume8-12-2", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
+ newVolume("volume8-12-1", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
+ newVolume("volume8-12-2", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
},
[]*v1.PersistentVolume{
- newVolume("volume8-12-1", "1Gi", "uid8-12", "claim8-12", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
- newVolume("volume8-12-2", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annDynamicallyProvisioned),
+ newVolume("volume8-12-1", "1Gi", "uid8-12", "claim8-12", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
+ newVolume("volume8-12-2", "1Gi", "uid8-12", "claim8-12", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annDynamicallyProvisioned),
},
// the claim is bound to volume8-12-2 -> volume8-12-1 has lost the race and will be "Released"
- newClaimArray("claim8-12", "uid8-12", "10Gi", "volume8-12-2", v1.ClaimBound),
- newClaimArray("claim8-12", "uid8-12", "10Gi", "volume8-12-2", v1.ClaimBound),
+ newClaimArray("claim8-12", "uid8-12", "10Gi", "volume8-12-2", v1.ClaimBound, nil),
+ newClaimArray("claim8-12", "uid8-12", "10Gi", "volume8-12-2", v1.ClaimBound, nil),
noevents, noerrors,
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
// Inject external deleter annotation
@@ -215,7 +215,7 @@ func TestDeleteMultiSync(t *testing.T) {
// delete failure - delete returns error. The controller should
// try again.
"9-1 - delete returns error",
- newVolumeArray("volume9-1", "1Gi", "uid9-1", "claim9-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete),
+ newVolumeArray("volume9-1", "1Gi", "uid9-1", "claim9-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),
novolumes,
noclaims,
noclaims,
diff --git a/pkg/controller/volume/persistentvolume/framework_test.go b/pkg/controller/volume/persistentvolume/framework_test.go
index b50666e523c..d3725074d2d 100644
--- a/pkg/controller/volume/persistentvolume/framework_test.go
+++ b/pkg/controller/volume/persistentvolume/framework_test.go
@@ -43,7 +43,6 @@ import (
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
@@ -621,7 +620,7 @@ func newTestController(kubeClient clientset.Interface, informerFactory informers
}
// newVolume returns a new volume with given attributes
-func newVolume(name, capacity, boundToClaimUID, boundToClaimName string, phase v1.PersistentVolumePhase, reclaimPolicy v1.PersistentVolumeReclaimPolicy, annotations ...string) *v1.PersistentVolume {
+func newVolume(name, capacity, boundToClaimUID, boundToClaimName string, phase v1.PersistentVolumePhase, reclaimPolicy v1.PersistentVolumeReclaimPolicy, class string, annotations ...string) *v1.PersistentVolume {
volume := v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: name,
@@ -636,6 +635,7 @@ func newVolume(name, capacity, boundToClaimUID, boundToClaimName string, phase v
},
AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce, v1.ReadOnlyMany},
PersistentVolumeReclaimPolicy: reclaimPolicy,
+ StorageClassName: class,
},
Status: v1.PersistentVolumeStatus{
Phase: phase,
@@ -658,8 +658,6 @@ func newVolume(name, capacity, boundToClaimUID, boundToClaimName string, phase v
switch a {
case annDynamicallyProvisioned:
volume.Annotations[a] = mockPluginName
- case storageutil.StorageClassAnnotation:
- volume.Annotations[a] = "gold"
default:
volume.Annotations[a] = "yes"
}
@@ -707,27 +705,16 @@ func withMessage(message string, volumes []*v1.PersistentVolume) []*v1.Persisten
return volumes
}
-// volumeWithClass saves given class into storage.StorageClassAnnotation annotation.
-// Meant to be used to compose claims specified inline in a test.
-func volumeWithClass(className string, volumes []*v1.PersistentVolume) []*v1.PersistentVolume {
- if volumes[0].Annotations == nil {
- volumes[0].Annotations = map[string]string{storageutil.StorageClassAnnotation: className}
- } else {
- volumes[0].Annotations[storageutil.StorageClassAnnotation] = className
- }
- return volumes
-}
-
// newVolumeArray returns array with a single volume that would be returned by
// newVolume() with the same parameters.
-func newVolumeArray(name, capacity, boundToClaimUID, boundToClaimName string, phase v1.PersistentVolumePhase, reclaimPolicy v1.PersistentVolumeReclaimPolicy, annotations ...string) []*v1.PersistentVolume {
+func newVolumeArray(name, capacity, boundToClaimUID, boundToClaimName string, phase v1.PersistentVolumePhase, reclaimPolicy v1.PersistentVolumeReclaimPolicy, class string, annotations ...string) []*v1.PersistentVolume {
return []*v1.PersistentVolume{
- newVolume(name, capacity, boundToClaimUID, boundToClaimName, phase, reclaimPolicy, annotations...),
+ newVolume(name, capacity, boundToClaimUID, boundToClaimName, phase, reclaimPolicy, class, annotations...),
}
}
// newClaim returns a new claim with given attributes
-func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.PersistentVolumeClaimPhase, annotations ...string) *v1.PersistentVolumeClaim {
+func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.PersistentVolumeClaimPhase, class *string, annotations ...string) *v1.PersistentVolumeClaim {
claim := v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: name,
@@ -742,7 +729,8 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.Persisten
v1.ResourceName(v1.ResourceStorage): resource.MustParse(capacity),
},
},
- VolumeName: boundToVolume,
+ VolumeName: boundToVolume,
+ StorageClassName: class,
},
Status: v1.PersistentVolumeClaimStatus{
Phase: phase,
@@ -755,8 +743,6 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.Persisten
claim.Annotations = make(map[string]string)
for _, a := range annotations {
switch a {
- case storageutil.StorageClassAnnotation:
- claim.Annotations[a] = "gold"
case annStorageProvisioner:
claim.Annotations[a] = mockPluginName
default:
@@ -778,23 +764,12 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.Persisten
// newClaimArray returns array with a single claim that would be returned by
// newClaim() with the same parameters.
-func newClaimArray(name, claimUID, capacity, boundToVolume string, phase v1.PersistentVolumeClaimPhase, annotations ...string) []*v1.PersistentVolumeClaim {
+func newClaimArray(name, claimUID, capacity, boundToVolume string, phase v1.PersistentVolumeClaimPhase, class *string, annotations ...string) []*v1.PersistentVolumeClaim {
return []*v1.PersistentVolumeClaim{
- newClaim(name, claimUID, capacity, boundToVolume, phase, annotations...),
+ newClaim(name, claimUID, capacity, boundToVolume, phase, class, annotations...),
}
}
-// claimWithClass saves given class into storage.StorageClassAnnotation annotation.
-// Meant to be used to compose claims specified inline in a test.
-func claimWithClass(className string, claims []*v1.PersistentVolumeClaim) []*v1.PersistentVolumeClaim {
- if claims[0].Annotations == nil {
- claims[0].Annotations = map[string]string{storageutil.StorageClassAnnotation: className}
- } else {
- claims[0].Annotations[storageutil.StorageClassAnnotation] = className
- }
- return claims
-}
-
// claimWithAnnotation saves given annotation into given claims.
// Meant to be used to compose claims specified inline in a test.
func claimWithAnnotation(name, value string, claims []*v1.PersistentVolumeClaim) []*v1.PersistentVolumeClaim {
@@ -828,6 +803,15 @@ type operationType string
const operationDelete = "Delete"
const operationRecycle = "Recycle"
+var (
+ classGold string = "gold"
+ classSilver string = "silver"
+ classEmpty string = ""
+ classNonExisting string = "non-existing"
+ classExternal string = "external"
+ classUnknownInternal string = "unknown-internal"
+)
+
// wrapTestWithPluginCalls returns a testCall that:
// - configures controller with a volume plugin that implements recycler,
// deleter and provisioner. The plugin retunrs provided errors when a volume
diff --git a/pkg/controller/volume/persistentvolume/index.go b/pkg/controller/volume/persistentvolume/index.go
index 059e33d927c..3d4f5c0b4f2 100644
--- a/pkg/controller/volume/persistentvolume/index.go
+++ b/pkg/controller/volume/persistentvolume/index.go
@@ -24,7 +24,6 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/pkg/api/v1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
)
// persistentVolumeOrderedIndex is a cache.Store that keeps persistent volumes
@@ -93,7 +92,7 @@ func (pvIndex *persistentVolumeOrderedIndex) findByClaim(claim *v1.PersistentVol
var smallestVolumeSize int64
requestedQty := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
requestedSize := requestedQty.Value()
- requestedClass := storageutil.GetClaimStorageClass(claim)
+ requestedClass := v1.GetPersistentVolumeClaimClass(claim)
var selector labels.Selector
if claim.Spec.Selector != nil {
@@ -134,7 +133,7 @@ func (pvIndex *persistentVolumeOrderedIndex) findByClaim(claim *v1.PersistentVol
// with existing PVs, findByClaim must find only PVs that are
// pre-bound to the claim (by dynamic provisioning). TODO: remove in
// 1.5
- if metav1.HasAnnotation(claim.ObjectMeta, storageutil.AlphaStorageClassAnnotation) {
+ if metav1.HasAnnotation(claim.ObjectMeta, v1.AlphaStorageClassAnnotation) {
continue
}
@@ -147,7 +146,7 @@ func (pvIndex *persistentVolumeOrderedIndex) findByClaim(claim *v1.PersistentVol
} else if selector != nil && !selector.Matches(labels.Set(volume.Labels)) {
continue
}
- if storageutil.GetVolumeStorageClass(volume) != requestedClass {
+ if v1.GetPersistentVolumeClass(volume) != requestedClass {
continue
}
diff --git a/pkg/controller/volume/persistentvolume/index_test.go b/pkg/controller/volume/persistentvolume/index_test.go
index b0e87e795b5..f8ffb7c07ba 100644
--- a/pkg/controller/volume/persistentvolume/index_test.go
+++ b/pkg/controller/volume/persistentvolume/index_test.go
@@ -25,7 +25,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/v1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
)
func makePVC(size string, modfn func(*v1.PersistentVolumeClaim)) *v1.PersistentVolumeClaim {
@@ -112,24 +111,20 @@ func TestMatchVolume(t *testing.T) {
"successful-match-with-class": {
expectedMatch: "gce-pd-silver1",
claim: makePVC("1G", func(pvc *v1.PersistentVolumeClaim) {
- pvc.ObjectMeta.Annotations = map[string]string{
- storageutil.StorageClassAnnotation: "silver",
- }
pvc.Spec.Selector = &metav1.LabelSelector{
MatchLabels: map[string]string{
"should-exist": "true",
},
}
pvc.Spec.AccessModes = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}
+ pvc.Spec.StorageClassName = &classSilver
}),
},
"successful-match-with-class-and-labels": {
expectedMatch: "gce-pd-silver2",
claim: makePVC("1G", func(pvc *v1.PersistentVolumeClaim) {
- pvc.ObjectMeta.Annotations = map[string]string{
- storageutil.StorageClassAnnotation: "silver",
- }
pvc.Spec.AccessModes = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}
+ pvc.Spec.StorageClassName = &classSilver
}),
},
}
@@ -542,9 +537,6 @@ func createTestVolumes() []*v1.PersistentVolume {
Labels: map[string]string{
"should-exist": "true",
},
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "silver",
- },
},
Spec: v1.PersistentVolumeSpec{
Capacity: v1.ResourceList{
@@ -556,15 +548,13 @@ func createTestVolumes() []*v1.PersistentVolume {
AccessModes: []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
},
+ StorageClassName: classSilver,
},
},
{
ObjectMeta: metav1.ObjectMeta{
UID: "gce-pd-silver2",
Name: "gce0024",
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "silver",
- },
},
Spec: v1.PersistentVolumeSpec{
Capacity: v1.ResourceList{
@@ -576,15 +566,13 @@ func createTestVolumes() []*v1.PersistentVolume {
AccessModes: []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
},
+ StorageClassName: classSilver,
},
},
{
ObjectMeta: metav1.ObjectMeta{
UID: "gce-pd-gold",
Name: "gce0025",
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "gold",
- },
},
Spec: v1.PersistentVolumeSpec{
Capacity: v1.ResourceList{
@@ -596,6 +584,7 @@ func createTestVolumes() []*v1.PersistentVolume {
AccessModes: []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
},
+ StorageClassName: classGold,
},
},
}
diff --git a/pkg/controller/volume/persistentvolume/provision_test.go b/pkg/controller/volume/persistentvolume/provision_test.go
index 83e802d6304..20996919f4e 100644
--- a/pkg/controller/volume/persistentvolume/provision_test.go
+++ b/pkg/controller/volume/persistentvolume/provision_test.go
@@ -23,7 +23,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
)
var class1Parameters = map[string]string{
@@ -109,10 +108,10 @@ func TestProvisionSync(t *testing.T) {
// Provision a volume (with a default class)
"11-1 - successful provision with storage class 1",
novolumes,
- newVolumeArray("pvc-uid11-1", "1Gi", "uid11-1", "claim11-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
+ newVolumeArray("pvc-uid11-1", "1Gi", "uid11-1", "claim11-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, &classGold),
// Binding will be completed in the next syncClaim
- newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Normal ProvisioningSucceeded"}, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision1Success}, testSyncClaim),
},
{
@@ -120,8 +119,8 @@ func TestProvisionSync(t *testing.T) {
"11-2 - plugin not found",
novolumes,
novolumes,
- newClaimArray("claim11-2", "uid11-2", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-2", "uid11-2", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
+ newClaimArray("claim11-2", "uid11-2", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-2", "uid11-2", "1Gi", "", v1.ClaimPending, &classGold),
[]string{"Warning ProvisioningFailed"}, noerrors,
testSyncClaim,
},
@@ -130,8 +129,8 @@ func TestProvisionSync(t *testing.T) {
"11-3 - newProvisioner failure",
novolumes,
novolumes,
- newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed"}, noerrors,
wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
@@ -140,18 +139,18 @@ func TestProvisionSync(t *testing.T) {
"11-4 - provision failure",
novolumes,
novolumes,
- newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed"}, noerrors,
wrapTestWithProvisionCalls([]provisionCall{provision1Error}, testSyncClaim),
},
{
// No provisioning if there is a matching volume available
"11-6 - provisioning when there is a volume available",
- newVolumeArray("volume11-6", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, storageutil.StorageClassAnnotation),
- newVolumeArray("volume11-6", "1Gi", "uid11-6", "claim11-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-6", "uid11-6", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-6", "uid11-6", "1Gi", "volume11-6", v1.ClaimBound, storageutil.StorageClassAnnotation, annBoundByController, annBindCompleted),
+ newVolumeArray("volume11-6", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classGold),
+ newVolumeArray("volume11-6", "1Gi", "uid11-6", "claim11-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classGold, annBoundByController),
+ newClaimArray("claim11-6", "uid11-6", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-6", "uid11-6", "1Gi", "volume11-6", v1.ClaimBound, &classGold, annBoundByController, annBindCompleted),
noevents, noerrors,
// No provisioning plugin confingure - makes the test fail when
// the controller errorneously tries to provision something
@@ -162,16 +161,16 @@ func TestProvisionSync(t *testing.T) {
// a volume.
"11-7 - claim is bound before provisioning",
novolumes,
- newVolumeArray("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
+ newVolumeArray("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, &classGold),
// The claim would be bound in next syncClaim
- newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
noevents, noerrors,
wrapTestWithInjectedOperation(wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim), func(ctrl *PersistentVolumeController, reactor *volumeReactor) {
// Create a volume before provisionClaimOperation starts.
// This similates a parallel controller provisioning the volume.
reactor.lock.Lock()
- volume := newVolume("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned, storageutil.StorageClassAnnotation)
+ volume := newVolume("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, annBoundByController, annDynamicallyProvisioned)
reactor.volumes[volume.Name] = volume
reactor.lock.Unlock()
}),
@@ -181,10 +180,10 @@ func TestProvisionSync(t *testing.T) {
// second retry succeeds
"11-8 - cannot save provisioned volume",
novolumes,
- newVolumeArray("pvc-uid11-8", "1Gi", "uid11-8", "claim11-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
+ newVolumeArray("pvc-uid11-8", "1Gi", "uid11-8", "claim11-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, &classGold),
// Binding will be completed in the next syncClaim
- newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Normal ProvisioningSucceeded"},
[]reactorError{
// Inject error to the first
@@ -200,8 +199,8 @@ func TestProvisionSync(t *testing.T) {
"11-9 - cannot save provisioned volume, delete succeeds",
novolumes,
novolumes,
- newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed"},
[]reactorError{
// Inject error to five kubeclient.PersistentVolumes.Create()
@@ -225,8 +224,8 @@ func TestProvisionSync(t *testing.T) {
"11-10 - cannot save provisioned volume, no delete plugin found",
novolumes,
novolumes,
- newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed", "Warning ProvisioningCleanupFailed"},
[]reactorError{
// Inject error to five kubeclient.PersistentVolumes.Create()
@@ -246,8 +245,8 @@ func TestProvisionSync(t *testing.T) {
"11-11 - cannot save provisioned volume, deleter fails",
novolumes,
novolumes,
- newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed", "Warning ProvisioningCleanupFailed"},
[]reactorError{
// Inject error to five kubeclient.PersistentVolumes.Create()
@@ -276,8 +275,8 @@ func TestProvisionSync(t *testing.T) {
"11-12 - cannot save provisioned volume, delete succeeds 2nd time",
novolumes,
novolumes,
- newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, &classGold, annStorageProvisioner),
[]string{"Warning ProvisioningFailed"},
[]reactorError{
// Inject error to five kubeclient.PersistentVolumes.Create()
@@ -302,10 +301,10 @@ func TestProvisionSync(t *testing.T) {
// Provision a volume (with non-default class)
"11-13 - successful provision with storage class 2",
novolumes,
- volumeWithClass("silver", newVolumeArray("pvc-uid11-13", "1Gi", "uid11-13", "claim11-13", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned)),
- claimWithClass("silver", newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending)),
+ newVolumeArray("pvc-uid11-13", "1Gi", "uid11-13", "claim11-13", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classSilver, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, &classSilver),
// Binding will be completed in the next syncClaim
- claimWithClass("silver", newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, annStorageProvisioner)),
+ newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, &classSilver, annStorageProvisioner),
[]string{"Normal ProvisioningSucceeded"}, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision2Success}, testSyncClaim),
},
{
@@ -313,8 +312,8 @@ func TestProvisionSync(t *testing.T) {
"11-14 - fail due to non-existing class",
novolumes,
novolumes,
- claimWithClass("non-existing", newClaimArray("claim11-14", "uid11-14", "1Gi", "", v1.ClaimPending)),
- claimWithClass("non-existing", newClaimArray("claim11-14", "uid11-14", "1Gi", "", v1.ClaimPending)),
+ newClaimArray("claim11-14", "uid11-14", "1Gi", "", v1.ClaimPending, &classNonExisting),
+ newClaimArray("claim11-14", "uid11-14", "1Gi", "", v1.ClaimPending, &classNonExisting),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
{
@@ -322,8 +321,8 @@ func TestProvisionSync(t *testing.T) {
"11-15 - no provisioning with class=''",
novolumes,
novolumes,
- claimWithClass("", newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending)),
- claimWithClass("", newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending)),
+ newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending, &classEmpty),
+ newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending, &classEmpty),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
{
@@ -331,8 +330,8 @@ func TestProvisionSync(t *testing.T) {
"11-16 - no provisioning with class=nil",
novolumes,
novolumes,
- newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending),
+ newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim11-15", "uid11-15", "1Gi", "", v1.ClaimPending, nil),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
{
@@ -340,9 +339,9 @@ func TestProvisionSync(t *testing.T) {
"11-17 - external provisioner",
novolumes,
novolumes,
- claimWithClass("external", newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending)),
+ newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending, &classExternal),
claimWithAnnotation(annStorageProvisioner, "vendor.com/my-volume",
- claimWithClass("external", newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending))),
+ newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending, &classExternal)),
[]string{"Normal ExternalProvisioning"},
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
@@ -351,8 +350,8 @@ func TestProvisionSync(t *testing.T) {
"11-18 - unknown internal provisioner",
novolumes,
novolumes,
- claimWithClass("unknown-internal", newClaimArray("claim11-18", "uid11-18", "1Gi", "", v1.ClaimPending)),
- claimWithClass("unknown-internal", newClaimArray("claim11-18", "uid11-18", "1Gi", "", v1.ClaimPending)),
+ newClaimArray("claim11-18", "uid11-18", "1Gi", "", v1.ClaimPending, &classUnknownInternal),
+ newClaimArray("claim11-18", "uid11-18", "1Gi", "", v1.ClaimPending, &classUnknownInternal),
[]string{"Warning ProvisioningFailed"},
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
@@ -366,24 +365,24 @@ func TestAlphaProvisionSync(t *testing.T) {
// Provision a volume with alpha annotation
"14-1 - successful alpha provisioning",
novolumes,
- newVolumeArray("pvc-uid14-1", "1Gi", "uid14-1", "claim14-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned),
- newClaimArray("claim14-1", "uid14-1", "1Gi", "", v1.ClaimPending, storageutil.AlphaStorageClassAnnotation),
+ newVolumeArray("pvc-uid14-1", "1Gi", "uid14-1", "claim14-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim14-1", "uid14-1", "1Gi", "", v1.ClaimPending, nil, v1.AlphaStorageClassAnnotation),
// Binding will be completed in the next syncClaim
- newClaimArray("claim14-1", "uid14-1", "1Gi", "", v1.ClaimPending, storageutil.AlphaStorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim14-1", "uid14-1", "1Gi", "", v1.ClaimPending, nil, v1.AlphaStorageClassAnnotation, annStorageProvisioner),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{provisionAlphaSuccess}, testSyncClaim),
},
{
// Provision success - there is already a volume available, still
// we provision a new one when requested.
"14-2 - no alpha provisioning when there is a volume available",
- newVolumeArray("volume14-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
+ newVolumeArray("volume14-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
[]*v1.PersistentVolume{
- newVolume("volume14-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain),
- newVolume("pvc-uid14-2", "1Gi", "uid14-2", "claim14-2", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned),
+ newVolume("volume14-2", "1Gi", "", "", v1.VolumePending, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolume("pvc-uid14-2", "1Gi", "uid14-2", "claim14-2", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, annBoundByController, annDynamicallyProvisioned),
},
- newClaimArray("claim14-2", "uid14-2", "1Gi", "", v1.ClaimPending, storageutil.AlphaStorageClassAnnotation),
+ newClaimArray("claim14-2", "uid14-2", "1Gi", "", v1.ClaimPending, nil, v1.AlphaStorageClassAnnotation),
// Binding will be completed in the next syncClaim
- newClaimArray("claim14-2", "uid14-2", "1Gi", "", v1.ClaimPending, storageutil.AlphaStorageClassAnnotation, annStorageProvisioner),
+ newClaimArray("claim14-2", "uid14-2", "1Gi", "", v1.ClaimPending, nil, v1.AlphaStorageClassAnnotation, annStorageProvisioner),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{provisionAlphaSuccess}, testSyncClaim),
},
}
@@ -410,9 +409,9 @@ func TestProvisionMultiSync(t *testing.T) {
// Provision a volume with binding
"12-1 - successful provision",
novolumes,
- newVolumeArray("pvc-uid12-1", "1Gi", "uid12-1", "claim12-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, annBoundByController, annDynamicallyProvisioned, storageutil.StorageClassAnnotation),
- newClaimArray("claim12-1", "uid12-1", "1Gi", "", v1.ClaimPending, storageutil.StorageClassAnnotation),
- newClaimArray("claim12-1", "uid12-1", "1Gi", "pvc-uid12-1", v1.ClaimBound, storageutil.StorageClassAnnotation, annBoundByController, annBindCompleted, annStorageProvisioner),
+ newVolumeArray("pvc-uid12-1", "1Gi", "uid12-1", "claim12-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, annBoundByController, annDynamicallyProvisioned),
+ newClaimArray("claim12-1", "uid12-1", "1Gi", "", v1.ClaimPending, &classGold),
+ newClaimArray("claim12-1", "uid12-1", "1Gi", "pvc-uid12-1", v1.ClaimBound, &classGold, annBoundByController, annBindCompleted, annStorageProvisioner),
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision1Success}, testSyncClaim),
},
}
diff --git a/pkg/controller/volume/persistentvolume/pv_controller.go b/pkg/controller/volume/persistentvolume/pv_controller.go
index 6e42e1920b4..c3385a5483c 100644
--- a/pkg/controller/volume/persistentvolume/pv_controller.go
+++ b/pkg/controller/volume/persistentvolume/pv_controller.go
@@ -29,7 +29,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
corelisters "k8s.io/kubernetes/pkg/client/listers/core/v1"
storagelisters "k8s.io/kubernetes/pkg/client/listers/storage/v1beta1"
@@ -244,7 +243,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
glog.V(4).Infof("synchronizing unbound PersistentVolumeClaim[%s]: no volume found", claimToClaimKey(claim))
// No PV could be found
// OBSERVATION: pvc is "Pending", will retry
- if storageutil.GetClaimStorageClass(claim) != "" || metav1.HasAnnotation(claim.ObjectMeta, storageutil.AlphaStorageClassAnnotation) {
+ if v1.GetPersistentVolumeClaimClass(claim) != "" || metav1.HasAnnotation(claim.ObjectMeta, v1.AlphaStorageClassAnnotation) {
if err = ctrl.provisionClaim(claim); err != nil {
return err
}
@@ -1224,7 +1223,7 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
return
}
- claimClass := storageutil.GetClaimStorageClass(claim)
+ claimClass := v1.GetPersistentVolumeClaimClass(claim)
glog.V(4).Infof("provisionClaimOperation [%s] started, class: %q", claimToClaimKey(claim), claimClass)
plugin, storageClass, err := ctrl.findProvisionablePlugin(claim)
@@ -1332,7 +1331,7 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
// by storage.AlphaStorageClassAnnotation
// TODO: remove this check in 1.5, storage.StorageClassAnnotation will be always non-empty there.
if claimClass != "" {
- metav1.SetMetaDataAnnotation(&volume.ObjectMeta, storageutil.StorageClassAnnotation, claimClass)
+ volume.Spec.StorageClassName = claimClass
}
// Try to create the PV object several times
@@ -1439,12 +1438,12 @@ func (ctrl *PersistentVolumeController) newRecyclerEventRecorder(volume *v1.Pers
// provisioner is requested.
func (ctrl *PersistentVolumeController) findProvisionablePlugin(claim *v1.PersistentVolumeClaim) (vol.ProvisionableVolumePlugin, *storage.StorageClass, error) {
// TODO: remove this alpha behavior in 1.5
- alpha := metav1.HasAnnotation(claim.ObjectMeta, storageutil.AlphaStorageClassAnnotation)
- beta := metav1.HasAnnotation(claim.ObjectMeta, storageutil.BetaStorageClassAnnotation)
- if alpha && beta {
- // Both Alpha and Beta annotations are set. Do beta.
+ alpha := metav1.HasAnnotation(claim.ObjectMeta, v1.AlphaStorageClassAnnotation)
+ if alpha && v1.PersistentVolumeClaimHasClass(claim) {
+ // Both Alpha annotation and storage class name is set. Use the storage
+ // class name.
alpha = false
- msg := fmt.Sprintf("both %q and %q annotations are present, using %q", storageutil.AlphaStorageClassAnnotation, storageutil.BetaStorageClassAnnotation, storageutil.BetaStorageClassAnnotation)
+ msg := fmt.Sprintf("both %q annotation and storageClassName are present, using storageClassName", v1.AlphaStorageClassAnnotation)
ctrl.eventRecorder.Event(claim, v1.EventTypeNormal, "ProvisioningIgnoreAlpha", msg)
}
if alpha {
@@ -1454,7 +1453,7 @@ func (ctrl *PersistentVolumeController) findProvisionablePlugin(claim *v1.Persis
// provisionClaim() which leads here is never called with claimClass=="", we
// can save some checks.
- claimClass := storageutil.GetClaimStorageClass(claim)
+ claimClass := v1.GetPersistentVolumeClaimClass(claim)
class, err := ctrl.classLister.Get(claimClass)
if err != nil {
return nil, nil, err
diff --git a/pkg/controller/volume/persistentvolume/pv_controller_test.go b/pkg/controller/volume/persistentvolume/pv_controller_test.go
index 903b0b3610f..caa29acfbbf 100644
--- a/pkg/controller/volume/persistentvolume/pv_controller_test.go
+++ b/pkg/controller/volume/persistentvolume/pv_controller_test.go
@@ -45,14 +45,14 @@ func TestControllerSync(t *testing.T) {
{
// addClaim gets a new claim. Check it's bound to a volume.
"5-2 - complete bind",
- newVolumeArray("volume5-2", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain),
- newVolumeArray("volume5-2", "1Gi", "uid5-2", "claim5-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
+ newVolumeArray("volume5-2", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classEmpty),
+ newVolumeArray("volume5-2", "1Gi", "uid5-2", "claim5-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
noclaims, /* added in testAddClaim5_2 */
- newClaimArray("claim5-2", "uid5-2", "1Gi", "volume5-2", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newClaimArray("claim5-2", "uid5-2", "1Gi", "volume5-2", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noevents, noerrors,
// Custom test function that generates an add event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
- claim := newClaim("claim5-2", "uid5-2", "1Gi", "", v1.ClaimPending)
+ claim := newClaim("claim5-2", "uid5-2", "1Gi", "", v1.ClaimPending, nil)
reactor.addClaimEvent(claim)
return nil
},
@@ -60,9 +60,9 @@ func TestControllerSync(t *testing.T) {
{
// deleteClaim with a bound claim makes bound volume released.
"5-3 - delete claim",
- newVolumeArray("volume5-3", "10Gi", "uid5-3", "claim5-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newVolumeArray("volume5-3", "10Gi", "uid5-3", "claim5-3", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, annBoundByController),
- newClaimArray("claim5-3", "uid5-3", "1Gi", "volume5-3", v1.ClaimBound, annBoundByController, annBindCompleted),
+ newVolumeArray("volume5-3", "10Gi", "uid5-3", "claim5-3", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newVolumeArray("volume5-3", "10Gi", "uid5-3", "claim5-3", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, classEmpty, annBoundByController),
+ newClaimArray("claim5-3", "uid5-3", "1Gi", "volume5-3", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
noclaims,
noevents, noerrors,
// Custom test function that generates a delete event
@@ -76,10 +76,10 @@ func TestControllerSync(t *testing.T) {
{
// deleteVolume with a bound volume. Check the claim is Lost.
"5-4 - delete volume",
- newVolumeArray("volume5-4", "1Gi", "uid5-4", "claim5-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain),
+ newVolumeArray("volume5-4", "1Gi", "uid5-4", "claim5-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classEmpty),
novolumes,
- newClaimArray("claim5-4", "uid5-4", "1Gi", "volume5-4", v1.ClaimBound, annBoundByController, annBindCompleted),
- newClaimArray("claim5-4", "uid5-4", "1Gi", "volume5-4", v1.ClaimLost, annBoundByController, annBindCompleted),
+ newClaimArray("claim5-4", "uid5-4", "1Gi", "volume5-4", v1.ClaimBound, nil, annBoundByController, annBindCompleted),
+ newClaimArray("claim5-4", "uid5-4", "1Gi", "volume5-4", v1.ClaimLost, nil, annBoundByController, annBindCompleted),
[]string{"Warning ClaimLost"}, noerrors,
// Custom test function that generates a delete event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
@@ -94,13 +94,13 @@ func TestControllerSync(t *testing.T) {
// is expected - it should stay bound.
"5-5 - add bound volume from 1.2",
novolumes,
- []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-5", "1Gi", "uid5-5", "claim5-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
- newClaimArray("claim5-5", "uid5-5", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim5-5", "uid5-5", "1Gi", "volume5-5", v1.ClaimBound, annBindCompleted, annBoundByController),
+ []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-5", "1Gi", "uid5-5", "claim5-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
+ newClaimArray("claim5-5", "uid5-5", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim5-5", "uid5-5", "1Gi", "volume5-5", v1.ClaimBound, nil, annBindCompleted, annBoundByController),
noevents, noerrors,
// Custom test function that generates a add event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
- volume := newVolume("volume5-5", "1Gi", "uid5-5", "claim5-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete)
+ volume := newVolume("volume5-5", "1Gi", "uid5-5", "claim5-5", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty)
volume = addVolumeAnnotation(volume, pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)
reactor.addVolumeEvent(volume)
return nil
@@ -110,14 +110,14 @@ func TestControllerSync(t *testing.T) {
// updateVolume with provisioned volume from Kubernetes 1.2. No
// "action" is expected - it should stay bound.
"5-6 - update bound volume from 1.2",
- []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
- []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
- newClaimArray("claim5-6", "uid5-6", "1Gi", "volume5-6", v1.ClaimBound),
- newClaimArray("claim5-6", "uid5-6", "1Gi", "volume5-6", v1.ClaimBound, annBindCompleted),
+ []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
+ []*v1.PersistentVolume{addVolumeAnnotation(newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty), pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)},
+ newClaimArray("claim5-6", "uid5-6", "1Gi", "volume5-6", v1.ClaimBound, nil),
+ newClaimArray("claim5-6", "uid5-6", "1Gi", "volume5-6", v1.ClaimBound, nil, annBindCompleted),
noevents, noerrors,
// Custom test function that generates a add event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
- volume := newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete)
+ volume := newVolume("volume5-6", "1Gi", "uid5-6", "claim5-6", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty)
volume = addVolumeAnnotation(volume, pvProvisioningRequiredAnnotationKey, pvProvisioningCompletedAnnotationValue)
reactor.modifyVolumeEvent(volume)
return nil
@@ -129,12 +129,12 @@ func TestControllerSync(t *testing.T) {
"5-7 - add unprovisioned volume from 1.2",
novolumes,
novolumes,
- newClaimArray("claim5-7", "uid5-7", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim5-7", "uid5-7", "1Gi", "", v1.ClaimPending),
+ newClaimArray("claim5-7", "uid5-7", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim5-7", "uid5-7", "1Gi", "", v1.ClaimPending, nil),
noevents, noerrors,
// Custom test function that generates a add event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
- volume := newVolume("volume5-7", "1Gi", "uid5-7", "claim5-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete)
+ volume := newVolume("volume5-7", "1Gi", "uid5-7", "claim5-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty)
volume = addVolumeAnnotation(volume, pvProvisioningRequiredAnnotationKey, "yes")
reactor.addVolumeEvent(volume)
return nil
@@ -146,12 +146,12 @@ func TestControllerSync(t *testing.T) {
"5-8 - update bound volume from 1.2",
novolumes,
novolumes,
- newClaimArray("claim5-8", "uid5-8", "1Gi", "", v1.ClaimPending),
- newClaimArray("claim5-8", "uid5-8", "1Gi", "", v1.ClaimPending),
+ newClaimArray("claim5-8", "uid5-8", "1Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim5-8", "uid5-8", "1Gi", "", v1.ClaimPending, nil),
noevents, noerrors,
// Custom test function that generates a add event
func(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
- volume := newVolume("volume5-8", "1Gi", "uid5-8", "claim5-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete)
+ volume := newVolume("volume5-8", "1Gi", "uid5-8", "claim5-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty)
volume = addVolumeAnnotation(volume, pvProvisioningRequiredAnnotationKey, "yes")
reactor.modifyVolumeEvent(volume)
return nil
@@ -224,7 +224,7 @@ func TestControllerSync(t *testing.T) {
}
func storeVersion(t *testing.T, prefix string, c cache.Store, version string, expectedReturn bool) {
- pv := newVolume("pvName", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete)
+ pv := newVolume("pvName", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classEmpty)
pv.ResourceVersion = version
ret, err := storeObjectUpdate(c, pv, "volume")
if err != nil {
@@ -283,7 +283,7 @@ func TestControllerCacheParsingError(t *testing.T) {
// There must be something in the cache to compare with
storeVersion(t, "Step1", c, "1", true)
- pv := newVolume("pvName", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete)
+ pv := newVolume("pvName", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classEmpty)
pv.ResourceVersion = "xxx"
_, err := storeObjectUpdate(c, pv, "volume")
if err == nil {
diff --git a/pkg/controller/volume/persistentvolume/recycle_test.go b/pkg/controller/volume/persistentvolume/recycle_test.go
index 86681c52587..8566a898c0a 100644
--- a/pkg/controller/volume/persistentvolume/recycle_test.go
+++ b/pkg/controller/volume/persistentvolume/recycle_test.go
@@ -33,8 +33,8 @@ func TestRecycleSync(t *testing.T) {
{
// recycle volume bound by controller
"6-1 - successful recycle",
- newVolumeArray("volume6-1", "1Gi", "uid6-1", "claim6-1", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, annBoundByController),
- newVolumeArray("volume6-1", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume6-1", "1Gi", "uid6-1", "claim6-1", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty, annBoundByController),
+ newVolumeArray("volume6-1", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
noclaims,
noclaims,
noevents, noerrors,
@@ -45,8 +45,8 @@ func TestRecycleSync(t *testing.T) {
{
// recycle volume bound by user
"6-2 - successful recycle with prebound volume",
- newVolumeArray("volume6-2", "1Gi", "uid6-2", "claim6-2", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- newVolumeArray("volume6-2", "1Gi", "", "claim6-2", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume6-2", "1Gi", "uid6-2", "claim6-2", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ newVolumeArray("volume6-2", "1Gi", "", "claim6-2", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
noclaims,
noclaims,
noevents, noerrors,
@@ -57,8 +57,8 @@ func TestRecycleSync(t *testing.T) {
{
// recycle failure - plugin not found
"6-3 - plugin not found",
- newVolumeArray("volume6-3", "1Gi", "uid6-3", "claim6-3", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- withMessage("No recycler plugin found for the volume!", newVolumeArray("volume6-3", "1Gi", "uid6-3", "claim6-3", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle)),
+ newVolumeArray("volume6-3", "1Gi", "uid6-3", "claim6-3", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ withMessage("No recycler plugin found for the volume!", newVolumeArray("volume6-3", "1Gi", "uid6-3", "claim6-3", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedRecycle"}, noerrors, testSyncVolume,
@@ -66,8 +66,8 @@ func TestRecycleSync(t *testing.T) {
{
// recycle failure - Recycle returns error
"6-4 - newRecycler returns error",
- newVolumeArray("volume6-4", "1Gi", "uid6-4", "claim6-4", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- withMessage("Recycle failed: Mock plugin error: no recycleCalls configured", newVolumeArray("volume6-4", "1Gi", "uid6-4", "claim6-4", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle)),
+ newVolumeArray("volume6-4", "1Gi", "uid6-4", "claim6-4", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ withMessage("Recycle failed: Mock plugin error: no recycleCalls configured", newVolumeArray("volume6-4", "1Gi", "uid6-4", "claim6-4", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedRecycle"}, noerrors,
@@ -76,8 +76,8 @@ func TestRecycleSync(t *testing.T) {
{
// recycle failure - recycle returns error
"6-5 - recycle returns error",
- newVolumeArray("volume6-5", "1Gi", "uid6-5", "claim6-5", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- withMessage("Recycle failed: Mock recycle error", newVolumeArray("volume6-5", "1Gi", "uid6-5", "claim6-5", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle)),
+ newVolumeArray("volume6-5", "1Gi", "uid6-5", "claim6-5", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ withMessage("Recycle failed: Mock recycle error", newVolumeArray("volume6-5", "1Gi", "uid6-5", "claim6-5", v1.VolumeFailed, v1.PersistentVolumeReclaimRecycle, classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeFailedRecycle"}, noerrors,
@@ -86,7 +86,7 @@ func TestRecycleSync(t *testing.T) {
{
// recycle success(?) - volume is deleted before doRecycle() starts
"6-6 - volume is deleted before recycling",
- newVolumeArray("volume6-6", "1Gi", "uid6-6", "claim6-6", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume6-6", "1Gi", "uid6-6", "claim6-6", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
novolumes,
noclaims,
noclaims,
@@ -103,8 +103,8 @@ func TestRecycleSync(t *testing.T) {
// at the time new doRecycle() starts. This simulates "volume no
// longer needs recycling, skipping".
"6-7 - volume is deleted before recycling",
- newVolumeArray("volume6-7", "1Gi", "uid6-7", "claim6-7", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, annBoundByController),
- newVolumeArray("volume6-7", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume6-7", "1Gi", "uid6-7", "claim6-7", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty, annBoundByController),
+ newVolumeArray("volume6-7", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
noclaims,
noclaims,
noevents, noerrors,
@@ -124,8 +124,8 @@ func TestRecycleSync(t *testing.T) {
// "volume no longer needs recycling, skipping" with volume bound by
// user.
"6-8 - prebound volume is deleted before recycling",
- newVolumeArray("volume6-8", "1Gi", "uid6-8", "claim6-8", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- newVolumeArray("volume6-8", "1Gi", "", "claim6-8", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume6-8", "1Gi", "uid6-8", "claim6-8", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ newVolumeArray("volume6-8", "1Gi", "", "claim6-8", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
noclaims,
noclaims,
noevents, noerrors,
@@ -142,10 +142,10 @@ func TestRecycleSync(t *testing.T) {
// recycle success - volume bound by user is recycled, while a new
// claim is created with another UID.
"6-9 - prebound volume is recycled while the claim exists",
- newVolumeArray("volume6-9", "1Gi", "uid6-9", "claim6-9", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- newVolumeArray("volume6-9", "1Gi", "", "claim6-9", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
- newClaimArray("claim6-9", "uid6-9-x", "10Gi", "", v1.ClaimPending),
- newClaimArray("claim6-9", "uid6-9-x", "10Gi", "", v1.ClaimPending),
+ newVolumeArray("volume6-9", "1Gi", "uid6-9", "claim6-9", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ newVolumeArray("volume6-9", "1Gi", "", "claim6-9", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ newClaimArray("claim6-9", "uid6-9-x", "10Gi", "", v1.ClaimPending, nil),
+ newClaimArray("claim6-9", "uid6-9-x", "10Gi", "", v1.ClaimPending, nil),
noevents, noerrors,
// Inject recycler into the controller and call syncVolume. The
// recycler simulates one recycle() call that succeeds.
@@ -154,8 +154,8 @@ func TestRecycleSync(t *testing.T) {
{
// volume has unknown reclaim policy - failure expected
"6-10 - unknown reclaim policy",
- newVolumeArray("volume6-10", "1Gi", "uid6-10", "claim6-10", v1.VolumeBound, "Unknown"),
- withMessage("Volume has unrecognized PersistentVolumeReclaimPolicy", newVolumeArray("volume6-10", "1Gi", "uid6-10", "claim6-10", v1.VolumeFailed, "Unknown")),
+ newVolumeArray("volume6-10", "1Gi", "uid6-10", "claim6-10", v1.VolumeBound, "Unknown", classEmpty),
+ withMessage("Volume has unrecognized PersistentVolumeReclaimPolicy", newVolumeArray("volume6-10", "1Gi", "uid6-10", "claim6-10", v1.VolumeFailed, "Unknown", classEmpty)),
noclaims,
noclaims,
[]string{"Warning VolumeUnknownReclaimPolicy"}, noerrors, testSyncVolume,
@@ -184,8 +184,8 @@ func TestRecycleMultiSync(t *testing.T) {
// recycle failure - recycle returns error. The controller should
// try again.
"7-1 - recycle returns error",
- newVolumeArray("volume7-1", "1Gi", "uid7-1", "claim7-1", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle),
- newVolumeArray("volume7-1", "1Gi", "", "claim7-1", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle),
+ newVolumeArray("volume7-1", "1Gi", "uid7-1", "claim7-1", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty),
+ newVolumeArray("volume7-1", "1Gi", "", "claim7-1", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
noclaims,
noclaims,
[]string{"Warning VolumeFailedRecycle"}, noerrors,
diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go
index c87a3ea0afb..12efac64cca 100644
--- a/pkg/generated/openapi/zz_generated.openapi.go
+++ b/pkg/generated/openapi/zz_generated.openapi.go
@@ -17840,6 +17840,104 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "k8s.io/kubernetes/pkg/api/v1.EnvFromSource", "k8s.io/kubernetes/pkg/api/v1.EnvVar", "k8s.io/kubernetes/pkg/api/v1.Volume", "k8s.io/kubernetes/pkg/api/v1.VolumeMount"},
},
+ "k8s.io/kubernetes/pkg/apis/storage/v1.StorageClass": {
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "provisioner": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Provisioner indicates the type of the provisioner.",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "parameters": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
+ Type: []string{"object"},
+ AdditionalProperties: &spec.SchemaOrBool{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"provisioner"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
+ },
+ "k8s.io/kubernetes/pkg/apis/storage/v1.StorageClassList": {
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "StorageClassList is a collection of storage classes.",
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Items is the list of StorageClasses",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Ref: ref("k8s.io/kubernetes/pkg/apis/storage/v1.StorageClass"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"items"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/kubernetes/pkg/apis/storage/v1.StorageClass"},
+ },
"k8s.io/kubernetes/pkg/apis/storage/v1beta1.StorageClass": {
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
diff --git a/pkg/master/BUILD b/pkg/master/BUILD
index 8563986d180..2d8f3aaf1f4 100644
--- a/pkg/master/BUILD
+++ b/pkg/master/BUILD
@@ -51,6 +51,7 @@ go_library(
"//pkg/apis/settings/install:go_default_library",
"//pkg/apis/settings/v1alpha1:go_default_library",
"//pkg/apis/storage/install:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/core/v1:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/core/internalversion:go_default_library",
diff --git a/pkg/master/master.go b/pkg/master/master.go
index c50b5224ec5..ea0f87232b3 100644
--- a/pkg/master/master.go
+++ b/pkg/master/master.go
@@ -46,6 +46,7 @@ import (
rbacapi "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1"
rbacv1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
settingsapi "k8s.io/kubernetes/pkg/apis/settings/v1alpha1"
+ storageapiv1 "k8s.io/kubernetes/pkg/apis/storage/v1"
storageapiv1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
corev1client "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1"
coreclient "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion"
@@ -375,6 +376,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
rbacv1beta1.SchemeGroupVersion,
rbacapi.SchemeGroupVersion,
settingsapi.SchemeGroupVersion,
+ storageapiv1.SchemeGroupVersion,
storageapiv1beta1.SchemeGroupVersion,
certificatesapiv1beta1.SchemeGroupVersion,
authorizationapiv1.SchemeGroupVersion,
diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go
index 4baec3c7cb1..30d68d3f2da 100644
--- a/pkg/printers/internalversion/describe.go
+++ b/pkg/printers/internalversion/describe.go
@@ -812,7 +812,7 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
w.Write(LEVEL_0, "Name:\t%s\n", pv.Name)
printLabelsMultiline(w, "Labels", pv.Labels)
printAnnotationsMultiline(w, "Annotations", pv.Annotations)
- w.Write(LEVEL_0, "StorageClass:\t%s\n", storageutil.GetStorageClassAnnotation(pv.ObjectMeta))
+ w.Write(LEVEL_0, "StorageClass:\t%s\n", api.GetPersistentVolumeClass(pv))
w.Write(LEVEL_0, "Status:\t%s\n", pv.Status.Phase)
if pv.Spec.ClaimRef != nil {
w.Write(LEVEL_0, "Claim:\t%s\n", pv.Spec.ClaimRef.Namespace+"/"+pv.Spec.ClaimRef.Name)
@@ -889,7 +889,7 @@ func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string, descri
w := &PrefixWriter{out}
w.Write(LEVEL_0, "Name:\t%s\n", pvc.Name)
w.Write(LEVEL_0, "Namespace:\t%s\n", pvc.Namespace)
- w.Write(LEVEL_0, "StorageClass:\t%s\n", storageutil.GetStorageClassAnnotation(pvc.ObjectMeta))
+ w.Write(LEVEL_0, "StorageClass:\t%s\n", api.GetPersistentVolumeClaimClass(pvc))
w.Write(LEVEL_0, "Status:\t%v\n", pvc.Status.Phase)
w.Write(LEVEL_0, "Volume:\t%s\n", pvc.Spec.VolumeName)
printLabelsMultiline(w, "Labels", pvc.Labels)
diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go
index a4c88f4a3e8..0c264d71fdb 100644
--- a/pkg/printers/internalversion/printers.go
+++ b/pkg/printers/internalversion/printers.go
@@ -1179,7 +1179,7 @@ func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options printe
aSize, modesStr, reclaimPolicyStr,
pv.Status.Phase,
claimRefUID,
- storageutil.GetStorageClassAnnotation(pv.ObjectMeta),
+ api.GetPersistentVolumeClass(pv),
pv.Status.Reason,
translateTimestamp(pv.CreationTimestamp),
); err != nil {
@@ -1222,7 +1222,7 @@ func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, opt
capacity = storage.String()
}
- if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", name, phase, pvc.Spec.VolumeName, capacity, accessModes, storageutil.GetStorageClassAnnotation(pvc.ObjectMeta), translateTimestamp(pvc.CreationTimestamp)); err != nil {
+ if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", name, phase, pvc.Spec.VolumeName, capacity, accessModes, api.GetPersistentVolumeClaimClass(pvc), translateTimestamp(pvc.CreationTimestamp)); err != nil {
return err
}
if _, err := fmt.Fprint(w, AppendLabels(pvc.Labels, options.ColumnLabels)); err != nil {
diff --git a/pkg/quota/evaluator/core/BUILD b/pkg/quota/evaluator/core/BUILD
index 7e6a4ccae30..6da27aad59f 100644
--- a/pkg/quota/evaluator/core/BUILD
+++ b/pkg/quota/evaluator/core/BUILD
@@ -26,7 +26,6 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/api/validation:go_default_library",
- "//pkg/apis/storage/util:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/informers/informers_generated/externalversions:go_default_library",
"//pkg/kubelet/qos:go_default_library",
@@ -53,7 +52,6 @@ go_test(
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
- "//pkg/apis/storage/util:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/quota:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/api/resource",
diff --git a/pkg/quota/evaluator/core/persistent_volume_claims.go b/pkg/quota/evaluator/core/persistent_volume_claims.go
index 0cae054d8d0..09ebb79c3ef 100644
--- a/pkg/quota/evaluator/core/persistent_volume_claims.go
+++ b/pkg/quota/evaluator/core/persistent_volume_claims.go
@@ -28,7 +28,6 @@ import (
"k8s.io/apiserver/pkg/admission"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
- "k8s.io/kubernetes/pkg/apis/storage/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
"k8s.io/kubernetes/pkg/quota"
@@ -105,7 +104,7 @@ func (p *pvcEvaluator) Constraints(required []api.ResourceName, item runtime.Obj
// these are the items that we will be handling based on the objects actual storage-class
pvcRequiredSet := append([]api.ResourceName{}, pvcResources...)
- if storageClassRef := util.GetClaimStorageClass(pvc); len(storageClassRef) > 0 {
+ if storageClassRef := api.GetPersistentVolumeClaimClass(pvc); len(storageClassRef) > 0 {
pvcRequiredSet = append(pvcRequiredSet, ResourceByStorageClass(storageClassRef, api.ResourcePersistentVolumeClaims))
pvcRequiredSet = append(pvcRequiredSet, ResourceByStorageClass(storageClassRef, api.ResourceRequestsStorage))
}
@@ -176,7 +175,7 @@ func (p *pvcEvaluator) Usage(item runtime.Object) (api.ResourceList, error) {
if err != nil {
return result, err
}
- storageClassRef := util.GetClaimStorageClass(pvc)
+ storageClassRef := api.GetPersistentVolumeClaimClass(pvc)
// charge for claim
result[api.ResourcePersistentVolumeClaims] = resource.MustParse("1")
diff --git a/pkg/quota/evaluator/core/persistent_volume_claims_test.go b/pkg/quota/evaluator/core/persistent_volume_claims_test.go
index 9384c19a84b..64241edbbeb 100644
--- a/pkg/quota/evaluator/core/persistent_volume_claims_test.go
+++ b/pkg/quota/evaluator/core/persistent_volume_claims_test.go
@@ -22,7 +22,6 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
- "k8s.io/kubernetes/pkg/apis/storage/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"
"k8s.io/kubernetes/pkg/quota"
)
@@ -35,6 +34,9 @@ func testVolumeClaim(name string, namespace string, spec api.PersistentVolumeCla
}
func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
+ classGold := "gold"
+ classBronze := "bronze"
+
validClaim := testVolumeClaim("foo", "ns", api.PersistentVolumeClaimSpec{
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -72,10 +74,8 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
api.ResourceName(api.ResourceStorage): resource.MustParse("10Gi"),
},
},
+ StorageClassName: &classGold,
})
- validClaimGoldStorageClass.Annotations = map[string]string{
- util.StorageClassAnnotation: "gold",
- }
validClaimBronzeStorageClass := testVolumeClaim("foo", "ns", api.PersistentVolumeClaimSpec{
Selector: &metav1.LabelSelector{
@@ -95,10 +95,8 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
api.ResourceName(api.ResourceStorage): resource.MustParse("10Gi"),
},
},
+ StorageClassName: &classBronze,
})
- validClaimBronzeStorageClass.Annotations = map[string]string{
- util.StorageClassAnnotation: "bronze",
- }
missingStorage := testVolumeClaim("foo", "ns", api.PersistentVolumeClaimSpec{
Selector: &metav1.LabelSelector{
@@ -134,10 +132,8 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
Resources: api.ResourceRequirements{
Requests: api.ResourceList{},
},
+ StorageClassName: &classGold,
})
- missingGoldStorage.Annotations = map[string]string{
- util.StorageClassAnnotation: "gold",
- }
testCases := map[string]struct {
pvc *api.PersistentVolumeClaim
@@ -151,7 +147,7 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
},
"missing gold storage": {
pvc: missingGoldStorage,
- required: []api.ResourceName{ResourceByStorageClass("gold", api.ResourceRequestsStorage)},
+ required: []api.ResourceName{ResourceByStorageClass(classGold, api.ResourceRequestsStorage)},
err: `must specify gold.storageclass.storage.k8s.io/requests.storage`,
},
"valid-claim-quota-storage": {
@@ -171,8 +167,8 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
required: []api.ResourceName{
api.ResourceRequestsStorage,
api.ResourcePersistentVolumeClaims,
- ResourceByStorageClass("gold", api.ResourceRequestsStorage),
- ResourceByStorageClass("gold", api.ResourcePersistentVolumeClaims),
+ ResourceByStorageClass(classGold, api.ResourceRequestsStorage),
+ ResourceByStorageClass(classGold, api.ResourcePersistentVolumeClaims),
},
},
"valid-claim-bronze-with-quota-gold": {
@@ -180,8 +176,8 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
required: []api.ResourceName{
api.ResourceRequestsStorage,
api.ResourcePersistentVolumeClaims,
- ResourceByStorageClass("gold", api.ResourceRequestsStorage),
- ResourceByStorageClass("gold", api.ResourcePersistentVolumeClaims),
+ ResourceByStorageClass(classGold, api.ResourceRequestsStorage),
+ ResourceByStorageClass(classGold, api.ResourcePersistentVolumeClaims),
},
},
}
@@ -200,6 +196,7 @@ func TestPersistentVolumeClaimsConstraintsFunc(t *testing.T) {
}
func TestPersistentVolumeClaimEvaluatorUsage(t *testing.T) {
+ classGold := "gold"
validClaim := testVolumeClaim("foo", "ns", api.PersistentVolumeClaimSpec{
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -237,11 +234,8 @@ func TestPersistentVolumeClaimEvaluatorUsage(t *testing.T) {
api.ResourceName(api.ResourceStorage): resource.MustParse("10Gi"),
},
},
+ StorageClassName: &classGold,
})
- storageClassName := "gold"
- validClaimByStorageClass.Annotations = map[string]string{
- util.StorageClassAnnotation: storageClassName,
- }
kubeClient := fake.NewSimpleClientset()
evaluator := NewPersistentVolumeClaimEvaluator(kubeClient, nil)
@@ -259,10 +253,10 @@ func TestPersistentVolumeClaimEvaluatorUsage(t *testing.T) {
"pvc-usage-by-class": {
pvc: validClaimByStorageClass,
usage: api.ResourceList{
- api.ResourceRequestsStorage: resource.MustParse("10Gi"),
- api.ResourcePersistentVolumeClaims: resource.MustParse("1"),
- ResourceByStorageClass(storageClassName, api.ResourceRequestsStorage): resource.MustParse("10Gi"),
- ResourceByStorageClass(storageClassName, api.ResourcePersistentVolumeClaims): resource.MustParse("1"),
+ api.ResourceRequestsStorage: resource.MustParse("10Gi"),
+ api.ResourcePersistentVolumeClaims: resource.MustParse("1"),
+ ResourceByStorageClass(classGold, api.ResourceRequestsStorage): resource.MustParse("10Gi"),
+ ResourceByStorageClass(classGold, api.ResourcePersistentVolumeClaims): resource.MustParse("1"),
},
},
}
diff --git a/pkg/registry/storage/rest/BUILD b/pkg/registry/storage/rest/BUILD
index d5fc84b07f6..755011c35b1 100644
--- a/pkg/registry/storage/rest/BUILD
+++ b/pkg/registry/storage/rest/BUILD
@@ -14,6 +14,7 @@ go_library(
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/storage:go_default_library",
+ "//pkg/apis/storage/v1:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//pkg/registry/storage/storageclass/storage:go_default_library",
"//vendor:k8s.io/apiserver/pkg/registry/generic",
diff --git a/pkg/registry/storage/rest/storage_storage.go b/pkg/registry/storage/rest/storage_storage.go
index 31239b00213..c12f8038243 100644
--- a/pkg/registry/storage/rest/storage_storage.go
+++ b/pkg/registry/storage/rest/storage_storage.go
@@ -23,6 +23,7 @@ import (
serverstorage "k8s.io/apiserver/pkg/server/storage"
"k8s.io/kubernetes/pkg/api"
storageapi "k8s.io/kubernetes/pkg/apis/storage"
+ storageapiv1 "k8s.io/kubernetes/pkg/apis/storage/v1"
storageapiv1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
storageclassstore "k8s.io/kubernetes/pkg/registry/storage/storageclass/storage"
)
@@ -37,6 +38,10 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
apiGroupInfo.VersionedResourcesStorageMap[storageapiv1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
apiGroupInfo.GroupMeta.GroupVersion = storageapiv1beta1.SchemeGroupVersion
}
+ if apiResourceConfigSource.AnyResourcesForVersionEnabled(storageapiv1.SchemeGroupVersion) {
+ apiGroupInfo.VersionedResourcesStorageMap[storageapiv1.SchemeGroupVersion.Version] = p.v1Storage(apiResourceConfigSource, restOptionsGetter)
+ apiGroupInfo.GroupMeta.GroupVersion = storageapiv1.SchemeGroupVersion
+ }
return apiGroupInfo, true
}
@@ -54,6 +59,19 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
return storage
}
+func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) map[string]rest.Storage {
+ version := storageapiv1.SchemeGroupVersion
+
+ storage := map[string]rest.Storage{}
+
+ if apiResourceConfigSource.ResourceEnabled(version.WithResource("storageclasses")) {
+ storageClassStorage := storageclassstore.NewREST(restOptionsGetter)
+ storage["storageclasses"] = storageClassStorage
+ }
+
+ return storage
+}
+
func (p RESTStorageProvider) GroupName() string {
return storageapi.GroupName
}
diff --git a/pkg/volume/glusterfs/BUILD b/pkg/volume/glusterfs/BUILD
index bfb91555fcb..56fd90e82a4 100644
--- a/pkg/volume/glusterfs/BUILD
+++ b/pkg/volume/glusterfs/BUILD
@@ -19,7 +19,6 @@ go_library(
tags = ["automanaged"],
deps = [
"//pkg/api/v1:go_default_library",
- "//pkg/apis/storage/v1beta1/util:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/util/exec:go_default_library",
"//pkg/util/mount:go_default_library",
diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go
index 13ba0cda932..78c9c09dea2 100644
--- a/pkg/volume/glusterfs/glusterfs.go
+++ b/pkg/volume/glusterfs/glusterfs.go
@@ -35,7 +35,6 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/api/v1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/mount"
@@ -471,7 +470,7 @@ func (p *glusterfsPlugin) collectGids(className string, gidTable *MinMaxAllocato
}
for _, pv := range pvList.Items {
- if storageutil.GetVolumeStorageClass(&pv) != className {
+ if v1.GetPersistentVolumeClass(&pv) != className {
continue
}
@@ -650,7 +649,7 @@ func (r *glusterfsVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
return nil, fmt.Errorf("glusterfs: not able to parse your claim Selector")
}
glog.V(4).Infof("glusterfs: Provison VolumeOptions %v", r.options)
- scName := storageutil.GetClaimStorageClass(r.options.PVC)
+ scName := v1.GetPersistentVolumeClaimClass(r.options.PVC)
cfg, err := parseClassParameters(r.options.Parameters, r.plugin.host.GetKubeClient())
if err != nil {
return nil, err
diff --git a/pkg/volume/util/util.go b/pkg/volume/util/util.go
index 0112d394a7a..035b2f0609a 100644
--- a/pkg/volume/util/util.go
+++ b/pkg/volume/util/util.go
@@ -158,7 +158,7 @@ func GetClassForVolume(kubeClient clientset.Interface, pv *v1.PersistentVolume)
return nil, fmt.Errorf("Volume has no class annotation")
}
- class, err := kubeClient.Storage().StorageClasses().Get(className, metav1.GetOptions{})
+ class, err := kubeClient.StorageV1beta1().StorageClasses().Get(className, metav1.GetOptions{})
if err != nil {
return nil, err
}
diff --git a/plugin/pkg/admission/storageclass/default/admission.go b/plugin/pkg/admission/storageclass/default/admission.go
index 86662515ff7..9f6c097f733 100644
--- a/plugin/pkg/admission/storageclass/default/admission.go
+++ b/plugin/pkg/admission/storageclass/default/admission.go
@@ -96,7 +96,7 @@ func (c *claimDefaulterPlugin) Admit(a admission.Attributes) error {
return nil
}
- if storageutil.HasStorageClassAnnotation(pvc.ObjectMeta) {
+ if api.PersistentVolumeClaimHasClass(pvc) {
// The user asked for a class.
return nil
}
@@ -113,10 +113,7 @@ func (c *claimDefaulterPlugin) Admit(a admission.Attributes) error {
}
glog.V(4).Infof("defaulting storage class for claim %s (generate: %s) to %s", pvc.Name, pvc.GenerateName, def.Name)
- if pvc.ObjectMeta.Annotations == nil {
- pvc.ObjectMeta.Annotations = map[string]string{}
- }
- pvc.Annotations[storageutil.StorageClassAnnotation] = def.Name
+ pvc.Spec.StorageClassName = &def.Name
return nil
}
diff --git a/plugin/pkg/admission/storageclass/default/admission_test.go b/plugin/pkg/admission/storageclass/default/admission_test.go
index 41d32eb3ffd..38f3dd47bde 100644
--- a/plugin/pkg/admission/storageclass/default/admission_test.go
+++ b/plugin/pkg/admission/storageclass/default/admission_test.go
@@ -31,6 +31,9 @@ import (
)
func TestAdmission(t *testing.T) {
+ empty := ""
+ foo := "foo"
+
defaultClass1 := &storage.StorageClass{
TypeMeta: metav1.TypeMeta{
Kind: "StorageClass",
@@ -99,9 +102,9 @@ func TestAdmission(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "claimWithClass",
Namespace: "ns",
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "foo",
- },
+ },
+ Spec: api.PersistentVolumeClaimSpec{
+ StorageClassName: &foo,
},
}
claimWithEmptyClass := &api.PersistentVolumeClaim{
@@ -111,9 +114,9 @@ func TestAdmission(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "claimWithEmptyClass",
Namespace: "ns",
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "",
- },
+ },
+ Spec: api.PersistentVolumeClaimSpec{
+ StorageClassName: &empty,
},
}
claimWithNoClass := &api.PersistentVolumeClaim{
@@ -221,10 +224,8 @@ func TestAdmission(t *testing.T) {
}
class := ""
- if claim.Annotations != nil {
- if value, ok := claim.Annotations[storageutil.StorageClassAnnotation]; ok {
- class = value
- }
+ if claim.Spec.StorageClassName != nil {
+ class = *claim.Spec.StorageClassName
}
if test.expectedClassName != "" && test.expectedClassName != class {
t.Errorf("Test %q: expected class name %q, got %q", test.name, test.expectedClassName, class)
diff --git a/staging/src/k8s.io/client-go/informers/generic.go b/staging/src/k8s.io/client-go/informers/generic.go
index ce9cd65c090..fed30ea8cd6 100644
--- a/staging/src/k8s.io/client-go/informers/generic.go
+++ b/staging/src/k8s.io/client-go/informers/generic.go
@@ -33,6 +33,7 @@ import (
v1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1"
rbac_v1beta1 "k8s.io/client-go/pkg/apis/rbac/v1beta1"
settings_v1alpha1 "k8s.io/client-go/pkg/apis/settings/v1alpha1"
+ storage_v1 "k8s.io/client-go/pkg/apis/storage/v1"
storage_v1beta1 "k8s.io/client-go/pkg/apis/storage/v1beta1"
cache "k8s.io/client-go/tools/cache"
)
@@ -167,6 +168,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case settings_v1alpha1.SchemeGroupVersion.WithResource("podpresets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil
+ // Group=Storage, Version=V1
+ case storage_v1.SchemeGroupVersion.WithResource("storageclasses"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil
+
// Group=Storage, Version=V1beta1
case storage_v1beta1.SchemeGroupVersion.WithResource("storageclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil
diff --git a/staging/src/k8s.io/client-go/informers/storage/interface.go b/staging/src/k8s.io/client-go/informers/storage/interface.go
index a291548cbf6..7f3a69eb29a 100644
--- a/staging/src/k8s.io/client-go/informers/storage/interface.go
+++ b/staging/src/k8s.io/client-go/informers/storage/interface.go
@@ -20,11 +20,14 @@ package storage
import (
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
+ v1 "k8s.io/client-go/informers/storage/v1"
v1beta1 "k8s.io/client-go/informers/storage/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
+ // V1 provides access to shared informers for resources in V1.
+ V1() v1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
}
@@ -38,6 +41,11 @@ func New(f internalinterfaces.SharedInformerFactory) Interface {
return &group{f}
}
+// V1 returns a new v1.Interface.
+func (g *group) V1() v1.Interface {
+ return v1.New(g.SharedInformerFactory)
+}
+
// V1beta1 returns a new v1beta1.Interface.
func (g *group) V1beta1() v1beta1.Interface {
return v1beta1.New(g.SharedInformerFactory)
diff --git a/staging/src/k8s.io/client-go/informers/storage/v1/interface.go b/staging/src/k8s.io/client-go/informers/storage/v1/interface.go
new file mode 100644
index 00000000000..642d4c494d9
--- /dev/null
+++ b/staging/src/k8s.io/client-go/informers/storage/v1/interface.go
@@ -0,0 +1,43 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by informer-gen
+
+package v1
+
+import (
+ internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // StorageClasses returns a StorageClassInformer.
+ StorageClasses() StorageClassInformer
+}
+
+type version struct {
+ internalinterfaces.SharedInformerFactory
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory) Interface {
+ return &version{f}
+}
+
+// StorageClasses returns a StorageClassInformer.
+func (v *version) StorageClasses() StorageClassInformer {
+ return &storageClassInformer{factory: v.SharedInformerFactory}
+}
diff --git a/staging/src/k8s.io/client-go/informers/storage/v1/storageclass.go b/staging/src/k8s.io/client-go/informers/storage/v1/storageclass.go
new file mode 100644
index 00000000000..13030532de3
--- /dev/null
+++ b/staging/src/k8s.io/client-go/informers/storage/v1/storageclass.go
@@ -0,0 +1,68 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by informer-gen
+
+package v1
+
+import (
+ meta_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"
+ v1 "k8s.io/client-go/listers/storage/v1"
+ storage_v1 "k8s.io/client-go/pkg/apis/storage/v1"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// StorageClassInformer provides access to a shared informer and lister for
+// StorageClasses.
+type StorageClassInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1.StorageClassLister
+}
+
+type storageClassInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+}
+
+func newStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ sharedIndexInformer := cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
+ return client.StorageV1().StorageClasses().List(options)
+ },
+ WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
+ return client.StorageV1().StorageClasses().Watch(options)
+ },
+ },
+ &storage_v1.StorageClass{},
+ resyncPeriod,
+ cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
+ )
+
+ return sharedIndexInformer
+}
+
+func (f *storageClassInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&storage_v1.StorageClass{}, newStorageClassInformer)
+}
+
+func (f *storageClassInformer) Lister() v1.StorageClassLister {
+ return v1.NewStorageClassLister(f.Informer().GetIndexer())
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/clientset.go b/staging/src/k8s.io/client-go/kubernetes/clientset.go
index 1f413248c8f..5fd0c54e8f5 100644
--- a/staging/src/k8s.io/client-go/kubernetes/clientset.go
+++ b/staging/src/k8s.io/client-go/kubernetes/clientset.go
@@ -35,6 +35,7 @@ import (
rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
settingsv1alpha1 "k8s.io/client-go/kubernetes/typed/settings/v1alpha1"
+ storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1"
storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
@@ -81,8 +82,9 @@ type Interface interface {
// Deprecated: please explicitly pick a version if possible.
Settings() settingsv1alpha1.SettingsV1alpha1Interface
StorageV1beta1() storagev1beta1.StorageV1beta1Interface
+ StorageV1() storagev1.StorageV1Interface
// Deprecated: please explicitly pick a version if possible.
- Storage() storagev1beta1.StorageV1beta1Interface
+ Storage() storagev1.StorageV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@@ -106,6 +108,7 @@ type Clientset struct {
*rbacv1alpha1.RbacV1alpha1Client
*settingsv1alpha1.SettingsV1alpha1Client
*storagev1beta1.StorageV1beta1Client
+ *storagev1.StorageV1Client
}
// CoreV1 retrieves the CoreV1Client
@@ -343,13 +346,21 @@ func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface {
return c.StorageV1beta1Client
}
-// Deprecated: Storage retrieves the default version of StorageClient.
-// Please explicitly pick a version.
-func (c *Clientset) Storage() storagev1beta1.StorageV1beta1Interface {
+// StorageV1 retrieves the StorageV1Client
+func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
if c == nil {
return nil
}
- return c.StorageV1beta1Client
+ return c.StorageV1Client
+}
+
+// Deprecated: Storage retrieves the default version of StorageClient.
+// Please explicitly pick a version.
+func (c *Clientset) Storage() storagev1.StorageV1Interface {
+ if c == nil {
+ return nil
+ }
+ return c.StorageV1Client
}
// Discovery retrieves the DiscoveryClient
@@ -436,6 +447,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
+ cs.StorageV1Client, err = storagev1.NewForConfig(&configShallowCopy)
+ if err != nil {
+ return nil, err
+ }
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
@@ -466,6 +481,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.RbacV1alpha1Client = rbacv1alpha1.NewForConfigOrDie(c)
cs.SettingsV1alpha1Client = settingsv1alpha1.NewForConfigOrDie(c)
cs.StorageV1beta1Client = storagev1beta1.NewForConfigOrDie(c)
+ cs.StorageV1Client = storagev1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@@ -491,6 +507,7 @@ func New(c rest.Interface) *Clientset {
cs.RbacV1alpha1Client = rbacv1alpha1.New(c)
cs.SettingsV1alpha1Client = settingsv1alpha1.New(c)
cs.StorageV1beta1Client = storagev1beta1.New(c)
+ cs.StorageV1Client = storagev1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
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 c99855cc443..d8a4b835268 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
@@ -54,6 +54,8 @@ import (
fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake"
settingsv1alpha1 "k8s.io/client-go/kubernetes/typed/settings/v1alpha1"
fakesettingsv1alpha1 "k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake"
+ storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1"
+ fakestoragev1 "k8s.io/client-go/kubernetes/typed/storage/v1/fake"
storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1"
fakestoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake"
"k8s.io/client-go/testing"
@@ -232,7 +234,12 @@ func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface {
return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake}
}
-// Storage retrieves the StorageV1beta1Client
-func (c *Clientset) Storage() storagev1beta1.StorageV1beta1Interface {
- return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake}
+// StorageV1 retrieves the StorageV1Client
+func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
+ return &fakestoragev1.FakeStorageV1{Fake: &c.Fake}
+}
+
+// Storage retrieves the StorageV1Client
+func (c *Clientset) Storage() storagev1.StorageV1Interface {
+ return &fakestoragev1.FakeStorageV1{Fake: &c.Fake}
}
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 eebfe67a743..1fe5dbe4cee 100644
--- a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go
+++ b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go
@@ -37,6 +37,7 @@ import (
rbacv1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1"
rbacv1beta1 "k8s.io/client-go/pkg/apis/rbac/v1beta1"
settingsv1alpha1 "k8s.io/client-go/pkg/apis/settings/v1alpha1"
+ storagev1 "k8s.io/client-go/pkg/apis/storage/v1"
storagev1beta1 "k8s.io/client-go/pkg/apis/storage/v1beta1"
)
@@ -81,5 +82,6 @@ func AddToScheme(scheme *runtime.Scheme) {
rbacv1alpha1.AddToScheme(scheme)
settingsv1alpha1.AddToScheme(scheme)
storagev1beta1.AddToScheme(scheme)
+ storagev1.AddToScheme(scheme)
}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go
new file mode 100644
index 00000000000..54673bfa738
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This package is generated by client-gen with custom arguments.
+
+// This package has the automatically generated typed clients.
+package v1
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go
new file mode 100644
index 00000000000..c6548330a0d
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go
@@ -0,0 +1,20 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This package is generated by client-gen with custom arguments.
+
+// Package fake has the automatically generated clients.
+package fake
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go
new file mode 100644
index 00000000000..97972f0f74f
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go
@@ -0,0 +1,38 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package fake
+
+import (
+ v1 "k8s.io/client-go/kubernetes/typed/storage/v1"
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+)
+
+type FakeStorageV1 struct {
+ *testing.Fake
+}
+
+func (c *FakeStorageV1) StorageClasses() v1.StorageClassInterface {
+ return &FakeStorageClasses{c}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeStorageV1) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go
new file mode 100644
index 00000000000..3f3a7c07704
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go
@@ -0,0 +1,110 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package fake
+
+import (
+ meta_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"
+ v1 "k8s.io/client-go/pkg/apis/storage/v1"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeStorageClasses implements StorageClassInterface
+type FakeStorageClasses struct {
+ Fake *FakeStorageV1
+}
+
+var storageclassesResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "storageclasses"}
+
+func (c *FakeStorageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) Delete(name string, options *meta_v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewRootDeleteAction(storageclassesResource, name), &v1.StorageClass{})
+ return err
+}
+
+func (c *FakeStorageClasses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
+ action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v1.StorageClassList{})
+ return err
+}
+
+func (c *FakeStorageClasses) Get(name string, options meta_v1.GetOptions) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootGetAction(storageclassesResource, name), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
+
+func (c *FakeStorageClasses) List(opts meta_v1.ListOptions) (result *v1.StorageClassList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootListAction(storageclassesResource, opts), &v1.StorageClassList{})
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1.StorageClassList{}
+ for _, item := range obj.(*v1.StorageClassList).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 storageClasses.
+func (c *FakeStorageClasses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewRootWatchAction(storageclassesResource, opts))
+}
+
+// Patch applies the patch and returns the patched storageClass.
+func (c *FakeStorageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, data, subresources...), &v1.StorageClass{})
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1.StorageClass), err
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go
new file mode 100644
index 00000000000..39df9fb8791
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+type StorageClassExpansion interface{}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go
new file mode 100644
index 00000000000..a95d30b2d75
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go
@@ -0,0 +1,88 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ "k8s.io/client-go/kubernetes/scheme"
+ v1 "k8s.io/client-go/pkg/apis/storage/v1"
+ rest "k8s.io/client-go/rest"
+)
+
+type StorageV1Interface interface {
+ RESTClient() rest.Interface
+ StorageClassesGetter
+}
+
+// StorageV1Client is used to interact with features provided by the storage.k8s.io group.
+type StorageV1Client struct {
+ restClient rest.Interface
+}
+
+func (c *StorageV1Client) StorageClasses() StorageClassInterface {
+ return newStorageClasses(c)
+}
+
+// NewForConfig creates a new StorageV1Client for the given config.
+func NewForConfig(c *rest.Config) (*StorageV1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return &StorageV1Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new StorageV1Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *StorageV1Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new StorageV1Client for the given RESTClient.
+func New(c rest.Interface) *StorageV1Client {
+ return &StorageV1Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v1.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 *StorageV1Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go
new file mode 100644
index 00000000000..0283c997091
--- /dev/null
+++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go
@@ -0,0 +1,145 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ meta_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"
+ v1 "k8s.io/client-go/pkg/apis/storage/v1"
+ rest "k8s.io/client-go/rest"
+)
+
+// StorageClassesGetter has a method to return a StorageClassInterface.
+// A group's client should implement this interface.
+type StorageClassesGetter interface {
+ StorageClasses() StorageClassInterface
+}
+
+// StorageClassInterface has methods to work with StorageClass resources.
+type StorageClassInterface interface {
+ Create(*v1.StorageClass) (*v1.StorageClass, error)
+ Update(*v1.StorageClass) (*v1.StorageClass, error)
+ Delete(name string, options *meta_v1.DeleteOptions) error
+ DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
+ Get(name string, options meta_v1.GetOptions) (*v1.StorageClass, error)
+ List(opts meta_v1.ListOptions) (*v1.StorageClassList, error)
+ Watch(opts meta_v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error)
+ StorageClassExpansion
+}
+
+// storageClasses implements StorageClassInterface
+type storageClasses struct {
+ client rest.Interface
+}
+
+// newStorageClasses returns a StorageClasses
+func newStorageClasses(c *StorageV1Client) *storageClasses {
+ return &storageClasses{
+ client: c.RESTClient(),
+ }
+}
+
+// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any.
+func (c *storageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Post().
+ Resource("storageclasses").
+ Body(storageClass).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any.
+func (c *storageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Put().
+ Resource("storageclasses").
+ Name(storageClass.Name).
+ Body(storageClass).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the storageClass and deletes it. Returns an error if one occurs.
+func (c *storageClasses) Delete(name string, options *meta_v1.DeleteOptions) error {
+ return c.client.Delete().
+ Resource("storageclasses").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *storageClasses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
+ return c.client.Delete().
+ Resource("storageclasses").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any.
+func (c *storageClasses) Get(name string, options meta_v1.GetOptions) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Get().
+ Resource("storageclasses").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of StorageClasses that match those selectors.
+func (c *storageClasses) List(opts meta_v1.ListOptions) (result *v1.StorageClassList, err error) {
+ result = &v1.StorageClassList{}
+ err = c.client.Get().
+ Resource("storageclasses").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested storageClasses.
+func (c *storageClasses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Resource("storageclasses").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Patch applies the patch and returns the patched storageClass.
+func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) {
+ result = &v1.StorageClass{}
+ err = c.client.Patch(pt).
+ Resource("storageclasses").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/staging/src/k8s.io/client-go/listers/storage/v1/expansion_generated.go b/staging/src/k8s.io/client-go/listers/storage/v1/expansion_generated.go
new file mode 100644
index 00000000000..2353b59d3f5
--- /dev/null
+++ b/staging/src/k8s.io/client-go/listers/storage/v1/expansion_generated.go
@@ -0,0 +1,23 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by lister-gen
+
+package v1
+
+// StorageClassListerExpansion allows custom methods to be added to
+// StorageClassLister.
+type StorageClassListerExpansion interface{}
diff --git a/staging/src/k8s.io/client-go/listers/storage/v1/storageclass.go b/staging/src/k8s.io/client-go/listers/storage/v1/storageclass.go
new file mode 100644
index 00000000000..9fae85a2945
--- /dev/null
+++ b/staging/src/k8s.io/client-go/listers/storage/v1/storageclass.go
@@ -0,0 +1,68 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was automatically generated by lister-gen
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/api/errors"
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/labels"
+ storage "k8s.io/client-go/pkg/apis/storage"
+ v1 "k8s.io/client-go/pkg/apis/storage/v1"
+ "k8s.io/client-go/tools/cache"
+)
+
+// StorageClassLister helps list StorageClasses.
+type StorageClassLister interface {
+ // List lists all StorageClasses in the indexer.
+ List(selector labels.Selector) (ret []*v1.StorageClass, err error)
+ // Get retrieves the StorageClass from the index for a given name.
+ Get(name string) (*v1.StorageClass, error)
+ StorageClassListerExpansion
+}
+
+// storageClassLister implements the StorageClassLister interface.
+type storageClassLister struct {
+ indexer cache.Indexer
+}
+
+// NewStorageClassLister returns a new StorageClassLister.
+func NewStorageClassLister(indexer cache.Indexer) StorageClassLister {
+ return &storageClassLister{indexer: indexer}
+}
+
+// List lists all StorageClasses in the indexer.
+func (s *storageClassLister) List(selector labels.Selector) (ret []*v1.StorageClass, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1.StorageClass))
+ })
+ return ret, err
+}
+
+// Get retrieves the StorageClass from the index for a given name.
+func (s *storageClassLister) Get(name string) (*v1.StorageClass, error) {
+ key := &v1.StorageClass{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
+ obj, exists, err := s.indexer.Get(key)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(storage.Resource("storageclass"), name)
+ }
+ return obj.(*v1.StorageClass), nil
+}
diff --git a/staging/src/k8s.io/client-go/pkg/api/helpers.go b/staging/src/k8s.io/client-go/pkg/api/helpers.go
index 970792fc74d..4ada0ba3743 100644
--- a/staging/src/k8s.io/client-go/pkg/api/helpers.go
+++ b/staging/src/k8s.io/client-go/pkg/api/helpers.go
@@ -557,3 +557,42 @@ func PodAnnotationsFromSysctls(sysctls []Sysctl) string {
}
return strings.Join(kvs, ",")
}
+
+// GetPersistentVolumeClass returns StorageClassName.
+func GetPersistentVolumeClass(volume *PersistentVolume) string {
+ // Use beta annotation first
+ if class, found := volume.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ return volume.Spec.StorageClassName
+}
+
+// GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was
+// requested, it returns "".
+func GetPersistentVolumeClaimClass(claim *PersistentVolumeClaim) string {
+ // Use beta annotation first
+ if class, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return *claim.Spec.StorageClassName
+ }
+
+ return ""
+}
+
+// PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.
+func PersistentVolumeClaimHasClass(claim *PersistentVolumeClaim) bool {
+ // Use beta annotation first
+ if _, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return true
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return true
+ }
+
+ return false
+}
diff --git a/staging/src/k8s.io/client-go/pkg/api/types.go b/staging/src/k8s.io/client-go/pkg/api/types.go
index 1fa4558be44..1b910e3e4ac 100644
--- a/staging/src/k8s.io/client-go/pkg/api/types.go
+++ b/staging/src/k8s.io/client-go/pkg/api/types.go
@@ -375,6 +375,12 @@ type PersistentVolumeClaimVolumeSource struct {
ReadOnly bool
}
+const (
+ // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
+ // It's currently still used and will be held for backwards compatibility
+ BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
+)
+
// +genclient=true
// +nonNamespaced=true
diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/helpers.go b/staging/src/k8s.io/client-go/pkg/api/v1/helpers.go
index 05928dc009d..01f4ef4706b 100644
--- a/staging/src/k8s.io/client-go/pkg/api/v1/helpers.go
+++ b/staging/src/k8s.io/client-go/pkg/api/v1/helpers.go
@@ -591,3 +591,42 @@ func GetAffinityFromPodAnnotations(annotations map[string]string) (*Affinity, er
}
return nil, nil
}
+
+// GetPersistentVolumeClass returns StorageClassName.
+func GetPersistentVolumeClass(volume *PersistentVolume) string {
+ // Use beta annotation first
+ if class, found := volume.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ return volume.Spec.StorageClassName
+}
+
+// GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was
+// requested, it returns "".
+func GetPersistentVolumeClaimClass(claim *PersistentVolumeClaim) string {
+ // Use beta annotation first
+ if class, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return class
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return *claim.Spec.StorageClassName
+ }
+
+ return ""
+}
+
+// PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.
+func PersistentVolumeClaimHasClass(claim *PersistentVolumeClaim) bool {
+ // Use beta annotation first
+ if _, found := claim.Annotations[BetaStorageClassAnnotation]; found {
+ return true
+ }
+
+ if claim.Spec.StorageClassName != nil {
+ return true
+ }
+
+ return false
+}
diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types.go b/staging/src/k8s.io/client-go/pkg/api/v1/types.go
index 64842ed6cd5..2efa564d7ce 100644
--- a/staging/src/k8s.io/client-go/pkg/api/v1/types.go
+++ b/staging/src/k8s.io/client-go/pkg/api/v1/types.go
@@ -421,6 +421,17 @@ type PersistentVolumeSource struct {
PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"`
}
+const (
+ // AlphaStorageClassAnnotation represents the previous alpha storage class
+ // annotation. It's currently still used and will be held for backwards
+ // compatibility
+ AlphaStorageClassAnnotation = "volume.alpha.kubernetes.io/storage-class"
+
+ // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation.
+ // It's currently still used and will be held for backwards compatibility
+ BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
+)
+
// +genclient=true
// +nonNamespaced=true
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/install/install.go b/staging/src/k8s.io/client-go/pkg/apis/storage/install/install.go
index 907e3faf3f6..fb590fecd69 100644
--- a/staging/src/k8s.io/client-go/pkg/apis/storage/install/install.go
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/install/install.go
@@ -25,6 +25,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/apis/storage"
+ "k8s.io/client-go/pkg/apis/storage/v1"
"k8s.io/client-go/pkg/apis/storage/v1beta1"
)
@@ -36,13 +37,15 @@ func init() {
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
- GroupName: storage.GroupName,
- VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version},
+ GroupName: storage.GroupName,
+ // TODO: change the order when GKE supports v1
+ VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version, v1.SchemeGroupVersion.Version},
ImportPrefix: "k8s.io/client-go/pkg/apis/storage",
RootScopedKinds: sets.NewString("StorageClass"),
AddInternalObjectsToScheme: storage.AddToScheme,
},
announced.VersionToSchemeFunc{
+ v1.SchemeGroupVersion.Version: v1.AddToScheme,
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
},
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/doc.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/doc.go
new file mode 100644
index 00000000000..2b8d05cfd59
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/doc.go
@@ -0,0 +1,18 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +groupName=storage.k8s.io
+package v1
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.pb.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.pb.go
new file mode 100644
index 00000000000..531282ba68c
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.pb.go
@@ -0,0 +1,730 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo.
+// source: k8s.io/kubernetes/pkg/apis/storage/v1/generated.proto
+// DO NOT EDIT!
+
+/*
+ Package v1 is a generated protocol buffer package.
+
+ It is generated from these files:
+ k8s.io/kubernetes/pkg/apis/storage/v1/generated.proto
+
+ It has these top-level messages:
+ StorageClass
+ StorageClassList
+*/
+package v1
+
+import proto "github.com/gogo/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+import strings "strings"
+import reflect "reflect"
+import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
+
+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.
+const _ = proto.GoGoProtoPackageIsVersion1
+
+func (m *StorageClass) Reset() { *m = StorageClass{} }
+func (*StorageClass) ProtoMessage() {}
+func (*StorageClass) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
+
+func (m *StorageClassList) Reset() { *m = StorageClassList{} }
+func (*StorageClassList) ProtoMessage() {}
+func (*StorageClassList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
+
+func init() {
+ proto.RegisterType((*StorageClass)(nil), "k8s.io.client-go.pkg.apis.storage.v1.StorageClass")
+ proto.RegisterType((*StorageClassList)(nil), "k8s.io.client-go.pkg.apis.storage.v1.StorageClassList")
+}
+func (m *StorageClass) 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 *StorageClass) 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()))
+ n1, err := m.ObjectMeta.MarshalTo(data[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n1
+ data[i] = 0x12
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(m.Provisioner)))
+ i += copy(data[i:], m.Provisioner)
+ if len(m.Parameters) > 0 {
+ for k := range m.Parameters {
+ data[i] = 0x1a
+ i++
+ v := m.Parameters[k]
+ mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
+ i = encodeVarintGenerated(data, i, uint64(mapSize))
+ data[i] = 0xa
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(k)))
+ i += copy(data[i:], k)
+ data[i] = 0x12
+ i++
+ i = encodeVarintGenerated(data, i, uint64(len(v)))
+ i += copy(data[i:], v)
+ }
+ }
+ return i, nil
+}
+
+func (m *StorageClassList) 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 *StorageClassList) 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()))
+ n2, err := m.ListMeta.MarshalTo(data[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n2
+ 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 *StorageClass) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Provisioner)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Parameters) > 0 {
+ for k, v := range m.Parameters {
+ _ = k
+ _ = v
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
+ n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
+ }
+ }
+ return n
+}
+
+func (m *StorageClassList) 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 *StorageClass) String() string {
+ if this == nil {
+ return "nil"
+ }
+ keysForParameters := make([]string, 0, len(this.Parameters))
+ for k := range this.Parameters {
+ keysForParameters = append(keysForParameters, k)
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForParameters)
+ mapStringForParameters := "map[string]string{"
+ for _, k := range keysForParameters {
+ mapStringForParameters += fmt.Sprintf("%v: %v,", k, this.Parameters[k])
+ }
+ mapStringForParameters += "}"
+ s := strings.Join([]string{`&StorageClass{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`,
+ `Parameters:` + mapStringForParameters + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageClassList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&StorageClassList{`,
+ `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), "StorageClass", "StorageClass", 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 *StorageClass) 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: StorageClass: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageClass: 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 Provisioner", 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.Provisioner = string(data[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Parameters", 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
+ }
+ var keykey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ keykey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ var stringLenmapkey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapkey := int(stringLenmapkey)
+ if intStringLenmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapkey := iNdEx + intStringLenmapkey
+ if postStringIndexmapkey > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapkey := string(data[iNdEx:postStringIndexmapkey])
+ iNdEx = postStringIndexmapkey
+ var valuekey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ valuekey |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ var stringLenmapvalue uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := data[iNdEx]
+ iNdEx++
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapvalue := int(stringLenmapvalue)
+ if intStringLenmapvalue < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue
+ if postStringIndexmapvalue > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapvalue := string(data[iNdEx:postStringIndexmapvalue])
+ iNdEx = postStringIndexmapvalue
+ if m.Parameters == nil {
+ m.Parameters = make(map[string]string)
+ }
+ m.Parameters[mapkey] = mapvalue
+ 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 *StorageClassList) 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: StorageClassList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageClassList: 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, StorageClass{})
+ 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")
+)
+
+var fileDescriptorGenerated = []byte{
+ // 474 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x92, 0x4f, 0x6f, 0xd3, 0x30,
+ 0x18, 0xc6, 0xe3, 0x54, 0x95, 0x36, 0x17, 0x44, 0x15, 0x38, 0x54, 0x3d, 0x64, 0xd5, 0x04, 0x52,
+ 0x2f, 0xd8, 0x74, 0x63, 0x68, 0x42, 0xe2, 0xd2, 0x89, 0x03, 0x12, 0x88, 0x29, 0x5c, 0x10, 0xe2,
+ 0x80, 0xdb, 0xbd, 0xa4, 0x26, 0x4d, 0x1c, 0xd9, 0x6f, 0x02, 0xbd, 0xf1, 0x11, 0xf8, 0x58, 0x15,
+ 0xa7, 0x1d, 0x39, 0x0d, 0x1a, 0xbe, 0x08, 0xca, 0x1f, 0x96, 0x88, 0x6c, 0xa2, 0xda, 0x2d, 0xaf,
+ 0xed, 0xdf, 0xe3, 0xe7, 0x79, 0x1c, 0x7a, 0x14, 0x1c, 0x1b, 0x26, 0x15, 0x0f, 0x92, 0x19, 0xe8,
+ 0x08, 0x10, 0x0c, 0x8f, 0x03, 0x9f, 0x8b, 0x58, 0x1a, 0x6e, 0x50, 0x69, 0xe1, 0x03, 0x4f, 0x27,
+ 0xdc, 0x87, 0x08, 0xb4, 0x40, 0x38, 0x63, 0xb1, 0x56, 0xa8, 0x9c, 0x07, 0x25, 0xc6, 0x6a, 0x8c,
+ 0xc5, 0x81, 0xcf, 0x72, 0x8c, 0x55, 0x18, 0x4b, 0x27, 0xc3, 0x87, 0xbe, 0xc4, 0x45, 0x32, 0x63,
+ 0x73, 0x15, 0x72, 0x5f, 0xf9, 0x8a, 0x17, 0xf4, 0x2c, 0xf9, 0x58, 0x4c, 0xc5, 0x50, 0x7c, 0x95,
+ 0xaa, 0xc3, 0xc7, 0x95, 0x19, 0x11, 0xcb, 0x50, 0xcc, 0x17, 0x32, 0x02, 0xbd, 0xaa, 0xed, 0x84,
+ 0x80, 0xe2, 0x0a, 0x2f, 0x43, 0x7e, 0x1d, 0xa5, 0x93, 0x08, 0x65, 0x08, 0x2d, 0xe0, 0xc9, 0xff,
+ 0x00, 0x33, 0x5f, 0x40, 0x28, 0x5a, 0xdc, 0xe1, 0x75, 0x5c, 0x82, 0x72, 0xc9, 0x65, 0x84, 0x06,
+ 0x75, 0x0b, 0x6a, 0x64, 0x32, 0xa0, 0x53, 0xd0, 0x75, 0x20, 0xf8, 0x22, 0xc2, 0x78, 0x79, 0x55,
+ 0xbf, 0xfb, 0x3f, 0x6d, 0x7a, 0xeb, 0x4d, 0xd9, 0xe3, 0xc9, 0x52, 0x18, 0xe3, 0x7c, 0xa0, 0x3b,
+ 0x79, 0xfe, 0x33, 0x81, 0x62, 0x40, 0x46, 0x64, 0xdc, 0x3b, 0x78, 0xc4, 0xaa, 0x37, 0x68, 0xda,
+ 0xa9, 0x5f, 0x21, 0x3f, 0xcd, 0xd2, 0x09, 0x7b, 0x3d, 0xfb, 0x04, 0x73, 0x7c, 0x05, 0x28, 0xa6,
+ 0xce, 0xfa, 0x62, 0xcf, 0xca, 0x2e, 0xf6, 0x68, 0xbd, 0xe6, 0x5d, 0xaa, 0x3a, 0x47, 0xb4, 0x17,
+ 0x6b, 0x95, 0x4a, 0x23, 0x55, 0x04, 0x7a, 0x60, 0x8f, 0xc8, 0x78, 0x77, 0x7a, 0xb7, 0x42, 0x7a,
+ 0xa7, 0xf5, 0x96, 0xd7, 0x3c, 0xe7, 0x7c, 0xa6, 0x34, 0x16, 0x5a, 0x84, 0x80, 0xa0, 0xcd, 0xa0,
+ 0x33, 0xea, 0x8c, 0x7b, 0x07, 0x27, 0x6c, 0xab, 0xdf, 0x83, 0x35, 0x13, 0xb2, 0xd3, 0x4b, 0x95,
+ 0xe7, 0x11, 0xea, 0x55, 0xed, 0xb6, 0xde, 0xf0, 0x1a, 0x57, 0x0d, 0x9f, 0xd1, 0x3b, 0xff, 0x20,
+ 0x4e, 0x9f, 0x76, 0x02, 0x58, 0x15, 0xfd, 0xec, 0x7a, 0xf9, 0xa7, 0x73, 0x8f, 0x76, 0x53, 0xb1,
+ 0x4c, 0xa0, 0x8c, 0xe3, 0x95, 0xc3, 0x53, 0xfb, 0x98, 0xec, 0x7f, 0x27, 0xb4, 0xdf, 0xbc, 0xff,
+ 0xa5, 0x34, 0xe8, 0xbc, 0x6f, 0xb5, 0xcc, 0xb6, 0x6b, 0x39, 0xa7, 0x8b, 0x8e, 0xfb, 0x95, 0xeb,
+ 0x9d, 0xbf, 0x2b, 0x8d, 0x86, 0xdf, 0xd2, 0xae, 0x44, 0x08, 0xcd, 0xc0, 0x2e, 0x5a, 0x3a, 0xbc,
+ 0x41, 0x4b, 0xd3, 0xdb, 0x95, 0x7e, 0xf7, 0x45, 0xae, 0xe4, 0x95, 0x82, 0xd3, 0xfb, 0xeb, 0x8d,
+ 0x6b, 0x9d, 0x6f, 0x5c, 0xeb, 0xc7, 0xc6, 0xb5, 0xbe, 0x66, 0x2e, 0x59, 0x67, 0x2e, 0x39, 0xcf,
+ 0x5c, 0xf2, 0x2b, 0x73, 0xc9, 0xb7, 0xdf, 0xae, 0xf5, 0xce, 0x4e, 0x27, 0x7f, 0x02, 0x00, 0x00,
+ 0xff, 0xff, 0xe8, 0xe1, 0xb9, 0x93, 0xec, 0x03, 0x00, 0x00,
+}
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.proto
new file mode 100644
index 00000000000..92e18cf9e96
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/generated.proto
@@ -0,0 +1,63 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = 'proto2';
+
+package k8s.io.kubernetes.pkg.apis.storage.v1;
+
+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";
+import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
+import "k8s.io/apiserver/pkg/apis/example/v1/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "v1";
+
+// StorageClass describes the parameters for a class of storage for
+// which PersistentVolumes can be dynamically provisioned.
+//
+// StorageClasses are non-namespaced; the name of the storage class
+// according to etcd is in ObjectMeta.Name.
+message StorageClass {
+ // Standard object's metadata.
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Provisioner indicates the type of the provisioner.
+ optional string provisioner = 2;
+
+ // Parameters holds the parameters for the provisioner that should
+ // create volumes of this storage class.
+ // +optional
+ map parameters = 3;
+}
+
+// StorageClassList is a collection of storage classes.
+message StorageClassList {
+ // Standard list metadata
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of StorageClasses
+ repeated StorageClass items = 2;
+}
+
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/register.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/register.go
new file mode 100644
index 00000000000..24d6bfa7d3b
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "storage.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to api.Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &StorageClass{},
+ &StorageClassList{},
+ )
+
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types.go
new file mode 100644
index 00000000000..25b283b81fc
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types.go
@@ -0,0 +1,57 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient=true
+// +nonNamespaced=true
+
+// StorageClass describes the parameters for a class of storage for
+// which PersistentVolumes can be dynamically provisioned.
+//
+// StorageClasses are non-namespaced; the name of the storage class
+// according to etcd is in ObjectMeta.Name.
+type StorageClass struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // Provisioner indicates the type of the provisioner.
+ Provisioner string `json:"provisioner"`
+
+ // Parameters holds the parameters for the provisioner that should
+ // create volumes of this storage class.
+ // +optional
+ Parameters map[string]string `json:"parameters,omitempty"`
+}
+
+// StorageClassList is a collection of storage classes.
+type StorageClassList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty"`
+
+ // Items is the list of StorageClasses
+ Items []StorageClass `json:"items"`
+}
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..6f271770858
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/types_swagger_doc_generated.go
@@ -0,0 +1,51 @@
+/*
+Copyright 2016 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-generated-swagger-docs.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE
+var map_StorageClass = map[string]string{
+ "": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.",
+ "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "provisioner": "Provisioner indicates the type of the provisioner.",
+ "parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
+}
+
+func (StorageClass) SwaggerDoc() map[string]string {
+ return map_StorageClass
+}
+
+var map_StorageClassList = map[string]string{
+ "": "StorageClassList is a collection of storage classes.",
+ "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
+ "items": "Items is the list of StorageClasses",
+}
+
+func (StorageClassList) SwaggerDoc() map[string]string {
+ return map_StorageClassList
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.conversion.go
new file mode 100644
index 00000000000..d26f1c75ec5
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.conversion.go
@@ -0,0 +1,85 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by conversion-gen. Do not edit it manually!
+
+package v1
+
+import (
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ storage "k8s.io/client-go/pkg/apis/storage"
+ unsafe "unsafe"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedConversionFuncs(
+ Convert_v1_StorageClass_To_storage_StorageClass,
+ Convert_storage_StorageClass_To_v1_StorageClass,
+ Convert_v1_StorageClassList_To_storage_StorageClassList,
+ Convert_storage_StorageClassList_To_v1_StorageClassList,
+ )
+}
+
+func autoConvert_v1_StorageClass_To_storage_StorageClass(in *StorageClass, out *storage.StorageClass, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Provisioner = in.Provisioner
+ out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
+ return nil
+}
+
+func Convert_v1_StorageClass_To_storage_StorageClass(in *StorageClass, out *storage.StorageClass, s conversion.Scope) error {
+ return autoConvert_v1_StorageClass_To_storage_StorageClass(in, out, s)
+}
+
+func autoConvert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClass, out *StorageClass, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Provisioner = in.Provisioner
+ out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
+ return nil
+}
+
+func Convert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClass, out *StorageClass, s conversion.Scope) error {
+ return autoConvert_storage_StorageClass_To_v1_StorageClass(in, out, s)
+}
+
+func autoConvert_v1_StorageClassList_To_storage_StorageClassList(in *StorageClassList, out *storage.StorageClassList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]storage.StorageClass)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+func Convert_v1_StorageClassList_To_storage_StorageClassList(in *StorageClassList, out *storage.StorageClassList, s conversion.Scope) error {
+ return autoConvert_v1_StorageClassList_To_storage_StorageClassList(in, out, s)
+}
+
+func autoConvert_storage_StorageClassList_To_v1_StorageClassList(in *storage.StorageClassList, out *StorageClassList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]StorageClass)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+func Convert_storage_StorageClassList_To_v1_StorageClassList(in *storage.StorageClassList, out *StorageClassList, s conversion.Scope) error {
+ return autoConvert_storage_StorageClassList_To_v1_StorageClassList(in, out, s)
+}
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..8b3786ab194
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.deepcopy.go
@@ -0,0 +1,80 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by deepcopy-gen. Do not edit it manually!
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ reflect "reflect"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterDeepCopies)
+}
+
+// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
+// to allow building arbitrary schemes.
+func RegisterDeepCopies(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedDeepCopyFuncs(
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_StorageClass, InType: reflect.TypeOf(&StorageClass{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_StorageClassList, InType: reflect.TypeOf(&StorageClassList{})},
+ )
+}
+
+func DeepCopy_v1_StorageClass(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*StorageClass)
+ out := out.(*StorageClass)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
+ return err
+ } else {
+ out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
+ }
+ if in.Parameters != nil {
+ in, out := &in.Parameters, &out.Parameters
+ *out = make(map[string]string)
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
+ return nil
+ }
+}
+
+func DeepCopy_v1_StorageClassList(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*StorageClassList)
+ out := out.(*StorageClassList)
+ *out = *in
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]StorageClass, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_StorageClass(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.defaults.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.defaults.go
new file mode 100644
index 00000000000..6df448eb9fd
--- /dev/null
+++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1/zz_generated.defaults.go
@@ -0,0 +1,32 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by defaulter-gen. Do not edit it manually!
+
+package v1
+
+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/test/e2e/BUILD b/test/e2e/BUILD
index c54aef0c508..8b8525f1890 100644
--- a/test/e2e/BUILD
+++ b/test/e2e/BUILD
@@ -119,9 +119,7 @@ go_library(
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/apis/rbac/v1beta1:go_default_library",
"//pkg/apis/settings/v1alpha1:go_default_library",
- "//pkg/apis/storage/util:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
- "//pkg/apis/storage/v1beta1/util:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/core/v1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/extensions/v1beta1:go_default_library",
diff --git a/test/e2e/resource_quota.go b/test/e2e/resource_quota.go
index 3b612691a87..0239eb860ff 100644
--- a/test/e2e/resource_quota.go
+++ b/test/e2e/resource_quota.go
@@ -25,7 +25,6 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/api/v1"
- "k8s.io/kubernetes/pkg/apis/storage/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/quota/evaluator/core"
"k8s.io/kubernetes/test/e2e/framework"
@@ -39,6 +38,8 @@ const (
resourceQuotaTimeout = 30 * time.Second
)
+var classGold string = "gold"
+
var _ = framework.KubeDescribe("ResourceQuota", func() {
f := framework.NewDefaultFramework("resourcequota")
@@ -331,17 +332,15 @@ var _ = framework.KubeDescribe("ResourceQuota", func() {
usedResources[v1.ResourceQuotas] = resource.MustParse("1")
usedResources[v1.ResourcePersistentVolumeClaims] = resource.MustParse("0")
usedResources[v1.ResourceRequestsStorage] = resource.MustParse("0")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourcePersistentVolumeClaims)] = resource.MustParse("0")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourceRequestsStorage)] = resource.MustParse("0")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourcePersistentVolumeClaims)] = resource.MustParse("0")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourceRequestsStorage)] = resource.MustParse("0")
err = waitForResourceQuota(f.ClientSet, f.Namespace.Name, quotaName, usedResources)
Expect(err).NotTo(HaveOccurred())
By("Creating a PersistentVolumeClaim with storage class")
pvc := newTestPersistentVolumeClaimForQuota("test-claim")
- pvc.Annotations = map[string]string{
- util.StorageClassAnnotation: "gold",
- }
+ pvc.Spec.StorageClassName = &classGold
pvc, err = f.ClientSet.Core().PersistentVolumeClaims(f.Namespace.Name).Create(pvc)
Expect(err).NotTo(HaveOccurred())
@@ -349,8 +348,8 @@ var _ = framework.KubeDescribe("ResourceQuota", func() {
usedResources = v1.ResourceList{}
usedResources[v1.ResourcePersistentVolumeClaims] = resource.MustParse("1")
usedResources[v1.ResourceRequestsStorage] = resource.MustParse("1Gi")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourcePersistentVolumeClaims)] = resource.MustParse("1")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourceRequestsStorage)] = resource.MustParse("1Gi")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourcePersistentVolumeClaims)] = resource.MustParse("1")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourceRequestsStorage)] = resource.MustParse("1Gi")
err = waitForResourceQuota(f.ClientSet, f.Namespace.Name, quotaName, usedResources)
Expect(err).NotTo(HaveOccurred())
@@ -362,8 +361,8 @@ var _ = framework.KubeDescribe("ResourceQuota", func() {
By("Ensuring resource quota status released usage")
usedResources[v1.ResourcePersistentVolumeClaims] = resource.MustParse("0")
usedResources[v1.ResourceRequestsStorage] = resource.MustParse("0")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourcePersistentVolumeClaims)] = resource.MustParse("0")
- usedResources[core.V1ResourceByStorageClass("gold", v1.ResourceRequestsStorage)] = resource.MustParse("0")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourcePersistentVolumeClaims)] = resource.MustParse("0")
+ usedResources[core.V1ResourceByStorageClass(classGold, v1.ResourceRequestsStorage)] = resource.MustParse("0")
err = waitForResourceQuota(f.ClientSet, f.Namespace.Name, quotaName, usedResources)
Expect(err).NotTo(HaveOccurred())
@@ -580,8 +579,8 @@ func newTestResourceQuota(name string) *v1.ResourceQuota {
hard[v1.ResourceSecrets] = resource.MustParse("10")
hard[v1.ResourcePersistentVolumeClaims] = resource.MustParse("10")
hard[v1.ResourceRequestsStorage] = resource.MustParse("10Gi")
- hard[core.V1ResourceByStorageClass("gold", v1.ResourcePersistentVolumeClaims)] = resource.MustParse("10")
- hard[core.V1ResourceByStorageClass("gold", v1.ResourceRequestsStorage)] = resource.MustParse("10Gi")
+ hard[core.V1ResourceByStorageClass(classGold, v1.ResourcePersistentVolumeClaims)] = resource.MustParse("10")
+ hard[core.V1ResourceByStorageClass(classGold, v1.ResourceRequestsStorage)] = resource.MustParse("10Gi")
return &v1.ResourceQuota{
ObjectMeta: metav1.ObjectMeta{Name: name},
Spec: v1.ResourceQuotaSpec{Hard: hard},
diff --git a/test/e2e/volume_provisioning.go b/test/e2e/volume_provisioning.go
index cc0524c6f50..9ac0aad23d7 100644
--- a/test/e2e/volume_provisioning.go
+++ b/test/e2e/volume_provisioning.go
@@ -27,7 +27,6 @@ import (
"k8s.io/kubernetes/pkg/api/v1"
rbacv1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/test/e2e/framework"
@@ -104,33 +103,63 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
ns = f.Namespace.Name
})
- framework.KubeDescribe("DynamicProvisioner", func() {
+ /*
+ TODO: enable when GKE is updated with the new API
+ framework.KubeDescribe("DynamicProvisioner", func() {
+ It("should create and delete persistent volumes [Slow] [Volume]", func() {
+ framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere")
+
+ By("creating a StorageClass")
+ class := newStorageClass("", "internal")
+ class, err := c.StorageV1beta1().StorageClasses().Create(class)
+ defer c.StorageV1beta1().StorageClasses().Delete(class.Name, nil)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("creating a claim with a dynamic provisioning annotation")
+ claim := newClaim(ns)
+ claim.Spec.StorageClassName = &class.Name
+
+ defer func() {
+ c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil)
+ }()
+ claim, err = c.Core().PersistentVolumeClaims(ns).Create(claim)
+ Expect(err).NotTo(HaveOccurred())
+
+ if framework.ProviderIs("vsphere") {
+ // vsphere provider does not allocate volumes in 1GiB chunks, so setting expected size
+ // equal to requestedSize
+ testDynamicProvisioning(c, claim, requestedSize)
+ } else {
+ // Expected size of the volume is 2GiB, because the other three supported cloud
+ // providers allocate volumes in 1GiB chunks.
+ testDynamicProvisioning(c, claim, "2Gi")
+ }
+ })
+ })
+ */
+ framework.KubeDescribe("DynamicProvisioner Beta", func() {
It("should create and delete persistent volumes [Slow] [Volume]", func() {
- framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere")
+ framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke")
By("creating a StorageClass")
- class := newStorageClass("", "internal")
- _, err := c.Storage().StorageClasses().Create(class)
- defer c.Storage().StorageClasses().Delete(class.Name, nil)
+ class := newStorageClass("", "beta")
+ _, err := c.StorageV1beta1().StorageClasses().Create(class)
+ defer c.StorageV1beta1().StorageClasses().Delete(class.Name, nil)
Expect(err).NotTo(HaveOccurred())
By("creating a claim with a dynamic provisioning annotation")
- claim := newClaim(ns, "internal", false)
+ claim := newClaim(ns)
+ claim.Annotations = map[string]string{
+ v1.BetaStorageClassAnnotation: class.Name,
+ }
+
defer func() {
c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil)
}()
claim, err = c.Core().PersistentVolumeClaims(ns).Create(claim)
Expect(err).NotTo(HaveOccurred())
- if framework.ProviderIs("vsphere") {
- // vsphere provider does not allocate volumes in 1GiB chunks, so setting expected size
- // equal to requestedSize
- testDynamicProvisioning(c, claim, requestedSize)
- } else {
- // Expected size of the volume is 2GiB, because the other three supported cloud
- // providers allocate volumes in 1GiB chunks.
- testDynamicProvisioning(c, claim, "2Gi")
- }
+ testDynamicProvisioning(c, claim, "2Gi")
})
// NOTE: Slow! The test will wait up to 5 minutes (framework.ClaimProvisionTimeout) when there is
@@ -166,15 +195,20 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
}
By("Creating a StorageClass for the unmanaged zone")
- sc := newStorageClass("kubernetes.io/gce-pd", suffix)
+ sc := newStorageClass("", suffix)
// Set an unmanaged zone.
sc.Parameters = map[string]string{"zone": unmanagedZone}
- sc, err = c.Storage().StorageClasses().Create(sc)
- defer Expect(c.Storage().StorageClasses().Delete(sc.Name, nil)).To(Succeed())
+ sc, err = c.StorageV1beta1().StorageClasses().Create(sc)
+ defer Expect(c.StorageV1beta1().StorageClasses().Delete(sc.Name, nil)).To(Succeed())
Expect(err).NotTo(HaveOccurred())
By("Creating a claim and expecting it to timeout")
- pvc := newClaim(ns, suffix, false)
+ pvc := newClaim(ns)
+ // TODO: switch to attribute when GKE is updated
+ pvc.Annotations = map[string]string{
+ v1.BetaStorageClassAnnotation: sc.Name,
+ }
+ //pvc.Spec.StorageClassName = &className
pvc, err = c.Core().PersistentVolumeClaims(ns).Create(pvc)
defer Expect(c.Core().PersistentVolumeClaims(ns).Delete(pvc.Name, nil)).To(Succeed())
Expect(err).NotTo(HaveOccurred())
@@ -191,7 +225,9 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere")
By("creating a claim with an alpha dynamic provisioning annotation")
- claim := newClaim(ns, "", true)
+ claim := newClaim(ns)
+ claim.Annotations = map[string]string{v1.AlphaStorageClassAnnotation: ""}
+
defer func() {
c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil)
}()
@@ -224,12 +260,16 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
By("creating a StorageClass")
class := newStorageClass(externalPluginName, "external")
- _, err = c.Storage().StorageClasses().Create(class)
- defer c.Storage().StorageClasses().Delete(class.Name, nil)
+ _, err = c.StorageV1beta1().StorageClasses().Create(class)
+ defer c.StorageV1beta1().StorageClasses().Delete(class.Name, nil)
Expect(err).NotTo(HaveOccurred())
By("creating a claim with a dynamic provisioning annotation")
- claim := newClaim(ns, "external", false)
+ claim := newClaim(ns)
+ className := class.Name
+ // TODO: switch to attribute when GKE is updated
+ claim.Annotations = map[string]string{v1.BetaStorageClassAnnotation: className}
+ //claim.Spec.StorageClassName = &className
defer func() {
c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil)
}()
@@ -243,7 +283,7 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
})
})
-func newClaim(ns, suffix string, alpha bool) *v1.PersistentVolumeClaim {
+func newClaim(ns string) *v1.PersistentVolumeClaim {
claim := v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "pvc-",
@@ -261,17 +301,6 @@ func newClaim(ns, suffix string, alpha bool) *v1.PersistentVolumeClaim {
},
}
- if alpha {
- claim.Annotations = map[string]string{
- storageutil.AlphaStorageClassAnnotation: "",
- }
- } else {
- claim.Annotations = map[string]string{
- storageutil.StorageClassAnnotation: "myclass-" + suffix,
- }
-
- }
-
return &claim
}
diff --git a/test/integration/storageclasses/storage_classes_test.go b/test/integration/storageclasses/storage_classes_test.go
index 681099204fc..f6ece6df014 100644
--- a/test/integration/storageclasses/storage_classes_test.go
+++ b/test/integration/storageclasses/storage_classes_test.go
@@ -29,7 +29,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/test/integration/framework"
)
@@ -62,23 +61,22 @@ func DoTestStorageClasses(t *testing.T, client clientset.Interface, ns *v1.Names
Provisioner: provisionerPluginName,
}
- if _, err := client.Storage().StorageClasses().Create(&s); err != nil {
+ if _, err := client.StorageV1beta1().StorageClasses().Create(&s); err != nil {
t.Errorf("unable to create test storage class: %v", err)
}
defer deleteStorageClassOrErrorf(t, client, s.Namespace, s.Name)
// Template for pvcs that specify a storage class
+ classGold := "gold"
pvc := &v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: "XXX",
Namespace: ns.Name,
- Annotations: map[string]string{
- storageutil.StorageClassAnnotation: "gold",
- },
},
Spec: v1.PersistentVolumeClaimSpec{
- Resources: v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceName(v1.ResourceStorage): resource.MustParse("1G")}},
- AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
+ Resources: v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceName(v1.ResourceStorage): resource.MustParse("1G")}},
+ AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
+ StorageClassName: &classGold,
},
}
@@ -90,7 +88,7 @@ func DoTestStorageClasses(t *testing.T, client clientset.Interface, ns *v1.Names
}
func deleteStorageClassOrErrorf(t *testing.T, c clientset.Interface, ns, name string) {
- if err := c.Storage().StorageClasses().Delete(name, nil); err != nil {
+ if err := c.StorageV1beta1().StorageClasses().Delete(name, nil); err != nil {
t.Errorf("unable to delete storage class %v: %v", name, err)
}
}
diff --git a/test/integration/volume/persistent_volumes_test.go b/test/integration/volume/persistent_volumes_test.go
index 218d3843a5e..8f06b7e94bf 100644
--- a/test/integration/volume/persistent_volumes_test.go
+++ b/test/integration/volume/persistent_volumes_test.go
@@ -34,7 +34,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
- storageutil "k8s.io/kubernetes/pkg/apis/storage/v1beta1/util"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
fakecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake"
@@ -126,7 +125,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
// This PV will be claimed, released, and recycled.
pv := createPV("fake-pv-recycler", "/tmp/foo", "10G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimRecycle)
- pvc := createPVC("fake-pvc-recycler", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvc := createPVC("fake-pvc-recycler", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
_, err := testClient.PersistentVolumes().Create(pv)
if err != nil {
@@ -181,7 +180,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
// This PV will be claimed, released, and deleted.
pv := createPV("fake-pv-deleter", "/tmp/foo", "10G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimDelete)
- pvc := createPVC("fake-pvc-deleter", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvc := createPVC("fake-pvc-deleter", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
_, err := testClient.PersistentVolumes().Create(pv)
if err != nil {
@@ -240,7 +239,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
defer close(stopCh)
pv := createPV("fake-pv-race", "/tmp/foo", "10G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimRetain)
- pvc := createPVC("fake-pvc-race", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvc := createPVC("fake-pvc-race", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
counter := 0
maxClaims := 100
claims := []*v1.PersistentVolumeClaim{}
@@ -318,7 +317,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
pv_true = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
pv_false = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
- pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes)
+ pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
)
pv_true.ObjectMeta.SetLabels(map[string]string{"foo": "true"})
@@ -399,7 +398,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
pv_true = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
pv_false = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
- pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes)
+ pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
)
pv_true.ObjectMeta.SetLabels(map[string]string{"foo": "valA", "bar": ""})
@@ -500,7 +499,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
[]v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimRetain)
}
- pvc := createPVC("pvc-2", ns.Name, strconv.Itoa(maxPVs/2)+"G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvc := createPVC("pvc-2", ns.Name, strconv.Itoa(maxPVs/2)+"G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
for i := 0; i < maxPVs; i++ {
_, err := testClient.PersistentVolumes().Create(pvs[i])
@@ -589,7 +588,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
// This PV will be claimed, released, and deleted
pvs[i] = createPV("pv-"+strconv.Itoa(i), "/tmp/foo"+strconv.Itoa(i), "1G",
[]v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimRetain)
- pvcs[i] = createPVC("pvc-"+strconv.Itoa(i), ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvcs[i] = createPVC("pvc-"+strconv.Itoa(i), ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
}
// Create PVs first
@@ -746,7 +745,7 @@ func TestPersistentVolumeControllerStartup(t *testing.T) {
pvName := "pv-startup-" + strconv.Itoa(i)
pvcName := "pvc-startup-" + strconv.Itoa(i)
- pvc := createPVC(pvcName, ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
+ pvc := createPVC(pvcName, ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "")
pvc.Annotations = map[string]string{"annBindCompleted": ""}
pvc.Spec.VolumeName = pvName
newPVC, err := testClient.PersistentVolumeClaims(ns.Name).Create(pvc)
@@ -866,7 +865,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes and StorageClasses).
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
- defer testClient.Storage().StorageClasses().DeleteCollection(nil, metav1.ListOptions{})
+ defer testClient.StorageV1beta1().StorageClasses().DeleteCollection(nil, metav1.ListOptions{})
storageClass := storage.StorageClass{
TypeMeta: metav1.TypeMeta{
@@ -877,7 +876,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
},
Provisioner: provisionerPluginName,
}
- testClient.Storage().StorageClasses().Create(&storageClass)
+ testClient.StorageV1beta1().StorageClasses().Create(&storageClass)
stopCh := make(chan struct{})
informers.Start(stopCh)
@@ -887,10 +886,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
objCount := getObjectCount()
pvcs := make([]*v1.PersistentVolumeClaim, objCount)
for i := 0; i < objCount; i++ {
- pvc := createPVC("pvc-provision-"+strconv.Itoa(i), ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
- pvc.Annotations = map[string]string{
- storageutil.StorageClassAnnotation: "gold",
- }
+ pvc := createPVC("pvc-provision-"+strconv.Itoa(i), ns.Name, "1G", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, "gold")
pvcs[i] = pvc
}
@@ -976,7 +972,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
pv_rwm := createPV("pv-rwm", "/tmp/bar", "10G",
[]v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, v1.PersistentVolumeReclaimRetain)
- pvc := createPVC("pvc-rwm", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteMany})
+ pvc := createPVC("pvc-rwm", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, "")
_, err := testClient.PersistentVolumes().Create(pv_rwm)
if err != nil {
@@ -1167,15 +1163,16 @@ func createPV(name, path, cap string, mode []v1.PersistentVolumeAccessMode, recl
}
}
-func createPVC(name, namespace, cap string, mode []v1.PersistentVolumeAccessMode) *v1.PersistentVolumeClaim {
+func createPVC(name, namespace, cap string, mode []v1.PersistentVolumeAccessMode, class string) *v1.PersistentVolumeClaim {
return &v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Spec: v1.PersistentVolumeClaimSpec{
- Resources: v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceName(v1.ResourceStorage): resource.MustParse(cap)}},
- AccessModes: mode,
+ Resources: v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceName(v1.ResourceStorage): resource.MustParse(cap)}},
+ AccessModes: mode,
+ StorageClassName: &class,
},
}
}
diff --git a/vendor/BUILD b/vendor/BUILD
index e5076fec434..ecba0181aeb 100644
--- a/vendor/BUILD
+++ b/vendor/BUILD
@@ -11764,6 +11764,7 @@ go_library(
"//vendor:k8s.io/client-go/pkg/apis/rbac/v1alpha1",
"//vendor:k8s.io/client-go/pkg/apis/rbac/v1beta1",
"//vendor:k8s.io/client-go/pkg/apis/settings/v1alpha1",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
"//vendor:k8s.io/client-go/pkg/apis/storage/v1beta1",
"//vendor:k8s.io/client-go/tools/cache",
],
@@ -12135,10 +12136,30 @@ go_library(
tags = ["automanaged"],
deps = [
"//vendor:k8s.io/client-go/informers/internalinterfaces",
+ "//vendor:k8s.io/client-go/informers/storage/v1",
"//vendor:k8s.io/client-go/informers/storage/v1beta1",
],
)
+go_library(
+ name = "k8s.io/client-go/informers/storage/v1",
+ srcs = [
+ "k8s.io/client-go/informers/storage/v1/interface.go",
+ "k8s.io/client-go/informers/storage/v1/storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/runtime",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/informers/internalinterfaces",
+ "//vendor:k8s.io/client-go/kubernetes",
+ "//vendor:k8s.io/client-go/listers/storage/v1",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
+ "//vendor:k8s.io/client-go/tools/cache",
+ ],
+)
+
go_library(
name = "k8s.io/client-go/informers/storage/v1beta1",
srcs = [
@@ -12185,6 +12206,7 @@ go_library(
"//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1alpha1",
"//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1beta1",
"//vendor:k8s.io/client-go/kubernetes/typed/settings/v1alpha1",
+ "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1",
"//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1",
"//vendor:k8s.io/client-go/pkg/api",
"//vendor:k8s.io/client-go/pkg/api/install",
@@ -12255,6 +12277,8 @@ go_library(
"//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake",
"//vendor:k8s.io/client-go/kubernetes/typed/settings/v1alpha1",
"//vendor:k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake",
+ "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1",
+ "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1/fake",
"//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1",
"//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake",
"//vendor:k8s.io/client-go/pkg/api/install",
@@ -12301,6 +12325,7 @@ go_library(
"//vendor:k8s.io/client-go/pkg/apis/rbac/v1alpha1",
"//vendor:k8s.io/client-go/pkg/apis/rbac/v1beta1",
"//vendor:k8s.io/client-go/pkg/apis/settings/v1alpha1",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
"//vendor:k8s.io/client-go/pkg/apis/storage/v1beta1",
],
)
@@ -13045,6 +13070,47 @@ go_library(
],
)
+go_library(
+ name = "k8s.io/client-go/kubernetes/typed/storage/v1",
+ srcs = [
+ "k8s.io/client-go/kubernetes/typed/storage/v1/doc.go",
+ "k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go",
+ "k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go",
+ "k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/serializer",
+ "//vendor:k8s.io/apimachinery/pkg/types",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/kubernetes/scheme",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
+ "//vendor:k8s.io/client-go/rest",
+ ],
+)
+
+go_library(
+ name = "k8s.io/client-go/kubernetes/typed/storage/v1/fake",
+ srcs = [
+ "k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go",
+ "k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go",
+ "k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/labels",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
+ "//vendor:k8s.io/apimachinery/pkg/types",
+ "//vendor:k8s.io/apimachinery/pkg/watch",
+ "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
+ "//vendor:k8s.io/client-go/rest",
+ "//vendor:k8s.io/client-go/testing",
+ ],
+)
+
go_library(
name = "k8s.io/client-go/kubernetes/typed/storage/v1beta1",
srcs = [
@@ -13331,6 +13397,23 @@ go_library(
],
)
+go_library(
+ name = "k8s.io/client-go/listers/storage/v1",
+ srcs = [
+ "k8s.io/client-go/listers/storage/v1/expansion_generated.go",
+ "k8s.io/client-go/listers/storage/v1/storageclass.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//vendor:k8s.io/apimachinery/pkg/api/errors",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/labels",
+ "//vendor:k8s.io/client-go/pkg/apis/storage",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
+ "//vendor:k8s.io/client-go/tools/cache",
+ ],
+)
+
go_library(
name = "k8s.io/client-go/listers/storage/v1beta1",
srcs = [
@@ -14248,10 +14331,35 @@ go_library(
"//vendor:k8s.io/apimachinery/pkg/util/sets",
"//vendor:k8s.io/client-go/pkg/api",
"//vendor:k8s.io/client-go/pkg/apis/storage",
+ "//vendor:k8s.io/client-go/pkg/apis/storage/v1",
"//vendor:k8s.io/client-go/pkg/apis/storage/v1beta1",
],
)
+go_library(
+ name = "k8s.io/client-go/pkg/apis/storage/v1",
+ srcs = [
+ "k8s.io/client-go/pkg/apis/storage/v1/doc.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/generated.pb.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/register.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/types.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/types_swagger_doc_generated.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/zz_generated.conversion.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/zz_generated.deepcopy.go",
+ "k8s.io/client-go/pkg/apis/storage/v1/zz_generated.defaults.go",
+ ],
+ tags = ["automanaged"],
+ deps = [
+ "//vendor:github.com/gogo/protobuf/proto",
+ "//vendor:github.com/gogo/protobuf/sortkeys",
+ "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
+ "//vendor:k8s.io/apimachinery/pkg/conversion",
+ "//vendor:k8s.io/apimachinery/pkg/runtime",
+ "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
+ "//vendor:k8s.io/client-go/pkg/apis/storage",
+ ],
+)
+
go_library(
name = "k8s.io/client-go/pkg/apis/storage/v1beta1",
srcs = [