From d27c5b96cf83c7171a0d391987ddab11822638cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=BE=81?= Date: Thu, 9 May 2019 18:10:20 +0800 Subject: [PATCH] add missing api group (#400) Signed-off-by: hongming --- pkg/apiserver/resources/application.go | 3 ++- pkg/controller/namespace/namespace_controller.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/apiserver/resources/application.go b/pkg/apiserver/resources/application.go index f27af3149..fc2dc3f53 100644 --- a/pkg/apiserver/resources/application.go +++ b/pkg/apiserver/resources/application.go @@ -23,6 +23,7 @@ import ( "k8s.io/api/core/v1" "kubesphere.io/kubesphere/pkg/constants" "kubesphere.io/kubesphere/pkg/errors" + "kubesphere.io/kubesphere/pkg/models" "kubesphere.io/kubesphere/pkg/models/applications" "kubesphere.io/kubesphere/pkg/models/resources" "kubesphere.io/kubesphere/pkg/params" @@ -98,7 +99,7 @@ func NamespacedApplicationHandler(req *restful.Request, resp *restful.Response) if runtimeId == "" { glog.Errorln("runtime id not found") - resp.WriteHeaderAndEntity(http.StatusInternalServerError, errors.New("openpitrix runtime not init")) + resp.WriteAsJson(models.PageableResponse{Items: []interface{}{}, TotalCount: 0}) return } diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index 5f9bbca2a..7c78ddd9f 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -56,7 +56,7 @@ var ( defaultRoles = []rbac.Role{ {ObjectMeta: metav1.ObjectMeta{Name: "admin", Annotations: map[string]string{constants.DescriptionAnnotationKey: adminDescription, constants.CreatorAnnotationKey: constants.System}}, Rules: []rbac.PolicyRule{{Verbs: []string{"*"}, APIGroups: []string{"*"}, Resources: []string{"*"}}}}, {ObjectMeta: metav1.ObjectMeta{Name: "operator", Annotations: map[string]string{constants.DescriptionAnnotationKey: operatorDescription, constants.CreatorAnnotationKey: constants.System}}, Rules: []rbac.PolicyRule{{Verbs: []string{"get", "list", "watch"}, APIGroups: []string{"*"}, Resources: []string{"*"}}, - {Verbs: []string{"*"}, APIGroups: []string{"", "apps", "extensions", "batch", "logging.kubesphere.io", "monitoring.kubesphere.io", "iam.kubesphere.io", "resources.kubesphere.io", "autoscaling", "alerting.kubesphere.io"}, Resources: []string{"*"}}}}, + {Verbs: []string{"*"}, APIGroups: []string{"", "apps", "extensions", "batch", "logging.kubesphere.io", "monitoring.kubesphere.io", "iam.kubesphere.io", "resources.kubesphere.io", "autoscaling", "alerting.kubesphere.io", "app.k8s.io", "servicemesh.kubesphere.io"}, Resources: []string{"*"}}}}, {ObjectMeta: metav1.ObjectMeta{Name: "viewer", Annotations: map[string]string{constants.DescriptionAnnotationKey: viewerDescription, constants.CreatorAnnotationKey: constants.System}}, Rules: []rbac.PolicyRule{{Verbs: []string{"get", "list", "watch"}, APIGroups: []string{"*"}, Resources: []string{"*"}}}}, } )