From f443f847a5c1909ee007128ab4a5bc4a9b3fb1de Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Thu, 14 Sep 2023 18:15:35 +0100 Subject: [PATCH] add set Signed-off-by: Jeromy Cannon --- .../client/model/install/InstallChartOptions.java | 7 ++++++- .../model/install/InstallChartOptionsBuilder.java | 13 +++++++++++++ .../test/model/InstallChartOptionsBuilderTest.java | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptions.java b/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptions.java index 11e092caa..511a7dfa3 100644 --- a/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptions.java +++ b/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptions.java @@ -32,6 +32,7 @@ * @param passCredentials - pass credentials to all domains. * @param password - chart repository password where to locate the requested chart. * @param repo - chart repository url where to locate the requested chart. + * @param set - set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) * @param skipCrds - if set, no CRDs will be installed. By default, CRDs are installed if not already present. * @param timeout - time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s). * @param username - chart repository username where to locate the requested chart. @@ -57,7 +58,7 @@ public record InstallChartOptions( String password, String repo, // TODO: for --set stringArray of key=value,key2=value2 (comma separated) - // String set, + String set, boolean skipCrds, String timeout, String username, @@ -98,6 +99,10 @@ public void apply(final HelmExecutionBuilder builder) { builder.argument("repo", repo()); } + if (set() != null) { + builder.argument("set", set()); + } + if (timeout() != null) { builder.argument("timeout", timeout()); } diff --git a/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptionsBuilder.java b/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptionsBuilder.java index afec8d648..d45bcca5c 100644 --- a/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptionsBuilder.java +++ b/fullstack-helm-client/src/main/java/com/hedera/fullstack/helm/client/model/install/InstallChartOptionsBuilder.java @@ -29,6 +29,7 @@ public final class InstallChartOptionsBuilder { private boolean passCredentials; private String password; private String repo; + private String set; private boolean skipCrds; private String timeout; private String username; @@ -149,6 +150,17 @@ public InstallChartOptionsBuilder repo(String repo) { return this; } + /** + * set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + * + * @param valueOverride set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + * @return the current InstallChartOptionsBuilder. + */ + public InstallChartOptionsBuilder set(String valueOverride) { + this.set = valueOverride; + return this; + } + /** * if set, no CRDs will be installed. By default, CRDs are installed if not already present. * @@ -247,6 +259,7 @@ public InstallChartOptions build() { passCredentials, password, repo, + set, skipCrds, timeout, username, diff --git a/fullstack-helm-client/src/test/java/com/hedera/fullstack/helm/client/test/model/InstallChartOptionsBuilderTest.java b/fullstack-helm-client/src/test/java/com/hedera/fullstack/helm/client/test/model/InstallChartOptionsBuilderTest.java index 0589985c2..fe23e9683 100644 --- a/fullstack-helm-client/src/test/java/com/hedera/fullstack/helm/client/test/model/InstallChartOptionsBuilderTest.java +++ b/fullstack-helm-client/src/test/java/com/hedera/fullstack/helm/client/test/model/InstallChartOptionsBuilderTest.java @@ -37,6 +37,7 @@ void testInstallChartOptionsBuilder() { .passCredentials(true) .password("password") .repo("repo") + .set("set") .skipCrds(true) .timeout("timeout") .username("username") @@ -55,6 +56,7 @@ void testInstallChartOptionsBuilder() { assertTrue(options.passCredentials()); assertEquals("password", options.password()); assertEquals("repo", options.repo()); + assertEquals("set", options.set()); assertTrue(options.skipCrds()); assertEquals("timeout", options.timeout()); assertEquals("username", options.username());