fix: docker examples, container output, misc lint
This commit is contained in:
parent
a2b42e4e46
commit
670e45a9d0
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue