Skip to content

Commit

Permalink
add set
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Sep 14, 2023
1 parent f772508 commit f443f84
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -247,6 +259,7 @@ public InstallChartOptions build() {
passCredentials,
password,
repo,
set,
skipCrds,
timeout,
username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void testInstallChartOptionsBuilder() {
.passCredentials(true)
.password("password")
.repo("repo")
.set("set")
.skipCrds(true)
.timeout("timeout")
.username("username")
Expand All @@ -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());
Expand Down

0 comments on commit f443f84

Please sign in to comment.