diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index c2f7b689f..2bf94803f 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -69,7 +69,7 @@ import ( monitoringv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3" networkv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/network/v1alpha2" notificationv1 "kubesphere.io/kubesphere/pkg/kapis/notification/v1" - notificationv2 "kubesphere.io/kubesphere/pkg/kapis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/kapis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/kapis/oauth" openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1" operationsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/operations/v1alpha2" @@ -272,7 +272,7 @@ func (s *APIServer) installKubeSphereAPIs() { s.KubernetesClient.Prometheus(), s.AlertingClient, s.Config.AlertingOptions)) urlruntime.Must(version.AddToContainer(s.container, s.KubernetesClient.Discovery())) urlruntime.Must(kubeedgev1alpha1.AddToContainer(s.container, s.Config.KubeEdgeOptions.Endpoint)) - urlruntime.Must(notificationv2.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.Kubernetes(), + urlruntime.Must(notificationv2alpha1.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.Kubernetes(), s.KubernetesClient.KubeSphere())) } diff --git a/pkg/kapis/notification/v2/handler.go b/pkg/kapis/notification/v2alpha1/handler.go similarity index 97% rename from pkg/kapis/notification/v2/handler.go rename to pkg/kapis/notification/v2alpha1/handler.go index b35c015ac..f7ca1aa1d 100644 --- a/pkg/kapis/notification/v2/handler.go +++ b/pkg/kapis/notification/v2alpha1/handler.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( "github.com/emicklei/go-restful" @@ -125,7 +125,7 @@ func (h *handler) DeleteResource(req *restful.Request, resp *restful.Response) { return } - handleResponse(req, resp, h.operator.Delete(user, resource, name), servererr.None) + handleResponse(req, resp, servererr.None, h.operator.Delete(user, resource, name)) } func handleResponse(req *restful.Request, resp *restful.Response, obj interface{}, err error) { diff --git a/pkg/kapis/notification/v2/register.go b/pkg/kapis/notification/v2alpha1/register.go similarity index 99% rename from pkg/kapis/notification/v2/register.go rename to pkg/kapis/notification/v2alpha1/register.go index 2a50812f2..f93fbdafc 100644 --- a/pkg/kapis/notification/v2/register.go +++ b/pkg/kapis/notification/v2alpha1/register.go @@ -16,7 +16,7 @@ */ -package v2 +package v2alpha1 import ( "github.com/emicklei/go-restful" @@ -38,7 +38,7 @@ const ( KeyOpenAPITags = openapi.KeyOpenAPITags ) -var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2"} +var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2alpha1"} func AddToContainer( container *restful.Container,