File tree Expand file tree Collapse file tree 4 files changed +54
-1
lines changed
pkg/components/docker-registry
third_party/charts/docker-registry Expand file tree Collapse file tree 4 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ var Helm = common.CompositeHelmFunc(
31
31
helm .KeyValue ("docker-registry.service.port" , strconv .Itoa (common .ProxyContainerHTTPSPort )),
32
32
helm .KeyValue ("docker-registry.tlsSecretName" , BuiltInRegistryCerts ),
33
33
helm .KeyValue ("docker-registry.image.repository" , repository ),
34
+ helm .KeyValue ("docker-registry.serviceAccount.name" , Component ),
34
35
}
35
36
36
37
if len (cfg .Config .ImagePullSecrets ) > 0 {
Original file line number Diff line number Diff line change @@ -6,9 +6,19 @@ package dockerregistry
6
6
7
7
import (
8
8
"github.com/gitpod-io/gitpod/installer/pkg/common"
9
+ "k8s.io/apimachinery/pkg/runtime"
10
+ "k8s.io/utils/pointer"
9
11
)
10
12
11
13
var Objects = common .CompositeRenderFunc (
12
14
certificate ,
15
+ rolebinding ,
13
16
secret ,
17
+ func (ctx * common.RenderContext ) ([]runtime.Object , error ) {
18
+ if ! pointer .BoolDeref (ctx .Config .ContainerRegistry .InCluster , false ) {
19
+ return nil , nil
20
+ }
21
+
22
+ return common .DefaultServiceAccount (Component )(ctx )
23
+ },
14
24
)
Original file line number Diff line number Diff line change
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 dockerregistry
6
+
7
+ import (
8
+ "fmt"
9
+ "github.com/gitpod-io/gitpod/installer/pkg/common"
10
+ rbacv1 "k8s.io/api/rbac/v1"
11
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
+ "k8s.io/apimachinery/pkg/runtime"
13
+ "k8s.io/utils/pointer"
14
+ )
15
+
16
+ func rolebinding (ctx * common.RenderContext ) ([]runtime.Object , error ) {
17
+ if ! pointer .BoolDeref (ctx .Config .ContainerRegistry .InCluster , false ) {
18
+ return nil , nil
19
+ }
20
+
21
+ return []runtime.Object {
22
+ & rbacv1.RoleBinding {
23
+ TypeMeta : common .TypeMetaRoleBinding ,
24
+ ObjectMeta : metav1.ObjectMeta {
25
+ Name : Component ,
26
+ Namespace : ctx .Namespace ,
27
+ Labels : common .DefaultLabels (Component ),
28
+ },
29
+ RoleRef : rbacv1.RoleRef {
30
+ Kind : "ClusterRole" ,
31
+ Name : fmt .Sprintf ("%s-ns-psp:restricted-root-user" , ctx .Namespace ),
32
+ APIGroup : "rbac.authorization.k8s.io" ,
33
+ },
34
+ Subjects : []rbacv1.Subject {
35
+ {
36
+ Kind : "ServiceAccount" ,
37
+ Name : Component ,
38
+ },
39
+ },
40
+ },
41
+ }, nil
42
+ }
Original file line number Diff line number Diff line change @@ -8,5 +8,5 @@ name: docker-registry
8
8
version : 1.0.0
9
9
dependencies :
10
10
- name : docker-registry
11
- version : 1.14 .0
11
+ version : 1.16 .0
12
12
repository : https://helm.twun.io
You can’t perform that action at this time.
0 commit comments