Skip to content

Commit b86bd40

Browse files
authored
use private Bitnami registry (#2158)
* use private Bitnami registry * override image and registry
1 parent ddd435d commit b86bd40

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

lib/k8s/pkg/helm/influxdb/influxdb.go

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package influxdb
22

33
import (
4+
"fmt"
5+
"os"
6+
47
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config"
58
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment"
69
)
@@ -50,13 +53,20 @@ func (m Chart) ExportData(e *environment.Environment) error {
5053
return nil
5154
}
5255

53-
func defaultProps() map[string]interface{} {
56+
func defaultProps(reg string) map[string]interface{} {
5457
return map[string]interface{}{
55-
"auth": map[string]interface{}{
56-
"enabled": "false",
58+
"global": map[string]interface{}{
59+
"security": map[string]interface{}{
60+
"allowInsecureImages": true,
61+
},
5762
},
5863
"image": map[string]interface{}{
59-
"tag": "1.7.10",
64+
"registry": reg,
65+
"repository": "containers/debian-12",
66+
"tag": "3.4.2",
67+
},
68+
"auth": map[string]interface{}{
69+
"enabled": "false",
6070
},
6171
"influxdb": map[string]interface{}{
6272
"readinessProbe": map[string]interface{}{
@@ -88,11 +98,15 @@ func New(props map[string]interface{}) environment.ConnectedChart {
8898

8999
// NewVersioned enables choosing a specific helm chart version
90100
func NewVersioned(helmVersion string, props map[string]interface{}) environment.ConnectedChart {
91-
dp := defaultProps()
101+
reg := os.Getenv("BITNAMI_PRIVATE_REGISTRY")
102+
if reg == "" {
103+
panic("BITNAMI_PRIVATE_REGISTRY not set, it is required for Helm charts")
104+
}
105+
dp := defaultProps(reg)
92106
config.MustMerge(&dp, props)
93107
return Chart{
94108
Name: "influxdb",
95-
Path: "bitnami/influxdb",
109+
Path: fmt.Sprintf("%s/charts/debian-12/influxdb:7.1.47", reg),
96110
Values: &dp,
97111
Version: helmVersion,
98112
}

lib/k8s/pkg/helm/kafka/kafka.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package kafka
22

33
import (
4+
"fmt"
5+
os "os"
6+
47
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config"
58
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment"
69
)
@@ -50,15 +53,23 @@ func (m Chart) ExportData(e *environment.Environment) error {
5053
return nil
5154
}
5255

53-
func defaultProps() map[string]interface{} {
56+
func defaultProps(reg string) map[string]interface{} {
5457
return map[string]interface{}{
58+
"global": map[string]interface{}{
59+
"security": map[string]interface{}{
60+
"allowInsecureImages": true,
61+
},
62+
},
63+
"image": map[string]interface{}{
64+
"registry": reg,
65+
"repository": "containers/debian-12",
66+
"tag": "4.1.0",
67+
"debug": true,
68+
},
5569
"auth": map[string]interface{}{
5670
"clientProtocol": "plaintext",
5771
"interBrokerProtocol": "plaintext",
5872
},
59-
"image": map[string]interface{}{
60-
"debug": true,
61-
},
6273
"provisioning": map[string]interface{}{
6374
"enabled": true,
6475
"resources": map[string]interface{}{
@@ -121,11 +132,15 @@ func New(props map[string]interface{}) environment.ConnectedChart {
121132

122133
// NewVersioned enables choosing a specific helm chart version
123134
func NewVersioned(helmVersion string, props map[string]interface{}) environment.ConnectedChart {
124-
dp := defaultProps()
135+
reg := os.Getenv("BITNAMI_PRIVATE_REGISTRY")
136+
if reg == "" {
137+
panic("BITNAMI_PRIVATE_REGISTRY not set, it is required for Helm charts")
138+
}
139+
dp := defaultProps(reg)
125140
config.MustMerge(&dp, props)
126141
return Chart{
127142
Name: "kafka",
128-
Path: "bitnami/kafka",
143+
Path: fmt.Sprintf("%s/charts/debian-12/kafka:32.4.6", reg),
129144
Values: &dp,
130145
Version: helmVersion,
131146
}

0 commit comments

Comments
 (0)