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

Add istio VirtualService and DestinationRule types

This commit is contained in:
gitlawr
2019-06-17 10:50:12 +08:00
parent 22e321a584
commit bd5a9e3e53
3 changed files with 41 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import (
managementv3 "github.com/rancher/types/apis/management.cattle.io/v3"
managementSchema "github.com/rancher/types/apis/management.cattle.io/v3/schema"
monitoringv1 "github.com/rancher/types/apis/monitoring.coreos.com/v1"
istiov1alpha3 "github.com/rancher/types/apis/networking.istio.io/v1alpha3"
knetworkingv1 "github.com/rancher/types/apis/networking.k8s.io/v1"
projectv3 "github.com/rancher/types/apis/project.cattle.io/v3"
projectSchema "github.com/rancher/types/apis/project.cattle.io/v3/schema"
@@ -189,6 +190,7 @@ type UserContext struct {
Networking knetworkingv1.Interface
Monitoring monitoringv1.Interface
Cluster clusterv3.Interface
Istio istiov1alpha3.Interface
}
func (w *UserContext) controllers() []controller.Starter {
@@ -224,6 +226,7 @@ func (w *UserContext) UserOnlyContext() *UserOnlyContext {
BatchV1Beta1: w.BatchV1Beta1,
Monitoring: w.Monitoring,
Cluster: w.Cluster,
Istio: w.Istio,
}
}
@@ -244,6 +247,7 @@ type UserOnlyContext struct {
BatchV1Beta1 batchv1beta1.Interface
Monitoring monitoringv1.Interface
Cluster clusterv3.Interface
Istio istiov1alpha3.Interface
}
func (w *UserOnlyContext) controllers() []controller.Starter {
@@ -408,6 +412,11 @@ func NewUserContext(scaledContext *ScaledContext, config rest.Config, clusterNam
return nil, err
}
context.Istio, err = istiov1alpha3.NewForConfig(config)
if err != nil {
return nil, err
}
dynamicConfig := config
if dynamicConfig.NegotiatedSerializer == nil {
dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer
@@ -497,6 +506,11 @@ func NewUserOnlyContext(config rest.Config) (*UserOnlyContext, error) {
return nil, err
}
context.Istio, err = istiov1alpha3.NewForConfig(config)
if err != nil {
return nil, err
}
dynamicConfig := config
if dynamicConfig.NegotiatedSerializer == nil {
dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer