Skip to content

Commit a1901c9

Browse files
author
Simon Emms
committed
[installer]: add image pull secrets to gitpod components
1 parent 58496c3 commit a1901c9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

installer/pkg/common/objects.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ import (
1414

1515
func DefaultServiceAccount(component string) RenderFunc {
1616
return func(cfg *RenderContext) ([]runtime.Object, error) {
17+
pullSecrets := make([]corev1.LocalObjectReference, 0)
18+
19+
if len(cfg.Config.ImagePullSecrets) > 0 {
20+
for _, i := range cfg.Config.ImagePullSecrets {
21+
pullSecrets = append(pullSecrets, corev1.LocalObjectReference{
22+
Name: i.Name,
23+
})
24+
}
25+
}
26+
1727
return []runtime.Object{
1828
&corev1.ServiceAccount{
1929
TypeMeta: TypeMetaServiceAccount,
@@ -23,6 +33,7 @@ func DefaultServiceAccount(component string) RenderFunc {
2333
Labels: DefaultLabels(component),
2434
},
2535
AutomountServiceAccountToken: pointer.Bool(true),
36+
ImagePullSecrets: pullSecrets,
2637
},
2738
}, nil
2839
}

0 commit comments

Comments
 (0)