public void testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials() {
    String group = "foo";
    String name = "container" + new Random().nextInt();

    Template template = templateBuilder.imageId(defaultImage.id()).build();

    DockerTemplateOptions options = template.getOptions().as(DockerTemplateOptions.class);
    options.env(ImmutableList.of("ROOT_PASSWORD=password"));
    guest = adapter.createNodeWithGroupEncodedIntoName(group, name, template);
    assertEquals(guest.getNodeId(), guest.getNode().id());
  }
Пример #2
0
 /** @see TemplateOptions#blockOnPort(int, int) */
 public static DockerTemplateOptions blockOnPort(int port, int seconds) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.blockOnPort(port, seconds);
 }
Пример #3
0
 /** @see DockerTemplateOptions#volumes(Map) */
 public static DockerTemplateOptions volumes(Map<String, String> volumes) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.volumes(volumes);
 }
Пример #4
0
 /** @see TemplateOptions#blockUntilRunning(boolean) */
 public static DockerTemplateOptions blockUntilRunning(boolean blockUntilRunning) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.blockUntilRunning(blockUntilRunning);
 }
Пример #5
0
 /** @see TemplateOptions#overrideAuthenticateSudo(boolean) */
 public static DockerTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.overrideAuthenticateSudo(authenticateSudo);
 }
Пример #6
0
 /** @see TemplateOptions#overrideLoginPassword(String) */
 public static DockerTemplateOptions overrideLoginPassword(String password) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.overrideLoginPassword(password);
 }
Пример #7
0
 /** @see TemplateOptions#networks(Iterable) */
 public static DockerTemplateOptions networks(Iterable<String> networks) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.networks(networks);
 }
Пример #8
0
 /** @see TemplateOptions#userMetadata(Map) */
 public static DockerTemplateOptions userMetadata(Map<String, String> userMetadata) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.userMetadata(userMetadata);
 }
Пример #9
0
 /** @see DockerTemplateOptions#cpuShares(Integer) */
 public static DockerTemplateOptions cpuShares(@Nullable Integer cpuShares) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.cpuShares(cpuShares);
 }
Пример #10
0
 /** @see DockerTemplateOptions#commands(Iterable) */
 public static DockerTemplateOptions commands(Iterable<String> commands) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.commands(commands);
 }
Пример #11
0
 /** @see DockerTemplateOptions#commands(String...) */
 public static DockerTemplateOptions commands(String... commands) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.commands(commands);
 }
Пример #12
0
 /** @see DockerTemplateOptions#memory(Integer) */
 public static DockerTemplateOptions memory(@Nullable Integer memory) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.memory(memory);
 }
Пример #13
0
 /** @see DockerTemplateOptions#hostname(String) */
 public static DockerTemplateOptions hostname(@Nullable String hostname) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.hostname(hostname);
 }
Пример #14
0
 /** @see DockerTemplateOptions#dns(Iterable) */
 public static DockerTemplateOptions dns(Iterable<String> dns) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.dns(dns);
 }
Пример #15
0
 /** @see DockerTemplateOptions#dns(String...) */
 public static DockerTemplateOptions dns(String... dns) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.dns(dns);
 }
Пример #16
0
 /** @see TemplateOptions#installPrivateKey(String) */
 public static DockerTemplateOptions installPrivateKey(String rsaKey) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.installPrivateKey(rsaKey);
 }
Пример #17
0
 /** @see TemplateOptions#authorizePublicKey(String) */
 public static DockerTemplateOptions authorizePublicKey(String rsaKey) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.authorizePublicKey(rsaKey);
 }
Пример #18
0
 /** @see DockerTemplateOptions#env(String...) */
 public static DockerTemplateOptions env(String... env) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.env(env);
 }
Пример #19
0
 /** @see TemplateOptions#nodeNames(Iterable) */
 public static DockerTemplateOptions nodeNames(Iterable<String> nodeNames) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.nodeNames(nodeNames);
 }
Пример #20
0
 /** @see DockerTemplateOptions#env(Iterable) */
 public static DockerTemplateOptions env(Iterable<String> env) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.env(env);
 }
Пример #21
0
 /** @see TemplateOptions#overrideLoginUser(String) */
 public static DockerTemplateOptions overrideLoginUser(String user) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.overrideLoginUser(user);
 }
Пример #22
0
 /** @see DockerTemplateOptions#portBindings(Map) */
 public static DockerTemplateOptions portBindings(Map<Integer, Integer> portBindings) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.portBindings(portBindings);
 }
Пример #23
0
 /** @see TemplateOptions#overrideLoginPrivateKey(String) */
 public static DockerTemplateOptions overrideLoginPrivateKey(String privateKey) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.overrideLoginPrivateKey(privateKey);
 }
Пример #24
0
 /** @see DockerTemplateOptions#networkMode(String) */
 public static DockerTemplateOptions networkMode(@Nullable String networkMode) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.networkMode(networkMode);
 }
Пример #25
0
 /** @see TemplateOptions#overrideLoginCredentials(LoginCredentials) */
 public static DockerTemplateOptions overrideLoginCredentials(LoginCredentials credentials) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.overrideLoginCredentials(credentials);
 }
Пример #26
0
 /** @see DockerTemplateOptions#extraHosts(Map) */
 public static DockerTemplateOptions extraHosts(Map<String, String> extraHosts) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.extraHosts(extraHosts);
 }
Пример #27
0
 @Override
 public void copyTo(TemplateOptions to) {
   super.copyTo(to);
   if (to instanceof DockerTemplateOptions) {
     DockerTemplateOptions eTo = DockerTemplateOptions.class.cast(to);
     if (!volumes.isEmpty()) {
       eTo.volumes(volumes);
     }
     eTo.hostname(hostname);
     if (!dns.isEmpty()) {
       eTo.dns(dns);
     }
     eTo.memory(memory);
     eTo.cpuShares(cpuShares);
     if (!commands.isEmpty()) {
       eTo.commands(commands);
     }
     if (!env.isEmpty()) {
       eTo.env(env);
     }
     if (!portBindings.isEmpty()) {
       eTo.portBindings(portBindings);
     }
     eTo.networkMode(networkMode);
     if (!extraHosts.isEmpty()) {
       eTo.extraHosts(extraHosts);
     }
   }
 }
Пример #28
0
 /** @see TemplateOptions#inboundPorts(int...) */
 public static DockerTemplateOptions inboundPorts(int... ports) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.inboundPorts(ports);
 }