Path: blob/main/install/installer/pkg/components/ws-proxy/role.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 wsproxy56import (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 role(ctx *common.RenderContext) ([]runtime.Object, error) {15rules := []rbacv1.PolicyRule{16{17APIGroups: []string{""},18Resources: []string{"pods"},19Verbs: []string{20"get",21"list",22"watch",23},24},25{26APIGroups: []string{"workspace.gitpod.io"},27Resources: []string{"workspaces"},28Verbs: []string{29"get",30"list",31"watch",32},33},34}3536return []runtime.Object{&rbacv1.Role{37TypeMeta: common.TypeMetaRole,38ObjectMeta: metav1.ObjectMeta{39Name: Component,40Namespace: ctx.Namespace,41Labels: common.DefaultLabels(Component),42},43Rules: rules,44},45}, nil46}474849