presidium 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Docker.js CHANGED
@@ -1403,13 +1403,14 @@ class Docker {
1403
1403
  * ```
1404
1404
  */
1405
1405
  async initSwarm(address) {
1406
+ const port = address.split(':')[1]
1406
1407
  const response = await this.http.post('/swarm/init', {
1407
1408
  headers: {
1408
1409
  'Content-Type': 'application/json',
1409
1410
  },
1410
1411
  body: JSON.stringify({
1411
1412
  AdvertiseAddr: address,
1412
- ListenAddr: address,
1413
+ ListenAddr: `0.0.0.0:${port}`,
1413
1414
  }),
1414
1415
  })
1415
1416
 
@@ -1451,12 +1452,13 @@ class Docker {
1451
1452
  * ```
1452
1453
  */
1453
1454
  async joinSwarm(address, options) {
1455
+ const port = address.split(':')[1]
1454
1456
  const response = await this.http.post('/swarm/join', {
1455
1457
  headers: {
1456
1458
  'Content-Type': 'application/json',
1457
1459
  },
1458
1460
  body: JSON.stringify({
1459
- ListenAddr: address,
1461
+ ListenAddr: `0.0.0.0:${port}`,
1460
1462
  AdvertiseAddr: address,
1461
1463
  RemoteAddrs: options.RemoteAddrs,
1462
1464
  JoinToken: options.JoinToken,
@@ -1,5 +1,7 @@
1
1
  const Readable = require('../Readable')
2
2
  const AwsError = require('./AwsError')
3
+ const retryableErrorNames = require('./retryableErrorNames')
4
+ const sleep = require('./sleep')
3
5
 
4
6
  /**
5
7
  * @name handleAwsResponse
@@ -0,0 +1,34 @@
1
+ const Test = require('thunk-test')
2
+ const handleAwsResponse = require('./handleAwsResponse')
3
+ const stream = require('stream')
4
+
5
+ const test = new Test('handleAwsResponse', handleAwsResponse)
6
+
7
+ const response1 = stream.Readable.from([JSON.stringify({ A: 1 })])
8
+ response1.ok = true
9
+
10
+ test.case(response1, { A: 1 })
11
+
12
+ const response2 = stream.Readable.from([JSON.stringify({
13
+ __type: 'Forbidden',
14
+ Message: 'A',
15
+ })])
16
+ response2.ok = false
17
+
18
+ test.throws(response2, { name: 'Forbidden', message: 'A' })
19
+
20
+ const response3 = stream.Readable.from([JSON.stringify({
21
+ __type: 'ThrottlingException',
22
+ Message: 'A',
23
+ })])
24
+ response3.ok = false
25
+
26
+ function identity(value) { return value }
27
+
28
+ test.case(response3, identity, 1, 1)
29
+
30
+ if (process.argv[1] == __filename) {
31
+ test()
32
+ }
33
+
34
+ module.exports = test
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",