2017-11-15 23:59:47 +00:00
|
|
|
//go:generate go run generator/cleanup/main.go
|
2017-11-11 04:58:42 +00:00
|
|
|
//go:generate go run main.go
|
|
|
|
|
2017-11-10 20:23:15 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-09-27 01:45:46 +00:00
|
|
|
monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring"
|
|
|
|
monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
|
2019-06-17 02:50:12 +00:00
|
|
|
istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3"
|
2017-12-04 23:42:18 +00:00
|
|
|
clusterSchema "github.com/rancher/types/apis/cluster.cattle.io/v3/schema"
|
|
|
|
managementSchema "github.com/rancher/types/apis/management.cattle.io/v3/schema"
|
2018-02-02 03:19:28 +00:00
|
|
|
publicSchema "github.com/rancher/types/apis/management.cattle.io/v3public/schema"
|
2017-12-04 23:42:18 +00:00
|
|
|
projectSchema "github.com/rancher/types/apis/project.cattle.io/v3/schema"
|
2017-11-12 04:14:05 +00:00
|
|
|
"github.com/rancher/types/generator"
|
2018-02-13 19:58:05 +00:00
|
|
|
|
2019-08-28 23:35:54 +00:00
|
|
|
appsv1 "k8s.io/api/apps/v1"
|
2019-03-28 13:16:41 +00:00
|
|
|
scalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
|
2019-08-28 23:35:54 +00:00
|
|
|
batchv1 "k8s.io/api/batch/v1"
|
|
|
|
batchv1beta1 "k8s.io/api/batch/v1beta1"
|
2019-07-31 19:05:36 +00:00
|
|
|
v1 "k8s.io/api/core/v1"
|
2017-12-09 16:19:33 +00:00
|
|
|
extv1beta1 "k8s.io/api/extensions/v1beta1"
|
2018-03-26 22:57:47 +00:00
|
|
|
knetworkingv1 "k8s.io/api/networking/v1"
|
2019-08-28 23:35:54 +00:00
|
|
|
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
2017-12-09 16:19:33 +00:00
|
|
|
rbacv1 "k8s.io/api/rbac/v1"
|
2019-07-31 19:05:36 +00:00
|
|
|
storagev1 "k8s.io/api/storage/v1"
|
2018-11-21 02:16:25 +00:00
|
|
|
k8sschema "k8s.io/apimachinery/pkg/runtime/schema"
|
2019-06-11 06:54:16 +00:00
|
|
|
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
|
2017-11-11 04:58:42 +00:00
|
|
|
)
|
2017-11-10 20:23:15 +00:00
|
|
|
|
|
|
|
func main() {
|
2018-02-20 05:53:39 +00:00
|
|
|
generator.GenerateComposeType(projectSchema.Schemas, managementSchema.Schemas, clusterSchema.Schemas)
|
2018-06-19 16:46:45 +00:00
|
|
|
generator.Generate(managementSchema.Schemas, map[string]bool{
|
2018-10-25 16:56:31 +00:00
|
|
|
"userAttribute": true,
|
|
|
|
})
|
2018-06-19 16:46:45 +00:00
|
|
|
generator.Generate(publicSchema.PublicSchemas, nil)
|
2018-10-25 16:56:31 +00:00
|
|
|
generator.Generate(clusterSchema.Schemas, map[string]bool{
|
|
|
|
"clusterUserAttribute": true,
|
|
|
|
"clusterAuthToken": true,
|
|
|
|
})
|
2018-06-19 16:46:45 +00:00
|
|
|
generator.Generate(projectSchema.Schemas, nil)
|
2017-12-20 04:47:20 +00:00
|
|
|
generator.GenerateNativeTypes(v1.SchemeGroupVersion, []interface{}{
|
2018-01-03 21:43:17 +00:00
|
|
|
v1.Endpoints{},
|
2018-07-13 20:26:51 +00:00
|
|
|
v1.PersistentVolumeClaim{},
|
2017-12-20 04:47:20 +00:00
|
|
|
v1.Pod{},
|
2017-12-29 22:20:21 +00:00
|
|
|
v1.Service{},
|
2018-01-04 21:05:51 +00:00
|
|
|
v1.Secret{},
|
2018-02-08 21:17:18 +00:00
|
|
|
v1.ConfigMap{},
|
2018-02-08 21:18:44 +00:00
|
|
|
v1.ServiceAccount{},
|
2018-02-13 19:58:05 +00:00
|
|
|
v1.ReplicationController{},
|
2018-06-26 23:01:42 +00:00
|
|
|
v1.ResourceQuota{},
|
2019-02-02 00:37:56 +00:00
|
|
|
v1.LimitRange{},
|
2017-12-20 04:47:20 +00:00
|
|
|
}, []interface{}{
|
|
|
|
v1.Node{},
|
|
|
|
v1.ComponentStatus{},
|
|
|
|
v1.Namespace{},
|
|
|
|
v1.Event{},
|
|
|
|
})
|
2019-08-28 23:35:54 +00:00
|
|
|
generator.GenerateNativeTypes(appsv1.SchemeGroupVersion, []interface{}{
|
|
|
|
appsv1.Deployment{},
|
|
|
|
appsv1.DaemonSet{},
|
|
|
|
appsv1.StatefulSet{},
|
|
|
|
appsv1.ReplicaSet{},
|
2017-12-20 04:47:20 +00:00
|
|
|
}, nil)
|
|
|
|
generator.GenerateNativeTypes(rbacv1.SchemeGroupVersion, []interface{}{
|
|
|
|
rbacv1.RoleBinding{},
|
|
|
|
rbacv1.Role{},
|
|
|
|
}, []interface{}{
|
|
|
|
rbacv1.ClusterRoleBinding{},
|
|
|
|
rbacv1.ClusterRole{},
|
|
|
|
})
|
2018-03-26 22:57:47 +00:00
|
|
|
generator.GenerateNativeTypes(knetworkingv1.SchemeGroupVersion, []interface{}{
|
|
|
|
knetworkingv1.NetworkPolicy{},
|
|
|
|
}, nil)
|
2018-02-13 19:58:05 +00:00
|
|
|
generator.GenerateNativeTypes(batchv1.SchemeGroupVersion, []interface{}{
|
|
|
|
batchv1.Job{},
|
|
|
|
}, nil)
|
|
|
|
generator.GenerateNativeTypes(batchv1beta1.SchemeGroupVersion, []interface{}{
|
|
|
|
batchv1beta1.CronJob{},
|
|
|
|
}, nil)
|
2018-03-28 21:11:30 +00:00
|
|
|
generator.GenerateNativeTypes(extv1beta1.SchemeGroupVersion,
|
2017-12-20 04:47:20 +00:00
|
|
|
[]interface{}{
|
2018-02-16 02:01:38 +00:00
|
|
|
extv1beta1.Ingress{},
|
2018-03-28 21:11:30 +00:00
|
|
|
},
|
2019-08-28 23:35:54 +00:00
|
|
|
nil,
|
|
|
|
)
|
|
|
|
generator.GenerateNativeTypes(policyv1beta1.SchemeGroupVersion,
|
|
|
|
nil,
|
|
|
|
[]interface{}{
|
|
|
|
policyv1beta1.PodSecurityPolicy{},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
generator.GenerateNativeTypes(storagev1.SchemeGroupVersion,
|
|
|
|
nil,
|
2018-03-28 21:11:30 +00:00
|
|
|
[]interface{}{
|
2019-08-28 23:35:54 +00:00
|
|
|
storagev1.StorageClass{},
|
2018-03-28 21:11:30 +00:00
|
|
|
},
|
|
|
|
)
|
2018-11-21 02:16:25 +00:00
|
|
|
generator.GenerateNativeTypes(
|
2019-09-27 01:45:46 +00:00
|
|
|
k8sschema.GroupVersion{Group: monitoring.GroupName, Version: monitoringv1.Version},
|
2018-11-21 02:16:25 +00:00
|
|
|
[]interface{}{
|
|
|
|
monitoringv1.Prometheus{},
|
|
|
|
monitoringv1.Alertmanager{},
|
|
|
|
monitoringv1.PrometheusRule{},
|
|
|
|
monitoringv1.ServiceMonitor{},
|
|
|
|
},
|
2019-08-28 23:35:54 +00:00
|
|
|
nil,
|
2018-11-21 02:16:25 +00:00
|
|
|
)
|
2019-03-28 13:16:41 +00:00
|
|
|
generator.GenerateNativeTypes(scalingv2beta2.SchemeGroupVersion,
|
|
|
|
[]interface{}{
|
|
|
|
scalingv2beta2.HorizontalPodAutoscaler{},
|
|
|
|
},
|
2019-08-28 23:35:54 +00:00
|
|
|
nil,
|
2019-03-28 13:16:41 +00:00
|
|
|
)
|
2019-06-17 02:50:12 +00:00
|
|
|
generator.GenerateNativeTypes(istiov1alpha3.SchemeGroupVersion,
|
|
|
|
[]interface{}{
|
|
|
|
istiov1alpha3.VirtualService{},
|
|
|
|
istiov1alpha3.DestinationRule{},
|
|
|
|
},
|
2019-08-28 23:35:54 +00:00
|
|
|
nil,
|
2019-06-17 02:50:12 +00:00
|
|
|
)
|
2019-06-11 06:54:16 +00:00
|
|
|
generator.GenerateNativeTypes(apiregistrationv1.SchemeGroupVersion,
|
2019-08-28 23:35:54 +00:00
|
|
|
nil,
|
|
|
|
[]interface{}{
|
2019-06-11 06:54:16 +00:00
|
|
|
apiregistrationv1.APIService{},
|
|
|
|
},
|
|
|
|
)
|
2017-11-10 20:23:15 +00:00
|
|
|
}
|