clean old devops code
todo impl use informer Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1"
|
||||
"kubesphere.io/kubesphere/tools/lib"
|
||||
"log"
|
||||
"os"
|
||||
@@ -43,6 +45,9 @@ func main() {
|
||||
networkinstall.Install(Scheme)
|
||||
devopsinstall.Install(Scheme)
|
||||
|
||||
urlruntime.Must(clusterv1alpha1.AddToScheme(Scheme))
|
||||
urlruntime.Must(Scheme.SetVersionPriority(clusterv1alpha1.SchemeGroupVersion))
|
||||
|
||||
mapper := meta.NewDefaultRESTMapper(nil)
|
||||
|
||||
mapper.AddSpecific(servicemeshv1alpha2.SchemeGroupVersion.WithKind(servicemeshv1alpha2.ResourceKindServicePolicy),
|
||||
@@ -81,6 +86,15 @@ func main() {
|
||||
mapper.AddSpecific(devopsv1alpha3.SchemeGroupVersion.WithKind(devopsv1alpha3.ResourceKindPipeline),
|
||||
devopsv1alpha3.SchemeGroupVersion.WithResource(devopsv1alpha3.ResourcePluralPipeline),
|
||||
devopsv1alpha3.SchemeGroupVersion.WithResource(devopsv1alpha3.ResourceSingularPipeline), meta.RESTScopeRoot)
|
||||
|
||||
mapper.AddSpecific(clusterv1alpha1.SchemeGroupVersion.WithKind(clusterv1alpha1.ResourceKindCluster),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralCluster),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesSingularCluster), meta.RESTScopeRoot)
|
||||
|
||||
mapper.AddSpecific(clusterv1alpha1.SchemeGroupVersion.WithKind(clusterv1alpha1.ResourceKindAgent),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralAgent),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesSingularAgent), meta.RESTScopeRoot)
|
||||
|
||||
spec, err := lib.RenderOpenAPISpec(lib.Config{
|
||||
Scheme: Scheme,
|
||||
Codecs: Codecs,
|
||||
@@ -103,6 +117,7 @@ func main() {
|
||||
networkv1alpha1.GetOpenAPIDefinitions,
|
||||
devopsv1alpha1.GetOpenAPIDefinitions,
|
||||
devopsv1alpha3.GetOpenAPIDefinitions,
|
||||
clusterv1alpha1.GetOpenAPIDefinitions,
|
||||
},
|
||||
Resources: []schema.GroupVersionResource{
|
||||
//TODO(runzexia) At present, the document generation requires the openapi structure of the go language,
|
||||
@@ -118,6 +133,8 @@ func main() {
|
||||
networkv1alpha1.SchemeGroupVersion.WithResource(networkv1alpha1.ResourcePluralWorkspaceNetworkPolicy),
|
||||
devopsv1alpha3.SchemeGroupVersion.WithResource(devopsv1alpha3.ResourcePluralDevOpsProject),
|
||||
devopsv1alpha3.SchemeGroupVersion.WithResource(devopsv1alpha3.ResourcePluralPipeline),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralAgent),
|
||||
clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralCluster),
|
||||
},
|
||||
Mapper: mapper,
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
devopsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2"
|
||||
iamv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2"
|
||||
loggingv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/logging/v1alpha2"
|
||||
monitoringv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha2"
|
||||
monitoringv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3"
|
||||
openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1"
|
||||
operationsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/operations/v1alpha2"
|
||||
resourcesv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/resources/v1alpha2"
|
||||
@@ -72,7 +72,7 @@ func generateSwaggerJson() {
|
||||
container.Add(devopsv1alpha2Service)
|
||||
urlruntime.Must(iamv1alpha2.AddToContainer(container, nil, nil, nil, nil, nil))
|
||||
urlruntime.Must(loggingv1alpha2.AddToContainer(container, nil, nil))
|
||||
urlruntime.Must(monitoringv1alpha2.AddToContainer(container, nil, nil))
|
||||
urlruntime.Must(monitoringv1alpha3.AddToContainer(container, nil, nil))
|
||||
urlruntime.Must(openpitrixv1.AddToContainer(container, nil, nil))
|
||||
urlruntime.Must(operationsv1alpha2.AddToContainer(container, nil))
|
||||
urlruntime.Must(resourcesv1alpha2.AddToContainer(container, nil, nil))
|
||||
|
||||
Reference in New Issue
Block a user