|
2 | 2 | // Licensed under the GNU Affero General Public License (AGPL).
|
3 | 3 | // See License-AGPL.txt in the project root for license information.
|
4 | 4 |
|
| 5 | +// Minio is used for both incluster deployments and as a facade for non-GCP storage providers |
| 6 | + |
5 | 7 | package minio
|
6 | 8 |
|
7 | 9 | import (
|
8 |
| - "fmt" |
9 | 10 | "github.com/gitpod-io/gitpod/installer/pkg/common"
|
10 |
| - "github.com/gitpod-io/gitpod/installer/pkg/helm" |
11 |
| - "github.com/gitpod-io/gitpod/installer/third_party/charts" |
12 |
| - "helm.sh/helm/v3/pkg/cli/values" |
| 11 | + "github.com/gitpod-io/gitpod/installer/pkg/components/minio/incluster" |
13 | 12 | "k8s.io/utils/pointer"
|
14 | 13 | )
|
15 | 14 |
|
16 | 15 | var Helm = common.CompositeHelmFunc(
|
17 |
| - helm.ImportTemplate(charts.Minio(), helm.TemplateConfig{}, func(cfg *common.RenderContext) (*common.HelmConfig, error) { |
18 |
| - accessKey := cfg.Values.StorageAccessKey |
19 |
| - if accessKey == "" { |
20 |
| - return nil, fmt.Errorf("unknown value: storage access key") |
21 |
| - } |
22 |
| - secretKey := cfg.Values.StorageSecretKey |
23 |
| - if secretKey == "" { |
24 |
| - return nil, fmt.Errorf("unknown value: storage secret key") |
| 16 | + func(cfg *common.RenderContext) ([]string, error) { |
| 17 | + if pointer.BoolDeref(cfg.Config.ObjectStorage.InCluster, false) { |
| 18 | + return incluster.Helm(ServiceAPIPort, ServiceConsolePort)(cfg) |
25 | 19 | }
|
26 | 20 |
|
27 |
| - return &common.HelmConfig{ |
28 |
| - Enabled: pointer.BoolDeref(cfg.Config.ObjectStorage.InCluster, false), |
29 |
| - Values: &values.Options{ |
30 |
| - Values: []string{ |
31 |
| - helm.KeyValue("minio.auth.rootUser", accessKey), |
32 |
| - helm.KeyValue("minio.auth.rootPassword", secretKey), |
33 |
| - helm.KeyValue("service.ports.api", fmt.Sprintf("%d", ServiceAPIPort)), |
34 |
| - helm.KeyValue("service.ports.console", fmt.Sprintf("%d", ServiceConsolePort)), |
35 |
| - }, |
36 |
| - }, |
37 |
| - }, nil |
38 |
| - }), |
| 21 | + return nil, nil |
| 22 | + }, |
39 | 23 | )
|
0 commit comments