1
0
Fork 0

fix: docker examples, container output, misc lint

This commit is contained in:
ssube 2019-06-25 08:15:04 -05:00
parent a2b42e4e46
commit 670e45a9d0
3 changed files with 13 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -118,7 +118,7 @@ export async function main(argv: Array<string>): Promise<number> {
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<string>): Promise<number> {
} 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');
}
}
}