diff --git a/builder/src/main/java/cz/xtf/builder/builders/pod/ContainerBuilder.java b/builder/src/main/java/cz/xtf/builder/builders/pod/ContainerBuilder.java index aeb57539..ea02935c 100644 --- a/builder/src/main/java/cz/xtf/builder/builders/pod/ContainerBuilder.java +++ b/builder/src/main/java/cz/xtf/builder/builders/pod/ContainerBuilder.java @@ -5,6 +5,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -43,6 +44,7 @@ public class ContainerBuilder implements EnvironmentConfiguration, ResourceLimit private final String name; private final Map envVars = new HashMap<>(); + private final List args = new LinkedList<>(); private final Map referredEnvVars = new HashMap<>(); private final Set ports = new HashSet<>(); private final Set volumeMounts = new HashSet<>(); @@ -104,6 +106,11 @@ public ContainerBuilder port(int port, TransportProtocol protocol, String name) return this; } + public ContainerBuilder args(String value) { + args.add(value); + return this; + } + public ContainerBuilder envVar(String key, String value) { return configEntry(key, value); } @@ -197,6 +204,9 @@ public Container build() { builder.withEnv(Stream.concat(definedVars, referredVars).collect(Collectors.toList())); builder.withImage(imageName); builder.withImagePullPolicy("Always"); + if (!args.isEmpty()) { + builder.withArgs(args); + } if (command != null) { builder.withCommand(command);