Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/ws-daemon/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 wsdaemon
6
7
import (
8
"github.com/gitpod-io/gitpod/installer/pkg/common"
9
rbacv1 "k8s.io/api/rbac/v1"
10
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
"k8s.io/apimachinery/pkg/runtime"
12
)
13
14
func role(ctx *common.RenderContext) ([]runtime.Object, error) {
15
return []runtime.Object{
16
&rbacv1.Role{
17
TypeMeta: common.TypeMetaRole,
18
ObjectMeta: metav1.ObjectMeta{
19
Name: Component,
20
Namespace: common.WorkspaceSecretsNamespace,
21
Labels: common.DefaultLabels(Component),
22
},
23
Rules: []rbacv1.PolicyRule{
24
{
25
APIGroups: []string{""},
26
Resources: []string{"secrets"},
27
Verbs: []string{
28
"get",
29
"list",
30
"watch",
31
},
32
},
33
},
34
},
35
}, nil
36
}
37
38