mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Enable scale subresources for apps/v1
This commit is contained in:
parent
f927f2ab89
commit
f9e2e406ba
@ -122,11 +122,13 @@ func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.API
|
|||||||
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
|
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
|
||||||
storage["deployments"] = deploymentStorage.Deployment
|
storage["deployments"] = deploymentStorage.Deployment
|
||||||
storage["deployments/status"] = deploymentStorage.Status
|
storage["deployments/status"] = deploymentStorage.Status
|
||||||
|
storage["deployments/scale"] = deploymentStorage.Scale
|
||||||
}
|
}
|
||||||
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
|
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
|
||||||
statefulSetStorage := statefulsetstore.NewStorage(restOptionsGetter)
|
statefulSetStorage := statefulsetstore.NewStorage(restOptionsGetter)
|
||||||
storage["statefulsets"] = statefulSetStorage.StatefulSet
|
storage["statefulsets"] = statefulSetStorage.StatefulSet
|
||||||
storage["statefulsets/status"] = statefulSetStorage.Status
|
storage["statefulsets/status"] = statefulSetStorage.Status
|
||||||
|
storage["statefulsets/scale"] = statefulSetStorage.Scale
|
||||||
}
|
}
|
||||||
if apiResourceConfigSource.ResourceEnabled(version.WithResource("daemonsets")) {
|
if apiResourceConfigSource.ResourceEnabled(version.WithResource("daemonsets")) {
|
||||||
daemonSetStorage, daemonSetStatusStorage := daemonsetstore.NewREST(restOptionsGetter)
|
daemonSetStorage, daemonSetStatusStorage := daemonsetstore.NewREST(restOptionsGetter)
|
||||||
@ -137,6 +139,7 @@ func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.API
|
|||||||
replicaSetStorage := replicasetstore.NewStorage(restOptionsGetter)
|
replicaSetStorage := replicasetstore.NewStorage(restOptionsGetter)
|
||||||
storage["replicasets"] = replicaSetStorage.ReplicaSet
|
storage["replicasets"] = replicaSetStorage.ReplicaSet
|
||||||
storage["replicasets/status"] = replicaSetStorage.Status
|
storage["replicasets/status"] = replicaSetStorage.Status
|
||||||
|
storage["replicasets/scale"] = replicaSetStorage.Scale
|
||||||
}
|
}
|
||||||
if apiResourceConfigSource.ResourceEnabled(version.WithResource("controllerrevisions")) {
|
if apiResourceConfigSource.ResourceEnabled(version.WithResource("controllerrevisions")) {
|
||||||
historyStorage := controllerrevisionsstore.NewREST(restOptionsGetter)
|
historyStorage := controllerrevisionsstore.NewREST(restOptionsGetter)
|
||||||
|
@ -68,9 +68,9 @@ func TestScaleSubresources(t *testing.T) {
|
|||||||
makeGVR("apps", "v1beta2", "replicasets/scale"): makeGVK("apps", "v1beta2", "Scale"),
|
makeGVR("apps", "v1beta2", "replicasets/scale"): makeGVK("apps", "v1beta2", "Scale"),
|
||||||
makeGVR("apps", "v1beta2", "statefulsets/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", "deployments/scale"): makeGVK("autoscaling", "v1", "Scale"),
|
||||||
// makeGVR("apps", "v1", "replicasets/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", "statefulsets/scale"): makeGVK("autoscaling", "v1", "Scale"),
|
||||||
}
|
}
|
||||||
|
|
||||||
autoscalingGVK := schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "Scale"}
|
autoscalingGVK := schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "Scale"}
|
||||||
|
Loading…
Reference in New Issue
Block a user