Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/ide-proxy/service.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 ide_proxy
6
7
import (
8
"github.com/gitpod-io/gitpod/installer/pkg/common"
9
10
corev1 "k8s.io/api/core/v1"
11
"k8s.io/apimachinery/pkg/runtime"
12
)
13
14
func service(ctx *common.RenderContext) ([]runtime.Object, error) {
15
var annotations map[string]string
16
17
if ctx.Config.Components != nil && ctx.Config.Components.IDE != nil && ctx.Config.Components.IDE.Proxy != nil {
18
annotations = ctx.Config.Components.IDE.Proxy.ServiceAnnotations
19
}
20
21
ports := []common.ServicePort{
22
{
23
Name: PortName,
24
ContainerPort: ContainerPort,
25
ServicePort: ServicePort,
26
},
27
}
28
29
return common.GenerateService(Component, ports, func(service *corev1.Service) {
30
for k, v := range annotations {
31
service.Annotations[k] = v
32
}
33
})(ctx)
34
}
35
36