1
0
mirror of https://github.com/rancher/types.git synced 2025-09-01 21:32:10 +00:00

Add HPA type to schema

This commit is contained in:
orangedeng
2019-03-28 21:16:41 +08:00
committed by Craig Jellick
parent 02110b7332
commit 5694548201
7 changed files with 317 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/rancher/norman/store/proxy"
"github.com/rancher/norman/types"
appsv1beta2 "github.com/rancher/types/apis/apps/v1beta2"
autoscaling "github.com/rancher/types/apis/autoscaling/v2beta2"
batchv1 "github.com/rancher/types/apis/batch/v1"
batchv1beta1 "github.com/rancher/types/apis/batch/v1beta1"
clusterv3 "github.com/rancher/types/apis/cluster.cattle.io/v3"
@@ -178,6 +179,7 @@ type UserContext struct {
K8sClient kubernetes.Interface
Apps appsv1beta2.Interface
Autoscaling autoscaling.Interface
Project projectv3.Interface
Core corev1.Interface
RBAC rbacv1.Interface
@@ -212,6 +214,7 @@ func (w *UserContext) UserOnlyContext() *UserOnlyContext {
UnversionedClient: w.UnversionedClient,
K8sClient: w.K8sClient,
Autoscaling: w.Autoscaling,
Apps: w.Apps,
Project: w.Project,
Core: w.Core,
@@ -232,6 +235,7 @@ type UserOnlyContext struct {
K8sClient kubernetes.Interface
Apps appsv1beta2.Interface
Autoscaling autoscaling.Interface
Project projectv3.Interface
Core corev1.Interface
RBAC rbacv1.Interface
@@ -393,6 +397,11 @@ func NewUserContext(scaledContext *ScaledContext, config rest.Config, clusterNam
return nil, err
}
context.Autoscaling, err = autoscaling.NewForConfig(config)
if err != nil {
return nil, err
}
context.Monitoring, err = monitoringv1.NewForConfig(config)
context.Cluster, err = clusterv3.NewForConfig(config)
if err != nil {
@@ -477,6 +486,11 @@ func NewUserOnlyContext(config rest.Config) (*UserOnlyContext, error) {
return nil, err
}
context.Autoscaling, err = autoscaling.NewForConfig(config)
if err != nil {
return nil, err
}
context.Monitoring, err = monitoringv1.NewForConfig(config)
context.Cluster, err = clusterv3.NewForConfig(config)
if err != nil {