diff --git a/internal/helmclient/tools/tools.go b/internal/helmclient/tools/tools.go index 840aa08..0d589b7 100644 --- a/internal/helmclient/tools/tools.go +++ b/internal/helmclient/tools/tools.go @@ -55,11 +55,15 @@ type CompositionValues struct { // The modified values are returned as a byte slice. func InjectValues(dat []byte, opts CompositionValues) ([]byte, error) { var err error + gracefullyPaused := "false" if opts.GracefullyPaused { - dat, err = AddOrUpdateFieldInValues(dat, true, "global", "gracefullyPaused") - if err != nil { - return dat, fmt.Errorf("failed to add gracefullyPaused to values: %w", err) - } + gracefullyPaused = "true" + } else { + gracefullyPaused = "false" + } + dat, err = AddOrUpdateFieldInValues(dat, gracefullyPaused, "global", "gracefullyPaused") + if err != nil { + return dat, fmt.Errorf("failed to add gracefullyPaused to values: %w", err) } dat, err = AddOrUpdateFieldInValues(dat, opts.CompositionNamespace, "global", "compositionNamespace") diff --git a/internal/helmclient/tools/tools_test.go b/internal/helmclient/tools/tools_test.go index 5f4df1b..4cae787 100644 --- a/internal/helmclient/tools/tools_test.go +++ b/internal/helmclient/tools/tools_test.go @@ -111,7 +111,7 @@ func TestInjectValues(t *testing.T) { }, expected: map[string]interface{}{ "global": map[string]interface{}{ - "gracefullyPaused": true, + "gracefullyPaused": "true", "compositionNamespace": "default", "compositionName": "test-composition", "krateoNamespace": "krateo-system", @@ -139,6 +139,7 @@ func TestInjectValues(t *testing.T) { }, expected: map[string]interface{}{ "global": map[string]interface{}{ + "gracefullyPaused": "false", "compositionNamespace": "default", "compositionName": "test-composition", "krateoNamespace": "krateo-system", @@ -168,6 +169,7 @@ func TestInjectValues(t *testing.T) { "field": "value", }, "global": map[string]interface{}{ + "gracefullyPaused": "false", "existingGlobal": "value", "compositionNamespace": "default", "compositionName": "test-composition",