Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/spicedb/role.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 spicedb
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 role(ctx *common.RenderContext) ([]runtime.Object, error) {
16
labels := common.DefaultLabels(Component)
17
18
return []runtime.Object{
19
&rbacv1.Role{
20
TypeMeta: common.TypeMetaRole,
21
ObjectMeta: metav1.ObjectMeta{
22
Name: Component,
23
Namespace: ctx.Namespace,
24
Labels: labels,
25
},
26
Rules: []rbacv1.PolicyRule{
27
{
28
APIGroups: []string{""},
29
Resources: []string{"endpoints"},
30
Verbs: []string{
31
"get",
32
"watch",
33
},
34
},
35
},
36
},
37
}, nil
38
}
39
40