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