Skip to content

Commit 28e33f8

Browse files
authored
refactor: low resource mode disables connector builder server (#160)
1 parent 8005219 commit 28e33f8

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

internal/cmd/local/helm/airbyte_values.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ func BuildAirbyteValues(ctx context.Context, opts ValuesOpts) (string, error) {
4444
"global.jobs.resources.requests.cpu=0",
4545
"global.jobs.resources.requests.memory=0",
4646

47+
"connector-builder-server.enabled=false",
48+
4749
"workload-launcher.env_vars.CHECK_JOB_MAIN_CONTAINER_CPU_REQUEST=0",
4850
"workload-launcher.env_vars.CHECK_JOB_MAIN_CONTAINER_MEMORY_REQUEST=0",
4951
"workload-launcher.env_vars.DISCOVER_JOB_MAIN_CONTAINER_CPU_REQUEST=0",

internal/cmd/local/local/testdata/expected-default.values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ airbyte-bootloader:
33
PLATFORM_LOG_FORMAT: json
44
global:
55
auth:
6-
enabled: "true"
6+
enabled: true
77
env_vars:
88
AIRBYTE_INSTALLATION_ID: test-user
99
jobs:

internal/maps/maps.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package maps
33
import (
44
"fmt"
55
"os"
6+
"strconv"
67
"strings"
78

89
"gopkg.in/yaml.v3"
@@ -31,6 +32,17 @@ func FromSlice(slice []string) map[string]any {
3132
for i, k := range keys {
3233
// last key, put the value into the map
3334
if i == len(keys)-1 {
35+
// handle boolean values (convert "true"/"false" strings to Go bool types)
36+
// this is necessary for Helm chart dependency conditions
37+
// which require actual boolean values
38+
if value == "true" || value == "false" {
39+
boolValue, err := strconv.ParseBool(value)
40+
if err == nil {
41+
p[k] = boolValue
42+
continue
43+
}
44+
}
45+
3446
p[k] = value
3547
continue
3648
}

internal/maps/maps_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ func TestFromSlice(t *testing.T) {
7979
},
8080
},
8181
},
82+
{
83+
name: "boolean values",
84+
input: []string{"a=true", "b=false"},
85+
want: map[string]any{
86+
"a": true,
87+
"b": false,
88+
},
89+
},
8290
}
8391

8492
for _, tt := range tests {

0 commit comments

Comments
 (0)