From 670e45a9d06aeb0407cb589a36769cd5d2da9733 Mon Sep 17 00:00:00 2001 From: ssube Date: Tue, 25 Jun 2019 08:15:04 -0500 Subject: [PATCH] fix: docker examples, container output, misc lint --- README.md | 7 ++++--- docs/config-docker.yml | 4 ++-- src/index.ts | 10 +++++++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fa80fa0..7cc2aec 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ To run with Docker (**recommended**): `docker run --rm ssube/salty-dog:master` To download, validate, and apply a Kubernetes resource: ```shell -> curl https://raw.githubusercontent.com/ssube/k8s-shards/master/roles/apps/gitlab/server/templates/ingress.yml | salty-dog \ +> curl https://raw.githubusercontent.com/ssube/k8s-shards/master/roles/apps/gitlab/server/templates/ingress.yml |\ + salty-dog \ --rules rules/kubernetes.yml \ --source - \ --tag important | kubectl apply --dry-run -f - @@ -39,8 +40,8 @@ The latest semi-stable image is `ssube/salty-dog:master`. The Docker container is published for each branch and git tag, tagged with the version slug (`.` replaced with `-`, mostly). -Rules are baked into the image in `/rules`. To use custom rules, mount them with `-v $(pwd)/rules:/rules:ro` and -load with `--rules /rules/foo.yml`. +Rules are baked into the image in `/salty-dog/rules`. To use custom rules, mount them with +`-v $(pwd)/rules:/salty-dog/rules:ro` and load with `--rules /rules/foo.yml`. ### Check Mode diff --git a/docs/config-docker.yml b/docs/config-docker.yml index 301c126..7c2a00b 100644 --- a/docs/config-docker.yml +++ b/docs/config-docker.yml @@ -3,7 +3,7 @@ data: level: info name: salty-dog streams: - - level: warn - path: !stream stderr + - level: info + stream: !stream stderr - level: info path: /tmp/salty-dog.log diff --git a/src/index.ts b/src/index.ts index f34c98e..c6f2c2e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,7 +118,7 @@ export async function main(argv: Array): Promise { const activeRules = await resolveRules(rules, args as any); if (args.mode === 'list') { - logger.info({rules: activeRules}, 'listing active rules'); + logger.info({ rules: activeRules }, 'listing active rules'); return STATUS_SUCCESS; } @@ -136,11 +136,15 @@ export async function main(argv: Array): Promise { } else { const itemDiff = diff(item, itemCopy); if (Array.isArray(itemDiff) && itemDiff.length > 0) { - logger.info({ diff: itemDiff, item, rule }, 'rule passed with modifications'); + logger.info({ + diff: itemDiff, + item, + rule: rule.name, + }, 'rule passed with modifications'); applyDiff(item, itemCopy); } else { - logger.info({ rule }, 'rule passed'); + logger.info({ rule: rule.name }, 'rule passed'); } } }