Skip to content

Commit

Permalink
feat(platform): support autoscaling v2beta2 (#1828)
Browse files Browse the repository at this point in the history
Co-authored-by: kanesong <kanesong@tencent.com>
  • Loading branch information
songkane and kanesong authored Apr 7, 2022
1 parent a192e06 commit 7525362
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/platform/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
appsv1beta2 "k8s.io/api/apps/v1beta2"
autoscalingv1 "k8s.io/api/autoscaling/v1"
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
certv1beta1 "k8s.io/api/certificates/v1beta1"
Expand Down Expand Up @@ -227,6 +228,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {

autoscalingv1.SchemeGroupVersion,
autoscalingv2beta1.SchemeGroupVersion,
autoscalingv2beta2.SchemeGroupVersion,

appsv1.SchemeGroupVersion,
appsv1beta2.SchemeGroupVersion,
Expand Down
5 changes: 4 additions & 1 deletion pkg/platform/apiserver/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
appsv1beta2 "k8s.io/api/apps/v1beta2"
autoscalingv1 "k8s.io/api/autoscaling/v1"
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
autoscalingv2Beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
certV1beta1 "k8s.io/api/certificates/v1beta1"
Expand Down Expand Up @@ -79,7 +80,9 @@ func Install(scheme *runtime.Scheme) {

runtimeutil.Must(autoscalingv1.AddToScheme(scheme))
runtimeutil.Must(autoscalingv2beta1.AddToScheme(scheme))
runtimeutil.Must(scheme.SetVersionPriority(autoscalingv1.SchemeGroupVersion, autoscalingv2beta1.SchemeGroupVersion))
runtimeutil.Must(autoscalingv2Beta2.AddToScheme(scheme))
runtimeutil.Must(scheme.SetVersionPriority(autoscalingv1.SchemeGroupVersion, autoscalingv2beta1.SchemeGroupVersion,
autoscalingv2Beta2.SchemeGroupVersion))

runtimeutil.Must(appsv1.AddToScheme(scheme))
runtimeutil.Must(appsv1beta1.AddToScheme(scheme))
Expand Down
2 changes: 2 additions & 0 deletions pkg/platform/proxy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ func RESTClientFor(clientSet *kubernetes.Clientset, apiGroup, apiVersion string)
return clientSet.AutoscalingV1().RESTClient()
case "autoscaling/v2beta1":
return clientSet.AutoscalingV2beta1().RESTClient()
case "autoscaling/v2beta2":
return clientSet.AutoscalingV2beta2().RESTClient()
case "batch/v1":
return clientSet.BatchV1().RESTClient()
case "batch/v1beta1":
Expand Down

0 comments on commit 7525362

Please sign in to comment.