Path: blob/main/install/installer/pkg/components/dashboard/rolebinding.go
2501 views
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package dashboard56import (7"github.com/gitpod-io/gitpod/installer/pkg/common"89rbacv1 "k8s.io/api/rbac/v1"10metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"11"k8s.io/apimachinery/pkg/runtime"12)1314func rolebinding(ctx *common.RenderContext) ([]runtime.Object, error) {15return []runtime.Object{&rbacv1.RoleBinding{16TypeMeta: common.TypeMetaRoleBinding,17ObjectMeta: metav1.ObjectMeta{18Name: ComponentServiceAccount,19Namespace: ctx.Namespace,20Labels: common.DefaultLabels(Component),21},22RoleRef: rbacv1.RoleRef{23Kind: "Role",24Name: ComponentServiceAccount,25APIGroup: "rbac.authorization.k8s.io",26},27Subjects: []rbacv1.Subject{{28Kind: "ServiceAccount",29Name: ComponentServiceAccount,30}},31}}, nil32}333435