Enable scale subresources for apps/v1

This commit is contained in:
Jordan Liggitt 2017-11-09 12:49:28 -05:00
parent f927f2ab89
commit f9e2e406ba
No known key found for this signature in database
GPG Key ID: 39928704103C7229
2 changed files with 6 additions and 3 deletions

View File

@ -122,11 +122,13 @@ func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.API
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
storage["deployments"] = deploymentStorage.Deployment
storage["deployments/status"] = deploymentStorage.Status
storage["deployments/scale"] = deploymentStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
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)
@ -137,6 +139,7 @@ func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.API
replicaSetStorage := replicasetstore.NewStorage(restOptionsGetter)
storage["replicasets"] = replicaSetStorage.ReplicaSet
storage["replicasets/status"] = replicaSetStorage.Status
storage["replicasets/scale"] = replicaSetStorage.Scale
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("controllerrevisions")) {
historyStorage := controllerrevisionsstore.NewREST(restOptionsGetter)

View File

@ -68,9 +68,9 @@ func TestScaleSubresources(t *testing.T) {
makeGVR("apps", "v1beta2", "replicasets/scale"): makeGVK("apps", "v1beta2", "Scale"),
makeGVR("apps", "v1beta2", "statefulsets/scale"): makeGVK("apps", "v1beta2", "Scale"),
// makeGVR("apps", "v1", "deployments/scale"): makeGVK("autoscaling", "v1", "Scale"),
// makeGVR("apps", "v1", "replicasets/scale"): makeGVK("autoscaling", "v1", "Scale"),
// makeGVR("apps", "v1", "statefulsets/scale"): makeGVK("autoscaling", "v1", "Scale"),
makeGVR("apps", "v1", "deployments/scale"): makeGVK("autoscaling", "v1", "Scale"),
makeGVR("apps", "v1", "replicasets/scale"): makeGVK("autoscaling", "v1", "Scale"),
makeGVR("apps", "v1", "statefulsets/scale"): makeGVK("autoscaling", "v1", "Scale"),
}
autoscalingGVK := schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "Scale"}