Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/dashboard/rolebinding.go
2501 views
1
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package dashboard
6
7
import (
8
"github.com/gitpod-io/gitpod/installer/pkg/common"
9
10
rbacv1 "k8s.io/api/rbac/v1"
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
"k8s.io/apimachinery/pkg/runtime"
13
)
14
15
func rolebinding(ctx *common.RenderContext) ([]runtime.Object, error) {
16
return []runtime.Object{&rbacv1.RoleBinding{
17
TypeMeta: common.TypeMetaRoleBinding,
18
ObjectMeta: metav1.ObjectMeta{
19
Name: ComponentServiceAccount,
20
Namespace: ctx.Namespace,
21
Labels: common.DefaultLabels(Component),
22
},
23
RoleRef: rbacv1.RoleRef{
24
Kind: "Role",
25
Name: ComponentServiceAccount,
26
APIGroup: "rbac.authorization.k8s.io",
27
},
28
Subjects: []rbacv1.Subject{{
29
Kind: "ServiceAccount",
30
Name: ComponentServiceAccount,
31
}},
32
}}, nil
33
}
34
35