Skip to content

Commit 9f43b43

Browse files
committed
Replace journal-id to journal-fqdn
1 parent 08ebb2f commit 9f43b43

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ This Docker plugin extends and expands Docker's logging capabilities so that cus
1414
1. Download plugin
1515

1616
```bash
17-
$ docker plugin install h1cr.io/h1-docker-logging-plugin
17+
docker plugin install h1cr.io/h1-docker-logging-plugin
1818
```
1919

2020
2. Enable plugin
2121

2222
```bash
23-
$ docker plugin enable h1cr.io/h1-docker-logging-plugin
23+
docker plugin enable h1cr.io/h1-docker-logging-plugin
2424
```
2525

2626
## Install Docker logging plugin from source
2727

2828
1. Clone the repository and check out release branch:
2929

3030
```bash
31-
$ cd h1-docker-journal-plugin
32-
$ git checkout release
31+
cd h1-docker-journal-plugin
32+
git checkout release
3333
```
3434

3535
2. Build the plugin:
@@ -50,10 +50,10 @@ Configure the plugin separately for each container when using the docker run com
5050

5151
```bash
5252
docker run --rm --label x \
53-
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
54-
--log-opt journal-id=5d4362e4939bdbe421cb09ee \
55-
--log-opt journal-token=test \
56-
-it alpine id
53+
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
54+
--log-opt journal-fqdn=5d78e1427fd7e0228fe18f46.journal.pl-waw-1.hyperone.cloud \
55+
--log-opt journal-token=test \
56+
-it alpine id
5757
```
5858

5959
Now that the plugin is installed and configured, it will send logs while the container is running.
@@ -62,8 +62,8 @@ Now that the plugin is installed and configured, it will send logs while the con
6262

6363
| Name | Description |
6464
| -----| ------------
65-
| ```journal-id``` | Journal ID that will receive logs
66-
| ```journal-token``` | Credential (password) to journal indicated in the parameter ```journal-id```
65+
| ```journal-fqdn``` | Journal FQDN that will receive logs
66+
| ```journal-token``` | Credential (password) to journal indicated in the parameter ```journal-fqdn```
6767

6868
### Optional variables
6969

driver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = () => {
3737
const driver = {};
3838

3939
driver.startLogging = async (stream, File, Info) => {
40-
['journal-id', 'journal-token'].forEach(name => {
40+
['journal-fqdn', 'journal-token'].forEach(name => {
4141
if (!Info.Config[name]) {
4242
throw new Error(`Missing '${name} option of log driver`);
4343
}

journal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const logger = require('superagent-logger');
44
const WebSocket = require('ws');
55

66
module.exports = (config) => {
7-
const url = `http://${config['journal-id']}.journal.pl-waw-1.hyperone.cloud/log`;
7+
const url = `http://${config['journal-fqdn']}/log`;
88
const agent = require('superagent').agent().use(logger);
99
return {
1010
checkJournalToken: () => agent.head(url).query({ follow: false })
@@ -35,13 +35,13 @@ module.exports = (config) => {
3535
});
3636

3737
ws.on('open', () => {
38-
console.log(config['journal-id'], 'websocket opened');
38+
console.log(config['journal-fqdn'], 'websocket opened');
3939
const stream = WebSocket.createWebSocketStream(ws);
4040
resolve(stream);
4141
});
4242

4343
ws.on('close', () => {
44-
console.log(config['journal-id'], 'websocket closed');
44+
console.log(config['journal-fqdn'], 'websocket closed');
4545
});
4646
ws.on('error', reject);
4747
}),

tests/driver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LogGenerator extends Readable {
4040

4141
const defaultInfo = {
4242
Config: {
43-
'journal-id': process.env.JOURNAL_ID,
43+
'journal-fqdn': `${process.env.JOURNAL_ID}.journal.pl-waw-1.hyperone.cloud`,
4444
'journal-token': process.env.JOURNAL_TOKEN,
4545
},
4646
ContainerID: 'eddeb66fc259',

tests/e2e/e2e.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ teardown() {
1717
run docker run \
1818
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
1919
--label dockerbats="$BATS_TEST_NAME" \
20-
--log-opt journal-id=${JOURNAL_ID} \
20+
--log-opt journal-fqdn=${JOURNAL_ID}.journal.pl-waw-1.hyperone.cloud \
2121
--log-opt journal-token=${JOURNAL_TOKEN} \
2222
alpine sh -c 'echo $RANDOM';
2323
[ "$status" -eq 0 ];
@@ -31,7 +31,7 @@ teardown() {
3131
run docker run -d \
3232
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
3333
--label dockerbats="$BATS_TEST_NAME" \
34-
--log-opt journal-id=${JOURNAL_ID} \
34+
--log-opt journal-fqdn=${JOURNAL_ID}.journal.pl-waw-1.hyperone.cloud \
3535
--log-opt journal-token=${JOURNAL_TOKEN} \
3636
alpine sh -c 'seq 1 10; sleep 30';
3737
[ "$status" -eq 0 ];
@@ -48,7 +48,7 @@ teardown() {
4848
run docker run \
4949
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
5050
--label dockerbats="$BATS_TEST_NAME" \
51-
--log-opt journal-id=${JOURNAL_ID} \
51+
--log-opt journal-fqdn=${JOURNAL_ID}.journal.pl-waw-1.hyperone.cloud \
5252
--log-opt journal-token=${JOURNAL_TOKEN} \
5353
alpine sh -c "seq 100 | while read line; do echo \"multiple-\${line}-${token}\"; done;";
5454
[ "$status" -eq 0 ]
@@ -64,15 +64,15 @@ teardown() {
6464
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
6565
--label dockerbats="$BATS_TEST_NAME" \
6666
alpine id;
67-
[[ $output =~ "Missing 'journal-id option of log driver." ]]
67+
[[ $output =~ "Missing 'journal-fqdn option of log driver." ]]
6868
[ "$status" -eq 125 ]
6969
}
7070

7171
@test "plugin validate token" {
7272
run docker run -d \
7373
--log-driver 'h1cr.io/h1-docker-logging-plugin:latest' \
7474
--label dockerbats="$BATS_TEST_NAME" \
75-
--log-opt journal-id="${JOURNAL_ID}" \
75+
--log-opt journal-fqdn=${JOURNAL_ID}.journal.pl-waw-1.hyperone.cloud \
7676
--log-opt journal-token="invalid token" \
7777
alpine id;
7878
[[ $output =~ "Invalid journal-token." ]]

0 commit comments

Comments
 (0)