Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/image-builder-api/go/config/config.go
2500 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 config
6
7
import (
8
"github.com/gitpod-io/gitpod/common-go/baseserver"
9
)
10
11
type ServiceConfig struct {
12
Orchestrator Configuration `json:"orchestrator"`
13
RefCache RefCacheConfig `json:"refCache,omitempty"`
14
15
Server *baseserver.Configuration `json:"server"`
16
}
17
18
type RefCacheConfig struct {
19
Interval string `json:"interval"`
20
Refs []string `json:"refs"`
21
}
22
23
// Configuration configures the orchestrator
24
type Configuration struct {
25
WorkspaceManager WorkspaceManagerConfig `json:"wsman"`
26
27
// PullSecret names a Kubernetes secret which contains a `.dockerconfigjson` entry
28
// carrying the Docker authentication credentials to interact with the baseImageRepository
29
// and workspaceImageRepository.
30
PullSecret string `json:"pullSecret,omitempty"`
31
32
// PullSecretFile points to a mount of the .dockerconfigjson file of the PullSecret.
33
PullSecretFile string `json:"pullSecretFile,omitempty"`
34
35
// BaseImageRepository configures repository where we'll push base images to.
36
BaseImageRepository string `json:"baseImageRepository"`
37
38
// WorkspaceImageRepository configures the repository where we'll push the final workspace images to.
39
// Note that the workspace nodes/kubelets need access to this repository.
40
WorkspaceImageRepository string `json:"workspaceImageRepository"`
41
42
// BuilderImage is an image ref to the workspace builder image
43
BuilderImage string `json:"builderImage"`
44
45
// EnableAdditionalECRAuth adds additional ECR auth using IRSA.
46
// This will attempt to add ECR auth for any ECR repo a user is
47
// trying to access.
48
EnableAdditionalECRAuth bool `json:"enableAdditionalECRAuth"`
49
50
// SubassemblyBucketName configures the subassembly bucket
51
SubassemblyBucketName string `json:"subassemblyBucketName,omitempty"`
52
// SubassemblyBucketPrefix configures an optional key prefix used for locating subassemblies in the bucket
53
SubassemblyBucketPrefix string `json:"subassemblyBucketPrefix,omitempty"`
54
}
55
56
type TLS struct {
57
Authority string `json:"ca"`
58
Certificate string `json:"crt"`
59
PrivateKey string `json:"key"`
60
}
61
62
// WorkspaceManagerConfig configures the workspace manager connection
63
type WorkspaceManagerConfig struct {
64
Address string `json:"address"`
65
TLS TLS `json:"tls,omitempty"`
66
// expected to be a wsmanapi.WorkspaceManagerClient - use to avoid dependency on wsmanapi
67
// this field is used for testing only
68
Client interface{} `json:"-"`
69
}
70
71