diff --git a/cmd/ks-apiserver/app/server.go b/cmd/ks-apiserver/app/server.go index a9a985e9a4a31d6a483412779fc267b6e5d984a9..5a7f789f62d7a673f0d5334d85f288dfd6020d21 100644 --- a/cmd/ks-apiserver/app/server.go +++ b/cmd/ks-apiserver/app/server.go @@ -29,6 +29,7 @@ import ( "kubesphere.io/kubesphere/pkg/apiserver/runtime" "kubesphere.io/kubesphere/pkg/apiserver/servicemesh/tracing" "kubesphere.io/kubesphere/pkg/informers" + "kubesphere.io/kubesphere/pkg/kapis" "kubesphere.io/kubesphere/pkg/server" apiserverconfig "kubesphere.io/kubesphere/pkg/server/config" "kubesphere.io/kubesphere/pkg/server/filter" @@ -36,8 +37,6 @@ import ( "kubesphere.io/kubesphere/pkg/utils/signals" "kubesphere.io/kubesphere/pkg/utils/term" "net/http" - - "kubesphere.io/kubesphere/pkg/apis" ) func NewAPIServerCommand() *cobra.Command { @@ -134,7 +133,7 @@ func CreateAPIServer(s *options.ServerRunOptions) error { container.Filter(filter.Logging) container.RecoverHandler(server.LogStackOnRecover) - apis.InstallAPIs(container) + kapis.InstallAPIs(container) // install config api apiserverconfig.InstallAPI(container) diff --git a/cmd/ks-iam/app/server.go b/cmd/ks-iam/app/server.go index 4a745ab867e6e867db858bb154426c41ab0545ff..89db7d97b92f7bbc6ee519e08bd5e63477c47566 100644 --- a/cmd/ks-iam/app/server.go +++ b/cmd/ks-iam/app/server.go @@ -24,9 +24,9 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog" "kubesphere.io/kubesphere/cmd/ks-iam/app/options" - "kubesphere.io/kubesphere/pkg/apis" "kubesphere.io/kubesphere/pkg/apiserver/runtime" "kubesphere.io/kubesphere/pkg/informers" + "kubesphere.io/kubesphere/pkg/kapis" "kubesphere.io/kubesphere/pkg/models/iam" "kubesphere.io/kubesphere/pkg/server" apiserverconfig "kubesphere.io/kubesphere/pkg/server/config" @@ -107,7 +107,7 @@ func Run(s *options.ServerRunOptions, stopChan <-chan struct{}) error { container.DoNotRecover(false) container.RecoverHandler(server.LogStackOnRecover) - apis.InstallAuthorizationAPIs(container) + kapis.InstallAuthorizationAPIs(container) if s.GenericServerRunOptions.InsecurePort != 0 { klog.Infof("Server listening on %s:%d ", s.GenericServerRunOptions.BindAddress, s.GenericServerRunOptions.InsecurePort) diff --git a/pkg/apis/logging/install/install.go b/pkg/apis/logging/install/install.go deleted file mode 100644 index 27e393b5020be36bf1ce5deffed135e1fa1e426b..0000000000000000000000000000000000000000 --- a/pkg/apis/logging/install/install.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - - Copyright 2019 The KubeSphere Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ -package install - -import ( - "github.com/emicklei/go-restful" - urlruntime "k8s.io/apimachinery/pkg/util/runtime" - loggingv1alpha2 "kubesphere.io/kubesphere/pkg/apis/logging/v1alpha2" - "kubesphere.io/kubesphere/pkg/apiserver/runtime" -) - -func init() { - Install(runtime.Container) -} - -func Install(container *restful.Container) { - urlruntime.Must(loggingv1alpha2.AddToContainer(container)) -} diff --git a/pkg/apis/monitoring/install/install.go b/pkg/apis/monitoring/install/install.go deleted file mode 100644 index 4d9ce94adf15018b141d6b05b13a22f99c4be086..0000000000000000000000000000000000000000 --- a/pkg/apis/monitoring/install/install.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - - Copyright 2019 The KubeSphere Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ -package install - -import ( - "github.com/emicklei/go-restful" - urlruntime "k8s.io/apimachinery/pkg/util/runtime" - monitoringv1alpha2 "kubesphere.io/kubesphere/pkg/apis/monitoring/v1alpha2" - "kubesphere.io/kubesphere/pkg/apiserver/runtime" -) - -func init() { - Install(runtime.Container) -} - -func Install(container *restful.Container) { - urlruntime.Must(monitoringv1alpha2.AddToContainer(container)) -} diff --git a/pkg/apis/operations/install/install.go b/pkg/apis/operations/install/install.go deleted file mode 100644 index f893998c6be7f8f1e52b69d6de22d786601d8def..0000000000000000000000000000000000000000 --- a/pkg/apis/operations/install/install.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - - Copyright 2019 The KubeSphere Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ -package install - -import ( - "github.com/emicklei/go-restful" - urlruntime "k8s.io/apimachinery/pkg/util/runtime" - operationsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/operations/v1alpha2" - "kubesphere.io/kubesphere/pkg/apiserver/runtime" -) - -func init() { - Install(runtime.Container) -} - -func Install(container *restful.Container) { - urlruntime.Must(operationsv1alpha2.AddToContainer(container)) -} diff --git a/pkg/kapis/devops/group.go b/pkg/kapis/devops/group.go new file mode 100644 index 0000000000000000000000000000000000000000..4de4837bf42b1e18a2a1bb85b4cb81cf60031264 --- /dev/null +++ b/pkg/kapis/devops/group.go @@ -0,0 +1,17 @@ +/* +Copyright 2019 The KubeSphere authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package devops diff --git a/pkg/apis/iam/install/install.go b/pkg/kapis/devops/install/install.go similarity index 87% rename from pkg/apis/iam/install/install.go rename to pkg/kapis/devops/install/install.go index 984a97523062ab6665500ce1fcd2243d3c28eefc..8174c03f05be6c682fc12c981ad8c7718b348358 100644 --- a/pkg/apis/iam/install/install.go +++ b/pkg/kapis/devops/install/install.go @@ -15,13 +15,14 @@ limitations under the License. */ + package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2" ) func init() { @@ -29,5 +30,5 @@ func init() { } func Install(container *restful.Container) { - urlruntime.Must(iamv1alpha2.AddToContainer(container)) + urlruntime.Must(v1alpha2.AddToContainer(container)) } diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/kapis/devops/v1alpha2/register.go similarity index 100% rename from pkg/apis/devops/v1alpha2/register.go rename to pkg/kapis/devops/v1alpha2/register.go diff --git a/pkg/apis/iam/group.go b/pkg/kapis/iam/group.go similarity index 100% rename from pkg/apis/iam/group.go rename to pkg/kapis/iam/group.go diff --git a/pkg/apis/openpitrix/install/install.go b/pkg/kapis/iam/install/install.go similarity index 87% rename from pkg/apis/openpitrix/install/install.go rename to pkg/kapis/iam/install/install.go index 5f436be1ee00e3bb2d357147549b380ed7915cf4..4e4df52af730c01ea2b7288842228b3a5d800b77 100644 --- a/pkg/apis/openpitrix/install/install.go +++ b/pkg/kapis/iam/install/install.go @@ -20,8 +20,8 @@ package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - openpitrixv1 "kubesphere.io/kubesphere/pkg/apis/openpitrix/v1" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2" ) func init() { @@ -29,5 +29,5 @@ func init() { } func Install(container *restful.Container) { - urlruntime.Must(openpitrixv1.AddToContainer(container)) + urlruntime.Must(v1alpha2.AddToContainer(container)) } diff --git a/pkg/apis/iam/v1alpha2/register.go b/pkg/kapis/iam/v1alpha2/register.go similarity index 100% rename from pkg/apis/iam/v1alpha2/register.go rename to pkg/kapis/iam/v1alpha2/register.go diff --git a/pkg/apis/kapis.go b/pkg/kapis/kapis.go similarity index 52% rename from pkg/apis/kapis.go rename to pkg/kapis/kapis.go index 75f8104b98459705a455371c3ebfc33c6a9f3222..1e8d81ca5a5c997754acd6442ee42f5f0243ccb2 100644 --- a/pkg/apis/kapis.go +++ b/pkg/kapis/kapis.go @@ -1,18 +1,18 @@ -package apis +package kapis import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - devopsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha2" - iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" - loggingv1alpha2 "kubesphere.io/kubesphere/pkg/apis/logging/v1alpha2" - monitoringv1alpha2 "kubesphere.io/kubesphere/pkg/apis/monitoring/v1alpha2" - openpitrixv1 "kubesphere.io/kubesphere/pkg/apis/openpitrix/v1" - operationsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/operations/v1alpha2" - resourcesv1alpha2 "kubesphere.io/kubesphere/pkg/apis/resources/v1alpha2" - servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/v1alpha2" - tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" - terminalv1alpha2 "kubesphere.io/kubesphere/pkg/apis/terminal/v1alpha2" + 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" + openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1" + operationsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/operations/v1alpha2" + resourcesv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/resources/v1alpha2" + servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/servicemesh/metrics/v1alpha2" + tenantv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/tenant/v1alpha2" + terminalv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/terminal/v1alpha2" ) func InstallAPIs(container *restful.Container) { diff --git a/pkg/apis/logging/group.go b/pkg/kapis/logging/group.go similarity index 100% rename from pkg/apis/logging/group.go rename to pkg/kapis/logging/group.go diff --git a/pkg/apis/devops/install/install.go b/pkg/kapis/logging/install/install.go similarity index 86% rename from pkg/apis/devops/install/install.go rename to pkg/kapis/logging/install/install.go index 306edb599d09073be2d885e6ed19148e42159496..999daa8e5c9163739eb490a24f05056ed34637c5 100644 --- a/pkg/apis/devops/install/install.go +++ b/pkg/kapis/logging/install/install.go @@ -15,14 +15,13 @@ limitations under the License. */ - package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - devopsv1alpha2 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/logging/v1alpha2" ) func init() { @@ -30,5 +29,5 @@ func init() { } func Install(container *restful.Container) { - urlruntime.Must(devopsv1alpha2.AddToContainer(container)) + urlruntime.Must(v1alpha2.AddToContainer(container)) } diff --git a/pkg/apis/logging/v1alpha2/register.go b/pkg/kapis/logging/v1alpha2/register.go similarity index 100% rename from pkg/apis/logging/v1alpha2/register.go rename to pkg/kapis/logging/v1alpha2/register.go diff --git a/pkg/apis/monitoring/group.go b/pkg/kapis/monitoring/group.go similarity index 100% rename from pkg/apis/monitoring/group.go rename to pkg/kapis/monitoring/group.go diff --git a/pkg/kapis/monitoring/install/install.go b/pkg/kapis/monitoring/install/install.go new file mode 100644 index 0000000000000000000000000000000000000000..c1c15e8ae95d74a4e3d44b899b64f573b8b22e65 --- /dev/null +++ b/pkg/kapis/monitoring/install/install.go @@ -0,0 +1,33 @@ +/* + + Copyright 2019 The KubeSphere Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +package install + +import ( + "github.com/emicklei/go-restful" + urlruntime "k8s.io/apimachinery/pkg/util/runtime" + "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha2" +) + +func init() { + Install(runtime.Container) +} + +func Install(container *restful.Container) { + urlruntime.Must(v1alpha2.AddToContainer(container)) +} diff --git a/pkg/apis/monitoring/v1alpha2/register.go b/pkg/kapis/monitoring/v1alpha2/register.go similarity index 100% rename from pkg/apis/monitoring/v1alpha2/register.go rename to pkg/kapis/monitoring/v1alpha2/register.go diff --git a/pkg/apis/openpitrix/group.go b/pkg/kapis/openpitrix/group.go similarity index 100% rename from pkg/apis/openpitrix/group.go rename to pkg/kapis/openpitrix/group.go diff --git a/pkg/kapis/openpitrix/install/install.go b/pkg/kapis/openpitrix/install/install.go new file mode 100644 index 0000000000000000000000000000000000000000..6193817d8180469e8af8e935cbe0ce07600fe460 --- /dev/null +++ b/pkg/kapis/openpitrix/install/install.go @@ -0,0 +1,33 @@ +/* + + Copyright 2019 The KubeSphere Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +package install + +import ( + "github.com/emicklei/go-restful" + urlruntime "k8s.io/apimachinery/pkg/util/runtime" + "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1" +) + +func init() { + Install(runtime.Container) +} + +func Install(container *restful.Container) { + urlruntime.Must(v1.AddToContainer(container)) +} diff --git a/pkg/apis/openpitrix/v1/register.go b/pkg/kapis/openpitrix/v1/register.go similarity index 100% rename from pkg/apis/openpitrix/v1/register.go rename to pkg/kapis/openpitrix/v1/register.go diff --git a/pkg/apis/operations/group.go b/pkg/kapis/operations/group.go similarity index 100% rename from pkg/apis/operations/group.go rename to pkg/kapis/operations/group.go diff --git a/pkg/kapis/operations/install/install.go b/pkg/kapis/operations/install/install.go new file mode 100644 index 0000000000000000000000000000000000000000..ca8bcfde46f240cbde6fba0be0ba5be44194a113 --- /dev/null +++ b/pkg/kapis/operations/install/install.go @@ -0,0 +1,33 @@ +/* + + Copyright 2019 The KubeSphere Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +package install + +import ( + "github.com/emicklei/go-restful" + urlruntime "k8s.io/apimachinery/pkg/util/runtime" + "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/operations/v1alpha2" +) + +func init() { + Install(runtime.Container) +} + +func Install(container *restful.Container) { + urlruntime.Must(v1alpha2.AddToContainer(container)) +} diff --git a/pkg/apis/operations/v1alpha2/register.go b/pkg/kapis/operations/v1alpha2/register.go similarity index 100% rename from pkg/apis/operations/v1alpha2/register.go rename to pkg/kapis/operations/v1alpha2/register.go diff --git a/pkg/apis/resources/group.go b/pkg/kapis/resources/group.go similarity index 100% rename from pkg/apis/resources/group.go rename to pkg/kapis/resources/group.go diff --git a/pkg/apis/terminal/install/install.go b/pkg/kapis/resources/install/install.go similarity index 86% rename from pkg/apis/terminal/install/install.go rename to pkg/kapis/resources/install/install.go index 91877c4457f5bf44b835508243bf7034ccb6e9c4..85400efb991fb880db6a96fe82d1823e6d8135ce 100644 --- a/pkg/apis/terminal/install/install.go +++ b/pkg/kapis/resources/install/install.go @@ -20,8 +20,8 @@ package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - terminalv1alpha2 "kubesphere.io/kubesphere/pkg/apis/terminal/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/resources/v1alpha2" ) func init() { @@ -29,5 +29,5 @@ func init() { } func Install(c *restful.Container) { - urlruntime.Must(terminalv1alpha2.AddToContainer(c)) + urlruntime.Must(v1alpha2.AddToContainer(c)) } diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/kapis/resources/v1alpha2/register.go similarity index 100% rename from pkg/apis/resources/v1alpha2/register.go rename to pkg/kapis/resources/v1alpha2/register.go diff --git a/pkg/apis/servicemesh/metrics/group.go b/pkg/kapis/servicemesh/metrics/group.go similarity index 100% rename from pkg/apis/servicemesh/metrics/group.go rename to pkg/kapis/servicemesh/metrics/group.go diff --git a/pkg/apis/servicemesh/metrics/install/install.go b/pkg/kapis/servicemesh/metrics/install/install.go similarity index 81% rename from pkg/apis/servicemesh/metrics/install/install.go rename to pkg/kapis/servicemesh/metrics/install/install.go index 3e6563e531450b01de8703068fd4eef1b1cd924b..5c5a18365fbf50bfa6a1f5c0f5277fa2ce4e78fa 100644 --- a/pkg/apis/servicemesh/metrics/install/install.go +++ b/pkg/kapis/servicemesh/metrics/install/install.go @@ -3,8 +3,8 @@ package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/servicemesh/metrics/v1alpha2" ) func init() { diff --git a/pkg/apis/servicemesh/metrics/v1alpha2/register.go b/pkg/kapis/servicemesh/metrics/v1alpha2/register.go similarity index 100% rename from pkg/apis/servicemesh/metrics/v1alpha2/register.go rename to pkg/kapis/servicemesh/metrics/v1alpha2/register.go diff --git a/pkg/apis/servicemesh/metrics/v1alpha2/swagger-doc.go b/pkg/kapis/servicemesh/metrics/v1alpha2/swagger-doc.go similarity index 100% rename from pkg/apis/servicemesh/metrics/v1alpha2/swagger-doc.go rename to pkg/kapis/servicemesh/metrics/v1alpha2/swagger-doc.go diff --git a/pkg/kapis/tenant/group.go b/pkg/kapis/tenant/group.go new file mode 100644 index 0000000000000000000000000000000000000000..2f29dcfccc7b84fe2c2c4cb9552d1d0c5f81c7b5 --- /dev/null +++ b/pkg/kapis/tenant/group.go @@ -0,0 +1,17 @@ +/* +Copyright 2019 The KubeSphere authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package tenant diff --git a/pkg/apis/tenant/install/install.go b/pkg/kapis/tenant/install/install.go similarity index 92% rename from pkg/apis/tenant/install/install.go rename to pkg/kapis/tenant/install/install.go index 9e344eb067c1b0eb1701d4771841ba51c05be3d3..d164f7ca24dea59e7822298d42e17f727505c240 100644 --- a/pkg/apis/tenant/install/install.go +++ b/pkg/kapis/tenant/install/install.go @@ -20,8 +20,8 @@ package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + tenantv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/tenant/v1alpha2" ) func init() { diff --git a/pkg/apis/tenant/v1alpha2/register.go b/pkg/kapis/tenant/v1alpha2/register.go similarity index 100% rename from pkg/apis/tenant/v1alpha2/register.go rename to pkg/kapis/tenant/v1alpha2/register.go diff --git a/pkg/apis/terminal/group.go b/pkg/kapis/terminal/group.go similarity index 100% rename from pkg/apis/terminal/group.go rename to pkg/kapis/terminal/group.go diff --git a/pkg/apis/resources/install/install.go b/pkg/kapis/terminal/install/install.go similarity index 86% rename from pkg/apis/resources/install/install.go rename to pkg/kapis/terminal/install/install.go index dd634770a3858092226ea95f09713333cea7d10c..2f5e9efcdbcfa30c006212da75a4164040e37599 100644 --- a/pkg/apis/resources/install/install.go +++ b/pkg/kapis/terminal/install/install.go @@ -20,8 +20,8 @@ package install import ( "github.com/emicklei/go-restful" urlruntime "k8s.io/apimachinery/pkg/util/runtime" - resourcev1alpha2 "kubesphere.io/kubesphere/pkg/apis/resources/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" + "kubesphere.io/kubesphere/pkg/kapis/terminal/v1alpha2" ) func init() { @@ -29,5 +29,5 @@ func init() { } func Install(c *restful.Container) { - urlruntime.Must(resourcev1alpha2.AddToContainer(c)) + urlruntime.Must(v1alpha2.AddToContainer(c)) } diff --git a/pkg/apis/terminal/v1alpha2/register.go b/pkg/kapis/terminal/v1alpha2/register.go similarity index 100% rename from pkg/apis/terminal/v1alpha2/register.go rename to pkg/kapis/terminal/v1alpha2/register.go diff --git a/tools/cmd/doc-gen/main.go b/tools/cmd/doc-gen/main.go index 1b846026797844d7eb77d2c9037d84453e88fe41..b4f23cca9c85c6353c60e68c343a9738b6cb2a76 100644 --- a/tools/cmd/doc-gen/main.go +++ b/tools/cmd/doc-gen/main.go @@ -28,18 +28,18 @@ import ( "io/ioutil" "kubesphere.io/kubesphere/pkg/apiserver/runtime" "kubesphere.io/kubesphere/pkg/constants" + _ "kubesphere.io/kubesphere/pkg/kapis/servicemesh/metrics/install" "log" // Install apis - _ "kubesphere.io/kubesphere/pkg/apis/devops/install" - _ "kubesphere.io/kubesphere/pkg/apis/iam/install" - _ "kubesphere.io/kubesphere/pkg/apis/logging/install" - _ "kubesphere.io/kubesphere/pkg/apis/monitoring/install" - _ "kubesphere.io/kubesphere/pkg/apis/openpitrix/install" - _ "kubesphere.io/kubesphere/pkg/apis/operations/install" - _ "kubesphere.io/kubesphere/pkg/apis/resources/install" - _ "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/install" - _ "kubesphere.io/kubesphere/pkg/apis/tenant/install" - _ "kubesphere.io/kubesphere/pkg/apis/terminal/install" + _ "kubesphere.io/kubesphere/pkg/kapis/devops/install" + _ "kubesphere.io/kubesphere/pkg/kapis/iam/install" + _ "kubesphere.io/kubesphere/pkg/kapis/logging/install" + _ "kubesphere.io/kubesphere/pkg/kapis/monitoring/install" + _ "kubesphere.io/kubesphere/pkg/kapis/openpitrix/install" + _ "kubesphere.io/kubesphere/pkg/kapis/operations/install" + _ "kubesphere.io/kubesphere/pkg/kapis/resources/install" + _ "kubesphere.io/kubesphere/pkg/kapis/tenant/install" + _ "kubesphere.io/kubesphere/pkg/kapis/terminal/install" ) var output string