|
1 | 1 | package kafka |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "fmt" |
| 5 | + os "os" |
| 6 | + |
4 | 7 | "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" |
5 | 8 | "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" |
6 | 9 | ) |
@@ -50,15 +53,23 @@ func (m Chart) ExportData(e *environment.Environment) error { |
50 | 53 | return nil |
51 | 54 | } |
52 | 55 |
|
53 | | -func defaultProps() map[string]interface{} { |
| 56 | +func defaultProps(reg string) map[string]interface{} { |
54 | 57 | 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 | + }, |
55 | 69 | "auth": map[string]interface{}{ |
56 | 70 | "clientProtocol": "plaintext", |
57 | 71 | "interBrokerProtocol": "plaintext", |
58 | 72 | }, |
59 | | - "image": map[string]interface{}{ |
60 | | - "debug": true, |
61 | | - }, |
62 | 73 | "provisioning": map[string]interface{}{ |
63 | 74 | "enabled": true, |
64 | 75 | "resources": map[string]interface{}{ |
@@ -121,11 +132,15 @@ func New(props map[string]interface{}) environment.ConnectedChart { |
121 | 132 |
|
122 | 133 | // NewVersioned enables choosing a specific helm chart version |
123 | 134 | 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) |
125 | 140 | config.MustMerge(&dp, props) |
126 | 141 | return Chart{ |
127 | 142 | Name: "kafka", |
128 | | - Path: "bitnami/kafka", |
| 143 | + Path: fmt.Sprintf("%s/charts/debian-12/kafka:32.4.6", reg), |
129 | 144 | Values: &dp, |
130 | 145 | Version: helmVersion, |
131 | 146 | } |
|
0 commit comments