From 110eb1173c2a4de9f6c92d2eefd3ace5b0c03c18 Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Thu, 4 Jun 2020 01:01:00 +0200 Subject: [PATCH] adding some examples to the readme --- Readme.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Readme.md b/Readme.md index 3960538..abf78aa 100644 --- a/Readme.md +++ b/Readme.md @@ -39,6 +39,39 @@ Usage of ./bin/kubeconform: print results for all resources ``` +### Usage examples + +* Validating a single, valid file +``` +$ ./bin/kubeconform -file fixtures/valid.yaml +$ echo $? +0 +``` + +* Validating a single invalid file, setting output to json, and printing a summary +``` +$ ./bin/kubeconform -file fixtures/invalid.yaml -summary -output json +{ + "resources": [ + { + "filename": "fixtures/invalid.yaml", + "kind": "ReplicationController", + "version": "v1", + "status": "INVALID", + "msg": "Additional property templates is not allowed - Invalid type. Expected: [integer,null], given: string" + } + ], + "summary": { + "valid": 0, + "invalid": 1, + "errors": 0, + "skipped": 0 + } +} +$ echo $? +1 +``` + ### Credits * @garethr for the [Kubeval](https://github.com/instrumenta/kubeval) and