diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json
index 02b632f57d..9684eb25e1 100644
--- a/api/openapi-spec/swagger.json
+++ b/api/openapi-spec/swagger.json
@@ -21339,6 +21339,160 @@
}
]
},
+ "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale": {
+ "get": {
+ "description": "read scale of the specified StatefulSet",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "apps_v1beta1"
+ ],
+ "operationId": "readAppsV1beta1NamespacedStatefulSetScale",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta1.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "get",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta1"
+ }
+ },
+ "put": {
+ "description": "replace scale of the specified StatefulSet",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "apps_v1beta1"
+ ],
+ "operationId": "replaceAppsV1beta1NamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta1.Scale"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta1.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "put",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta1"
+ }
+ },
+ "patch": {
+ "description": "partially update scale of the specified StatefulSet",
+ "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": [
+ "apps_v1beta1"
+ ],
+ "operationId": "patchAppsV1beta1NamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta1.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "patch",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta1"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the Scale",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
"/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status": {
"get": {
"description": "read status of the specified StatefulSet",
@@ -25360,6 +25514,160 @@
}
]
},
+ "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale": {
+ "get": {
+ "description": "read scale of the specified StatefulSet",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "apps_v1beta2"
+ ],
+ "operationId": "readAppsV1beta2NamespacedStatefulSetScale",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta2.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "get",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta2"
+ }
+ },
+ "put": {
+ "description": "replace scale of the specified StatefulSet",
+ "consumes": [
+ "*/*"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "schemes": [
+ "https"
+ ],
+ "tags": [
+ "apps_v1beta2"
+ ],
+ "operationId": "replaceAppsV1beta2NamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta2.Scale"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta2.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "put",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta2"
+ }
+ },
+ "patch": {
+ "description": "partially update scale of the specified StatefulSet",
+ "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": [
+ "apps_v1beta2"
+ ],
+ "operationId": "patchAppsV1beta2NamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/io.k8s.api.apps.v1beta2.Scale"
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ }
+ },
+ "x-kubernetes-action": "patch",
+ "x-kubernetes-group-version-kind": {
+ "group": "apps",
+ "kind": "Scale",
+ "version": "v1beta2"
+ }
+ },
+ "parameters": [
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "name of the Scale",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "object name and auth scope, such as for teams and projects",
+ "name": "namespace",
+ "in": "path",
+ "required": true
+ },
+ {
+ "uniqueItems": true,
+ "type": "string",
+ "description": "If 'true', then the output is pretty printed.",
+ "name": "pretty",
+ "in": "query"
+ }
+ ]
+ },
"/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status": {
"get": {
"description": "read status of the specified StatefulSet",
diff --git a/api/swagger-spec/apps_v1beta1.json b/api/swagger-spec/apps_v1beta1.json
index 5524e1f712..2f384bd93c 100644
--- a/api/swagger-spec/apps_v1beta1.json
+++ b/api/swagger-spec/apps_v1beta1.json
@@ -2982,6 +2982,171 @@
}
]
},
+ {
+ "path": "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale",
+ "description": "API at /apis/apps/v1beta1",
+ "operations": [
+ {
+ "type": "v1beta1.Scale",
+ "method": "GET",
+ "summary": "read scale of the specified StatefulSet",
+ "nickname": "readNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.Scale",
+ "method": "PUT",
+ "summary": "replace scale of the specified StatefulSet",
+ "nickname": "replaceNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1beta1.Scale",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta1.Scale",
+ "method": "PATCH",
+ "summary": "partially update scale of the specified StatefulSet",
+ "nickname": "patchNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta1.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ }
+ ]
+ },
{
"path": "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status",
"description": "API at /apis/apps/v1beta1",
diff --git a/api/swagger-spec/apps_v1beta2.json b/api/swagger-spec/apps_v1beta2.json
index dec3f47f91..0dd7d9ae7e 100644
--- a/api/swagger-spec/apps_v1beta2.json
+++ b/api/swagger-spec/apps_v1beta2.json
@@ -4338,6 +4338,171 @@
}
]
},
+ {
+ "path": "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale",
+ "description": "API at /apis/apps/v1beta2",
+ "operations": [
+ {
+ "type": "v1beta2.Scale",
+ "method": "GET",
+ "summary": "read scale of the specified StatefulSet",
+ "nickname": "readNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta2.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta2.Scale",
+ "method": "PUT",
+ "summary": "replace scale of the specified StatefulSet",
+ "nickname": "replaceNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1beta2.Scale",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta2.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "*/*"
+ ]
+ },
+ {
+ "type": "v1beta2.Scale",
+ "method": "PATCH",
+ "summary": "partially update scale of the specified StatefulSet",
+ "nickname": "patchNamespacedStatefulSetScale",
+ "parameters": [
+ {
+ "type": "string",
+ "paramType": "query",
+ "name": "pretty",
+ "description": "If 'true', then the output is pretty printed.",
+ "required": false,
+ "allowMultiple": false
+ },
+ {
+ "type": "v1.Patch",
+ "paramType": "body",
+ "name": "body",
+ "description": "",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "namespace",
+ "description": "object name and auth scope, such as for teams and projects",
+ "required": true,
+ "allowMultiple": false
+ },
+ {
+ "type": "string",
+ "paramType": "path",
+ "name": "name",
+ "description": "name of the Scale",
+ "required": true,
+ "allowMultiple": false
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 200,
+ "message": "OK",
+ "responseModel": "v1beta2.Scale"
+ }
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
+ ],
+ "consumes": [
+ "application/json-patch+json",
+ "application/merge-patch+json",
+ "application/strategic-merge-patch+json"
+ ]
+ }
+ ]
+ },
{
"path": "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status",
"description": "API at /apis/apps/v1beta2",
diff --git a/docs/api-reference/apps/v1beta1/operations.html b/docs/api-reference/apps/v1beta1/operations.html
index 42ce7aeb67..fee327b7d0 100755
--- a/docs/api-reference/apps/v1beta1/operations.html
+++ b/docs/api-reference/apps/v1beta1/operations.html
@@ -4609,6 +4609,385 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
+
read scale of the specified StatefulSet
+
+
+
GET /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta1.Scale |
+
+
+
+
+
+
+
+
+
+
+
replace scale of the specified StatefulSet
+
+
+
PUT /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1beta1.Scale |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta1.Scale |
+
+
+
+
+
+
+
+
+
+
+
partially update scale of the specified StatefulSet
+
+
+
PATCH /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.Patch |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta1.Scale |
+
+
+
+
+
+
+
Consumes
+
+
+-
+
application/json-patch+json
+
+-
+
application/merge-patch+json
+
+-
+
application/strategic-merge-patch+json
+
+
+
+
+
+
+
+
read status of the specified StatefulSet
@@ -4616,7 +4995,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -4666,7 +5045,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -4691,7 +5070,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -4701,7 +5080,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -4717,7 +5096,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -4735,7 +5114,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -4793,7 +5172,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -4818,7 +5197,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -4828,7 +5207,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -4844,7 +5223,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -4862,7 +5241,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -4920,7 +5299,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -4945,7 +5324,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -4961,471 +5340,6 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
-
-
-
list or watch objects of kind StatefulSet
-
-
-
GET /apis/apps/v1beta1/statefulsets
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-false |
-integer (int32) |
- |
-
-
-
-
-
-
-
-
-
Produces
-
-
--
-
application/json
-
--
-
application/yaml
-
--
-
application/vnd.kubernetes.protobuf
-
--
-
application/json;stream=watch
-
--
-
application/vnd.kubernetes.protobuf;stream=watch
-
-
-
-
-
-
-
-
watch individual changes to a list of ControllerRevision
-
-
-
GET /apis/apps/v1beta1/watch/controllerrevisions
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-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
-
-
-
-
-
-
-
-
watch individual changes to a list of Deployment
-
-
-
GET /apis/apps/v1beta1/watch/deployments
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-false |
-integer (int32) |
- |
-
-
-
-
-
-
-
Responses
-
-
-
-
-
-
-
-
-HTTP Code |
-Description |
-Schema |
-
-
-
-
-200 |
-success |
-v1.WatchEvent |
-
-
-
-
-
-
-
Produces
@@ -5438,12 +5352,6 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
application/vnd.kubernetes.protobuf
--
-
application/json;stream=watch
-
--
-
application/vnd.kubernetes.protobuf;stream=watch
-
@@ -5459,10 +5367,10 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
watch individual changes to a list of ControllerRevision
+
list or watch objects of kind StatefulSet
-
GET /apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions
+
GET /apis/apps/v1beta1/statefulsets
@@ -5543,14 +5451,6 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
integer (int32) |
|
-
-PathParameter |
-namespace |
-object name and auth scope, such as for teams and projects |
-true |
-string |
- |
-
@@ -5574,7 +5474,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
200 |
success |
-v1.WatchEvent |
+v1beta1.StatefulSetList |
@@ -5624,6 +5524,485 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
+
watch individual changes to a list of ControllerRevision
+
+
+
GET /apis/apps/v1beta1/watch/controllerrevisions
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+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
+
+
+
+
+
+
+
+
watch individual changes to a list of Deployment
+
+
+
GET /apis/apps/v1beta1/watch/deployments
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+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
+
+
+
+
+
+
+
+
watch individual changes to a list of ControllerRevision
+
+
+
GET /apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+false |
+integer (int32) |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1.WatchEvent |
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
watch changes to an object of kind ControllerRevision
@@ -5631,7 +6010,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -5729,7 +6108,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -5754,7 +6133,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -5764,7 +6143,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -5786,7 +6165,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -5804,7 +6183,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -5894,7 +6273,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -5919,7 +6298,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -5929,7 +6308,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -5951,7 +6330,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -5969,7 +6348,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6067,7 +6446,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6092,7 +6471,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6102,7 +6481,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6124,7 +6503,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -6142,7 +6521,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6232,7 +6611,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6257,7 +6636,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6267,7 +6646,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6289,7 +6668,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -6307,7 +6686,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6405,7 +6784,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6430,7 +6809,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6440,7 +6819,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6462,7 +6841,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -6480,7 +6859,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6562,7 +6941,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6587,7 +6966,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6597,7 +6976,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6619,7 +6998,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
diff --git a/docs/api-reference/apps/v1beta2/operations.html b/docs/api-reference/apps/v1beta2/operations.html
index ef9f89c69f..c7f4095ff5 100755
--- a/docs/api-reference/apps/v1beta2/operations.html
+++ b/docs/api-reference/apps/v1beta2/operations.html
@@ -6735,6 +6735,385 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
+
read scale of the specified StatefulSet
+
+
+
GET /apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta2.Scale |
+
+
+
+
+
+
+
+
+
+
+
replace scale of the specified StatefulSet
+
+
+
PUT /apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1beta2.Scale |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta2.Scale |
+
+
+
+
+
+
+
+
+
+
+
partially update scale of the specified StatefulSet
+
+
+
PATCH /apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+BodyParameter |
+body |
+ |
+true |
+v1.Patch |
+ |
+
+
+PathParameter |
+namespace |
+object name and auth scope, such as for teams and projects |
+true |
+string |
+ |
+
+
+PathParameter |
+name |
+name of the Scale |
+true |
+string |
+ |
+
+
+
+
+
+
+
Responses
+
+
+
+
+
+
+
+
+HTTP Code |
+Description |
+Schema |
+
+
+
+
+200 |
+success |
+v1beta2.Scale |
+
+
+
+
+
+
+
Consumes
+
+
+-
+
application/json-patch+json
+
+-
+
application/merge-patch+json
+
+-
+
application/strategic-merge-patch+json
+
+
+
+
+
+
+
+
read status of the specified StatefulSet
@@ -6742,7 +7121,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6792,7 +7171,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6817,7 +7196,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6827,7 +7206,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6843,7 +7222,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -6861,7 +7240,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -6919,7 +7298,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -6944,7 +7323,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -6954,7 +7333,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -6970,7 +7349,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -6988,7 +7367,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -7046,7 +7425,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -7071,7 +7450,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -7087,471 +7466,6 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
-
-
-
list or watch objects of kind ReplicaSet
-
-
-
GET /apis/apps/v1beta2/replicasets
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-false |
-integer (int32) |
- |
-
-
-
-
-
-
-
-
-
Produces
-
-
--
-
application/json
-
--
-
application/yaml
-
--
-
application/vnd.kubernetes.protobuf
-
--
-
application/json;stream=watch
-
--
-
application/vnd.kubernetes.protobuf;stream=watch
-
-
-
-
-
-
-
-
list or watch objects of kind StatefulSet
-
-
-
GET /apis/apps/v1beta2/statefulsets
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-false |
-integer (int32) |
- |
-
-
-
-
-
-
-
-
-
Produces
-
-
--
-
application/json
-
--
-
application/yaml
-
--
-
application/vnd.kubernetes.protobuf
-
--
-
application/json;stream=watch
-
--
-
application/vnd.kubernetes.protobuf;stream=watch
-
-
-
-
-
-
-
-
watch individual changes to a list of DaemonSet
-
-
-
GET /apis/apps/v1beta2/watch/daemonsets
-
-
-
-
Parameters
-
-
-
-
-
-
-
-
-
-
-
-Type |
-Name |
-Description |
-Required |
-Schema |
-Default |
-
-
-
-
-QueryParameter |
-pretty |
-If true, then the output is pretty printed. |
-false |
-string |
- |
-
-
-QueryParameter |
-labelSelector |
-A selector to restrict the list of returned objects by their labels. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-fieldSelector |
-A selector to restrict the list of returned objects by their fields. Defaults to everything. |
-false |
-string |
- |
-
-
-QueryParameter |
-includeUninitialized |
-If true, partially initialized resources are included in the response. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-watch |
-Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
-false |
-boolean |
- |
-
-
-QueryParameter |
-resourceVersion |
-When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
-false |
-string |
- |
-
-
-QueryParameter |
-timeoutSeconds |
-Timeout for the list/watch call. |
-false |
-integer (int32) |
- |
-
-
-
-
-
-
-
Responses
-
-
-
-
-
-
-
-
-HTTP Code |
-Description |
-Schema |
-
-
-
-
-200 |
-success |
-v1.WatchEvent |
-
-
-
-
-
-
-
Produces
@@ -7564,12 +7478,6 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
application/vnd.kubernetes.protobuf
--
-
application/json;stream=watch
-
--
-
application/vnd.kubernetes.protobuf;stream=watch
-
@@ -7585,10 +7493,10 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
watch individual changes to a list of Deployment
+
list or watch objects of kind ReplicaSet
-
GET /apis/apps/v1beta2/watch/deployments
+
GET /apis/apps/v1beta2/replicasets
@@ -7742,6 +7650,477 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
+
list or watch objects of kind StatefulSet
+
+
+
GET /apis/apps/v1beta2/statefulsets
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+false |
+integer (int32) |
+ |
+
+
+
+
+
+
+
+
+
Produces
+
+
+-
+
application/json
+
+-
+
application/yaml
+
+-
+
application/vnd.kubernetes.protobuf
+
+-
+
application/json;stream=watch
+
+-
+
application/vnd.kubernetes.protobuf;stream=watch
+
+
+
+
+
+
+
+
watch individual changes to a list of DaemonSet
+
+
+
GET /apis/apps/v1beta2/watch/daemonsets
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+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
+
+
+
+
+
+
+
+
watch individual changes to a list of Deployment
+
+
+
GET /apis/apps/v1beta2/watch/deployments
+
+
+
+
Parameters
+
+
+
+
+
+
+
+
+
+
+
+Type |
+Name |
+Description |
+Required |
+Schema |
+Default |
+
+
+
+
+QueryParameter |
+pretty |
+If true, then the output is pretty printed. |
+false |
+string |
+ |
+
+
+QueryParameter |
+labelSelector |
+A selector to restrict the list of returned objects by their labels. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+fieldSelector |
+A selector to restrict the list of returned objects by their fields. Defaults to everything. |
+false |
+string |
+ |
+
+
+QueryParameter |
+includeUninitialized |
+If true, partially initialized resources are included in the response. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+watch |
+Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
+false |
+boolean |
+ |
+
+
+QueryParameter |
+resourceVersion |
+When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
+false |
+string |
+ |
+
+
+QueryParameter |
+timeoutSeconds |
+Timeout for the list/watch call. |
+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
+
+
+
+
+
+
+
watch individual changes to a list of DaemonSet
@@ -7749,7 +8128,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -7839,7 +8218,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -7864,7 +8243,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -7874,7 +8253,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -7896,7 +8275,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -7914,7 +8293,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8012,7 +8391,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8037,7 +8416,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8047,7 +8426,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8069,7 +8448,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8087,7 +8466,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8177,7 +8556,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8202,7 +8581,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8212,7 +8591,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8234,7 +8613,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8252,7 +8631,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8350,7 +8729,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8375,7 +8754,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8385,7 +8764,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8407,7 +8786,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8425,7 +8804,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8515,7 +8894,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8540,7 +8919,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8550,7 +8929,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8572,7 +8951,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8590,7 +8969,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8688,7 +9067,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8713,7 +9092,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8723,7 +9102,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8745,7 +9124,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8763,7 +9142,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -8853,7 +9232,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -8878,7 +9257,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -8888,7 +9267,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -8910,7 +9289,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -8928,7 +9307,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -9026,7 +9405,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -9051,7 +9430,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -9061,7 +9440,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -9083,7 +9462,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -9101,7 +9480,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -9183,7 +9562,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -9208,7 +9587,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -9218,7 +9597,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -9240,7 +9619,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
@@ -9258,7 +9637,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Parameters
+
Parameters
@@ -9340,7 +9719,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Responses
+
Responses
@@ -9365,7 +9744,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Consumes
+
Consumes
-
@@ -9375,7 +9754,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
Produces
+
Produces
-
@@ -9397,7 +9776,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
-
+
-
diff --git a/pkg/registry/apps/rest/storage_apps.go b/pkg/registry/apps/rest/storage_apps.go
index ff82d94c24..545d46405d 100644
--- a/pkg/registry/apps/rest/storage_apps.go
+++ b/pkg/registry/apps/rest/storage_apps.go
@@ -63,9 +63,10 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
storage["deployments/scale"] = deploymentStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
- statefulsetStorage, statefulsetStatusStorage := statefulsetstore.NewREST(restOptionsGetter)
- storage["statefulsets"] = statefulsetStorage
- storage["statefulsets/status"] = statefulsetStatusStorage
+ statefulSetStorage := statefulsetstore.NewStorage(restOptionsGetter)
+ storage["statefulsets"] = statefulSetStorage.StatefulSet
+ storage["statefulsets/status"] = statefulSetStorage.Status
+ storage["statefulsets/scale"] = statefulSetStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("controllerrevisions")) {
historyStorage := controllerrevisionsstore.NewREST(restOptionsGetter)
@@ -86,9 +87,10 @@ func (p RESTStorageProvider) v1beta2Storage(apiResourceConfigSource serverstorag
storage["deployments/scale"] = deploymentStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
- statefulsetStorage, statefulsetStatusStorage := statefulsetstore.NewREST(restOptionsGetter)
- storage["statefulsets"] = statefulsetStorage
- storage["statefulsets/status"] = statefulsetStatusStorage
+ statefulSetStorage := statefulsetstore.NewStorage(restOptionsGetter)
+ storage["statefulsets"] = statefulSetStorage.StatefulSet
+ storage["statefulsets/status"] = statefulSetStorage.Status
+ storage["statefulsets/scale"] = statefulSetStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("daemonsets")) {
daemonSetStorage, daemonSetStatusStorage := daemonsetstore.NewREST(restOptionsGetter)
diff --git a/pkg/registry/apps/statefulset/BUILD b/pkg/registry/apps/statefulset/BUILD
index c9d4f03c72..b2e690d623 100644
--- a/pkg/registry/apps/statefulset/BUILD
+++ b/pkg/registry/apps/statefulset/BUILD
@@ -12,6 +12,7 @@ go_library(
name = "go_default_library",
srcs = [
"doc.go",
+ "registry.go",
"strategy.go",
],
tags = ["automanaged"],
@@ -20,8 +21,12 @@ go_library(
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/validation:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library",
"//vendor/k8s.io/apiserver/pkg/storage/names:go_default_library",
diff --git a/pkg/registry/apps/statefulset/registry.go b/pkg/registry/apps/statefulset/registry.go
new file mode 100644
index 0000000000..25d136f862
--- /dev/null
+++ b/pkg/registry/apps/statefulset/registry.go
@@ -0,0 +1,95 @@
+/*
+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 statefulset
+
+import (
+ "fmt"
+
+ "k8s.io/apimachinery/pkg/api/errors"
+ metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/watch"
+ genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+ "k8s.io/apiserver/pkg/registry/rest"
+ "k8s.io/kubernetes/pkg/api"
+ "k8s.io/kubernetes/pkg/apis/apps"
+)
+
+// Registry is an interface for things that know how to store StatefulSets.
+type Registry interface {
+ ListStatefulSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*apps.StatefulSetList, error)
+ WatchStatefulSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
+ GetStatefulSet(ctx genericapirequest.Context, statefulSetID string, options *metav1.GetOptions) (*apps.StatefulSet, error)
+ CreateStatefulSet(ctx genericapirequest.Context, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error)
+ UpdateStatefulSet(ctx genericapirequest.Context, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error)
+ DeleteStatefulSet(ctx genericapirequest.Context, statefulSetID string) error
+}
+
+// storage puts strong typing around storage calls
+type storage struct {
+ rest.StandardStorage
+}
+
+// NewRegistry returns a new Registry interface for the given Storage. Any mismatched
+// types will panic.
+func NewRegistry(s rest.StandardStorage) Registry {
+ return &storage{s}
+}
+
+func (s *storage) ListStatefulSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*apps.StatefulSetList, error) {
+ if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() {
+ return nil, fmt.Errorf("field selector not supported yet")
+ }
+ obj, err := s.List(ctx, options)
+ if err != nil {
+ return nil, err
+ }
+ return obj.(*apps.StatefulSetList), err
+}
+
+func (s *storage) WatchStatefulSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
+ return s.Watch(ctx, options)
+}
+
+func (s *storage) GetStatefulSet(ctx genericapirequest.Context, statefulSetID string, options *metav1.GetOptions) (*apps.StatefulSet, error) {
+ obj, err := s.Get(ctx, statefulSetID, options)
+ if err != nil {
+ return nil, errors.NewNotFound(apps.Resource("statefulsets/scale"), statefulSetID)
+ }
+ return obj.(*apps.StatefulSet), nil
+}
+
+func (s *storage) CreateStatefulSet(ctx genericapirequest.Context, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error) {
+ obj, err := s.Create(ctx, statefulSet, false)
+ if err != nil {
+ return nil, err
+ }
+ return obj.(*apps.StatefulSet), nil
+}
+
+func (s *storage) UpdateStatefulSet(ctx genericapirequest.Context, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error) {
+ obj, _, err := s.Update(ctx, statefulSet.Name, rest.DefaultUpdatedObjectInfo(statefulSet, api.Scheme))
+ if err != nil {
+ return nil, err
+ }
+ return obj.(*apps.StatefulSet), nil
+}
+
+func (s *storage) DeleteStatefulSet(ctx genericapirequest.Context, statefulSetID string) error {
+ _, _, err := s.Delete(ctx, statefulSetID, nil)
+ return err
+}
diff --git a/pkg/registry/apps/statefulset/storage/BUILD b/pkg/registry/apps/statefulset/storage/BUILD
index 9efc691e4f..c8d5023a1a 100644
--- a/pkg/registry/apps/statefulset/storage/BUILD
+++ b/pkg/registry/apps/statefulset/storage/BUILD
@@ -16,10 +16,14 @@ go_test(
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/apps:go_default_library",
+ "//pkg/apis/extensions:go_default_library",
"//pkg/registry/registrytest:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library",
@@ -34,8 +38,11 @@ go_library(
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/apps:go_default_library",
+ "//pkg/apis/extensions:go_default_library",
+ "//pkg/apis/extensions/validation:go_default_library",
"//pkg/registry/apps/statefulset:go_default_library",
"//pkg/registry/cachesize:go_default_library",
+ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
diff --git a/pkg/registry/apps/statefulset/storage/storage.go b/pkg/registry/apps/statefulset/storage/storage.go
index dac28b0e84..80375251a9 100644
--- a/pkg/registry/apps/statefulset/storage/storage.go
+++ b/pkg/registry/apps/statefulset/storage/storage.go
@@ -17,6 +17,9 @@ limitations under the License.
package storage
import (
+ "fmt"
+
+ "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@@ -24,23 +27,43 @@ import (
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/kubernetes/pkg/api"
- appsapi "k8s.io/kubernetes/pkg/apis/apps"
+ "k8s.io/kubernetes/pkg/apis/apps"
+ "k8s.io/kubernetes/pkg/apis/extensions"
+ extvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/registry/apps/statefulset"
"k8s.io/kubernetes/pkg/registry/cachesize"
)
-// rest implements a RESTStorage for replication controllers against etcd
+// StatefulSetStorage includes dummy storage for StatefulSets, and their Status and Scale subresource.
+type StatefulSetStorage struct {
+ StatefulSet *REST
+ Status *StatusREST
+ Scale *ScaleREST
+}
+
+func NewStorage(optsGetter generic.RESTOptionsGetter) StatefulSetStorage {
+ statefulSetRest, statefulSetStatusRest := NewREST(optsGetter)
+ statefulSetRegistry := statefulset.NewRegistry(statefulSetRest)
+
+ return StatefulSetStorage{
+ StatefulSet: statefulSetRest,
+ Status: statefulSetStatusRest,
+ Scale: &ScaleREST{registry: statefulSetRegistry},
+ }
+}
+
+// rest implements a RESTStorage for statefulsets against etcd
type REST struct {
*genericregistry.Store
}
-// NewREST returns a RESTStorage object that will work against replication controllers.
+// NewREST returns a RESTStorage object that will work against statefulsets.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
store := &genericregistry.Store{
Copier: api.Scheme,
- NewFunc: func() runtime.Object { return &appsapi.StatefulSet{} },
- NewListFunc: func() runtime.Object { return &appsapi.StatefulSetList{} },
- DefaultQualifiedResource: appsapi.Resource("statefulsets"),
+ NewFunc: func() runtime.Object { return &apps.StatefulSet{} },
+ NewListFunc: func() runtime.Object { return &apps.StatefulSetList{} },
+ DefaultQualifiedResource: apps.Resource("statefulsets"),
WatchCacheSize: cachesize.GetWatchCacheSizeByResource("statefulsets"),
CreateStrategy: statefulset.Strategy,
@@ -71,7 +94,7 @@ type StatusREST struct {
}
func (r *StatusREST) New() runtime.Object {
- return &appsapi.StatefulSet{}
+ return &apps.StatefulSet{}
}
// Get retrieves the object from the storage. It is required to support Patch.
@@ -91,3 +114,88 @@ var _ rest.ShortNamesProvider = &REST{}
func (r *REST) ShortNames() []string {
return []string{"sts"}
}
+
+type ScaleREST struct {
+ registry statefulset.Registry
+}
+
+// ScaleREST implements Patcher
+var _ = rest.Patcher(&ScaleREST{})
+
+// New creates a new Scale object
+func (r *ScaleREST) New() runtime.Object {
+ return &extensions.Scale{}
+}
+
+func (r *ScaleREST) Get(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
+ ss, err := r.registry.GetStatefulSet(ctx, name, options)
+ if err != nil {
+ return nil, err
+ }
+ scale, err := scaleFromStatefulSet(ss)
+ if err != nil {
+ return nil, errors.NewBadRequest(fmt.Sprintf("%v", err))
+ }
+ return scale, err
+}
+
+func (r *ScaleREST) Update(ctx genericapirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
+ ss, err := r.registry.GetStatefulSet(ctx, name, &metav1.GetOptions{})
+ if err != nil {
+ return nil, false, err
+ }
+
+ oldScale, err := scaleFromStatefulSet(ss)
+ if err != nil {
+ return nil, false, err
+ }
+
+ obj, err := objInfo.UpdatedObject(ctx, oldScale)
+ if err != nil {
+ return nil, false, err
+ }
+ if obj == nil {
+ return nil, false, errors.NewBadRequest(fmt.Sprintf("nil update passed to Scale"))
+ }
+ scale, ok := obj.(*extensions.Scale)
+ if !ok {
+ return nil, false, errors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj))
+ }
+
+ if errs := extvalidation.ValidateScale(scale); len(errs) > 0 {
+ return nil, false, errors.NewInvalid(extensions.Kind("Scale"), scale.Name, errs)
+ }
+
+ ss.Spec.Replicas = scale.Spec.Replicas
+ ss.ResourceVersion = scale.ResourceVersion
+ ss, err = r.registry.UpdateStatefulSet(ctx, ss)
+ if err != nil {
+ return nil, false, err
+ }
+ newScale, err := scaleFromStatefulSet(ss)
+ if err != nil {
+ return nil, false, errors.NewBadRequest(fmt.Sprintf("%v", err))
+ }
+ return newScale, false, err
+}
+
+// scaleFromStatefulSet returns a scale subresource for a statefulset.
+func scaleFromStatefulSet(ss *apps.StatefulSet) (*extensions.Scale, error) {
+ return &extensions.Scale{
+ // TODO: Create a variant of ObjectMeta type that only contains the fields below.
+ ObjectMeta: metav1.ObjectMeta{
+ Name: ss.Name,
+ Namespace: ss.Namespace,
+ UID: ss.UID,
+ ResourceVersion: ss.ResourceVersion,
+ CreationTimestamp: ss.CreationTimestamp,
+ },
+ Spec: extensions.ScaleSpec{
+ Replicas: ss.Spec.Replicas,
+ },
+ Status: extensions.ScaleStatus{
+ Replicas: ss.Status.Replicas,
+ Selector: ss.Spec.Selector,
+ },
+ }, nil
+}
diff --git a/pkg/registry/apps/statefulset/storage/storage_test.go b/pkg/registry/apps/statefulset/storage/storage_test.go
index 9d4001d82e..933d99b2d4 100644
--- a/pkg/registry/apps/statefulset/storage/storage_test.go
+++ b/pkg/registry/apps/statefulset/storage/storage_test.go
@@ -19,24 +19,28 @@ package storage
import (
"testing"
+ apiequality "k8s.io/apimachinery/pkg/api/equality"
+ "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/util/diff"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/apps"
+ "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/registry/registrytest"
)
// TODO: allow for global factory override
-func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
+func newStorage(t *testing.T) (StatefulSetStorage, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, apps.GroupName)
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "statefulsets"}
- statefulSetStorage, statusStorage := NewREST(restOptions)
- return statefulSetStorage, statusStorage, server
+ storage := NewStorage(restOptions)
+ return storage, server
}
// createStatefulSet is a helper function that returns a StatefulSet with the updated resource version.
@@ -83,11 +87,13 @@ func validNewStatefulSet() *apps.StatefulSet {
}
}
+var validStatefulSet = *validNewStatefulSet()
+
func TestCreate(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
- test := registrytest.New(t, storage.Store)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ test := registrytest.New(t, storage.StatefulSet.Store)
ps := validNewStatefulSet()
ps.ObjectMeta = metav1.ObjectMeta{}
test.TestCreate(
@@ -100,13 +106,13 @@ func TestCreate(t *testing.T) {
// TODO: Test updates to spec when we allow them.
func TestStatusUpdate(t *testing.T) {
- storage, statusStorage, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
+ defer storage.StatefulSet.Store.DestroyFunc()
ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault)
key := "/statefulsets/" + metav1.NamespaceDefault + "/foo"
validStatefulSet := validNewStatefulSet()
- if err := storage.Storage.Create(ctx, key, validStatefulSet, nil, 0); err != nil {
+ if err := storage.StatefulSet.Storage.Create(ctx, key, validStatefulSet, nil, 0); err != nil {
t.Fatalf("unexpected error: %v", err)
}
update := apps.StatefulSet{
@@ -119,10 +125,10 @@ func TestStatusUpdate(t *testing.T) {
},
}
- if _, _, err := statusStorage.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update, api.Scheme)); err != nil {
+ if _, _, err := storage.Status.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update, api.Scheme)); err != nil {
t.Fatalf("unexpected error: %v", err)
}
- obj, err := storage.Get(ctx, "foo", &metav1.GetOptions{})
+ obj, err := storage.StatefulSet.Get(ctx, "foo", &metav1.GetOptions{})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -137,34 +143,34 @@ func TestStatusUpdate(t *testing.T) {
}
func TestGet(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
- test := registrytest.New(t, storage.Store)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ test := registrytest.New(t, storage.StatefulSet.Store)
test.TestGet(validNewStatefulSet())
}
func TestList(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
- test := registrytest.New(t, storage.Store)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ test := registrytest.New(t, storage.StatefulSet.Store)
test.TestList(validNewStatefulSet())
}
func TestDelete(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
- test := registrytest.New(t, storage.Store)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ test := registrytest.New(t, storage.StatefulSet.Store)
test.TestDelete(validNewStatefulSet())
}
func TestWatch(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
- test := registrytest.New(t, storage.Store)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ test := registrytest.New(t, storage.StatefulSet.Store)
test.TestWatch(
validNewStatefulSet(),
// matching labels
@@ -189,11 +195,104 @@ func TestWatch(t *testing.T) {
}
func TestCategories(t *testing.T) {
- storage, _, server := newStorage(t)
+ storage, server := newStorage(t)
defer server.Terminate(t)
- defer storage.Store.DestroyFunc()
+ defer storage.StatefulSet.Store.DestroyFunc()
expected := []string{"all"}
- registrytest.AssertCategories(t, storage, expected)
+ registrytest.AssertCategories(t, storage.StatefulSet, expected)
+}
+
+func TestShortNames(t *testing.T) {
+ storage, server := newStorage(t)
+ defer server.Terminate(t)
+ defer storage.StatefulSet.Store.DestroyFunc()
+ expected := []string{"sts"}
+ registrytest.AssertShortNames(t, storage.StatefulSet, expected)
+}
+
+func TestScaleGet(t *testing.T) {
+ storage, server := newStorage(t)
+ defer server.Terminate(t)
+ defer storage.StatefulSet.Store.DestroyFunc()
+
+ name := "foo"
+
+ var sts apps.StatefulSet
+ ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault)
+ key := "/statefulsets/" + metav1.NamespaceDefault + "/" + name
+ if err := storage.StatefulSet.Storage.Create(ctx, key, &validStatefulSet, &sts, 0); err != nil {
+ t.Fatalf("error setting new statefulset (key: %s) %v: %v", key, validStatefulSet, err)
+ }
+
+ want := &extensions.Scale{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: name,
+ Namespace: metav1.NamespaceDefault,
+ UID: sts.UID,
+ ResourceVersion: sts.ResourceVersion,
+ CreationTimestamp: sts.CreationTimestamp,
+ },
+ Spec: extensions.ScaleSpec{
+ Replicas: validStatefulSet.Spec.Replicas,
+ },
+ Status: extensions.ScaleStatus{
+ Replicas: validStatefulSet.Status.Replicas,
+ Selector: validStatefulSet.Spec.Selector,
+ },
+ }
+ obj, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{})
+ got := obj.(*extensions.Scale)
+ if err != nil {
+ t.Fatalf("error fetching scale for %s: %v", name, err)
+ }
+ if !apiequality.Semantic.DeepEqual(got, want) {
+ t.Errorf("unexpected scale: %s", diff.ObjectDiff(got, want))
+ }
+}
+
+func TestScaleUpdate(t *testing.T) {
+ storage, server := newStorage(t)
+ defer server.Terminate(t)
+ defer storage.StatefulSet.Store.DestroyFunc()
+
+ name := "foo"
+
+ var sts apps.StatefulSet
+ ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault)
+ key := "/statefulsets/" + metav1.NamespaceDefault + "/" + name
+ if err := storage.StatefulSet.Storage.Create(ctx, key, &validStatefulSet, &sts, 0); err != nil {
+ t.Fatalf("error setting new statefulset (key: %s) %v: %v", key, validStatefulSet, err)
+ }
+ replicas := 12
+ update := extensions.Scale{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: name,
+ Namespace: metav1.NamespaceDefault,
+ },
+ Spec: extensions.ScaleSpec{
+ Replicas: int32(replicas),
+ },
+ }
+
+ if _, _, err := storage.Scale.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update, api.Scheme)); err != nil {
+ t.Fatalf("error updating scale %v: %v", update, err)
+ }
+
+ obj, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{})
+ if err != nil {
+ t.Fatalf("error fetching scale for %s: %v", name, err)
+ }
+ scale := obj.(*extensions.Scale)
+ if scale.Spec.Replicas != int32(replicas) {
+ t.Errorf("wrong replicas count expected: %d got: %d", replicas, scale.Spec.Replicas)
+ }
+
+ update.ResourceVersion = sts.ResourceVersion
+ update.Spec.Replicas = 15
+
+ if _, _, err = storage.Scale.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update, api.Scheme)); err != nil && !errors.IsConflict(err) {
+ t.Fatalf("unexpected error, expecting an update conflict but got %v", err)
+ }
}
// TODO: Test generation number.
diff --git a/test/e2e/apps/statefulset.go b/test/e2e/apps/statefulset.go
index bced008121..548995bf7d 100644
--- a/test/e2e/apps/statefulset.go
+++ b/test/e2e/apps/statefulset.go
@@ -843,6 +843,43 @@ var _ = SIGDescribe("StatefulSet", func() {
return nil
}, framework.StatefulPodTimeout, 2*time.Second).Should(BeNil())
})
+
+ It("should have a working scale subresource", func() {
+ By("Creating statefulset " + ssName + " in namespace " + ns)
+ ss := framework.NewStatefulSet(ssName, ns, headlessSvcName, 1, nil, nil, labels)
+ sst := framework.NewStatefulSetTester(c)
+ sst.SetHttpProbe(ss)
+ ss, err := c.AppsV1beta1().StatefulSets(ns).Create(ss)
+ Expect(err).NotTo(HaveOccurred())
+ sst.WaitForRunningAndReady(*ss.Spec.Replicas, ss)
+ ss = sst.WaitForStatus(ss)
+
+ By("getting scale subresource")
+ scale := framework.NewStatefulSetScale(ss)
+ scaleResult := &apps.Scale{}
+ err = c.AppsV1beta1().RESTClient().Get().AbsPath("/apis/apps/v1beta1").Namespace(ns).Resource("statefulsets").Name(ssName).SubResource("scale").Do().Into(scale)
+ if err != nil {
+ framework.Failf("Failed to get scale subresource: %v", err)
+ }
+ Expect(scale.Spec.Replicas).To(Equal(int32(1)))
+ Expect(scale.Status.Replicas).To(Equal(int32(1)))
+
+ By("updating a scale subresource")
+ scale.ResourceVersion = "" //unconditionally update to 2 replicas
+ scale.Spec.Replicas = 2
+ err = c.AppsV1beta1().RESTClient().Put().AbsPath("/apis/apps/v1beta1").Namespace(ns).Resource("statefulsets").Name(ssName).SubResource("scale").Body(scale).Do().Into(scaleResult)
+ if err != nil {
+ framework.Failf("Failed to put scale subresource: %v", err)
+ }
+ Expect(scaleResult.Spec.Replicas).To(Equal(int32(2)))
+
+ By("verifying the statefulset Spec.Replicas was modified")
+ ss, err = c.AppsV1beta1().StatefulSets(ns).Get(ssName, metav1.GetOptions{})
+ if err != nil {
+ framework.Failf("Failed to get statefulset resource: %v", err)
+ }
+ Expect(*(ss.Spec.Replicas)).To(Equal(int32(2)))
+ })
})
framework.KubeDescribe("Deploy clustered applications [Feature:StatefulSet] [Slow]", func() {
diff --git a/test/e2e/framework/BUILD b/test/e2e/framework/BUILD
index 06be9b417a..cc8957abc0 100644
--- a/test/e2e/framework/BUILD
+++ b/test/e2e/framework/BUILD
@@ -101,6 +101,7 @@ go_library(
"//vendor/google.golang.org/api/compute/v1:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library",
"//vendor/k8s.io/api/apps/v1beta1:go_default_library",
+ "//vendor/k8s.io/api/apps/v1beta2:go_default_library",
"//vendor/k8s.io/api/authorization/v1beta1:go_default_library",
"//vendor/k8s.io/api/batch/v1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
diff --git a/test/e2e/framework/statefulset_utils.go b/test/e2e/framework/statefulset_utils.go
index bc4c9a68da..b33cc332c5 100644
--- a/test/e2e/framework/statefulset_utils.go
+++ b/test/e2e/framework/statefulset_utils.go
@@ -29,6 +29,7 @@ import (
. "github.com/onsi/gomega"
apps "k8s.io/api/apps/v1beta1"
+ appsV1beta2 "k8s.io/api/apps/v1beta2"
"k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
@@ -224,7 +225,7 @@ func (s *StatefulSetTester) Scale(ss *apps.StatefulSet, count int32) error {
// UpdateReplicas updates the replicas of ss to count.
func (s *StatefulSetTester) UpdateReplicas(ss *apps.StatefulSet, count int32) {
- s.update(ss.Namespace, ss.Name, func(ss *apps.StatefulSet) { ss.Spec.Replicas = &count })
+ s.update(ss.Namespace, ss.Name, func(ss *apps.StatefulSet) { *(ss.Spec.Replicas) = count })
}
// Restart scales ss to 0 and then back to its previous number of replicas.
@@ -812,6 +813,23 @@ func NewStatefulSet(name, ns, governingSvcName string, replicas int32, statefulP
}
}
+// NewStatefulSetScale creates a new StatefulSet scale subresource and returns it
+func NewStatefulSetScale(ss *apps.StatefulSet) *appsV1beta2.Scale {
+ return &appsV1beta2.Scale{
+ // TODO: Create a variant of ObjectMeta type that only contains the fields below.
+ ObjectMeta: metav1.ObjectMeta{
+ Name: ss.Name,
+ Namespace: ss.Namespace,
+ },
+ Spec: appsV1beta2.ScaleSpec{
+ Replicas: *(ss.Spec.Replicas),
+ },
+ Status: appsV1beta2.ScaleStatus{
+ Replicas: ss.Status.Replicas,
+ },
+ }
+}
+
var statefulPodRegex = regexp.MustCompile("(.*)-([0-9]+)$")
func getStatefulPodOrdinal(pod *v1.Pod) int {