Commit graph

137 commits

Author SHA1 Message Date
John-Michael Mulesa
5cbbd1a898
Upgrade hash to sha256. (#126) 2022-09-02 10:28:07 +02:00
hadar-co
5e63bc5ad7
add {{ .Group }} variable to schema location options (#120) 2022-07-16 14:13:17 +02:00
Bill Franklin
9a6fff13cb
Forbid duplicate keys in strict mode (#121)
* Forbid duplicate keys in strict mode

Prevents specifying duplicate keys using
UnmarshallStrict: https://pkg.go.dev/gopkg.in/yaml.v2#UnmarshalStrict

* Add acceptance tests for duplicated properties
2022-07-15 14:23:10 +02:00
Calle Pettersson
7bf1e01dec
fix: change flag parse error handling to return errors instead of exiting (#107)
* fix: change flag parse error handling to return errors instead of exiting

Having ExitOnError in combination with SetOutput to a buffer instead of
stdout/stderr means flags.Parse output is swallowed and kubeconform silently
exits directly with exit code 2 instead of returning the error.

Setting ContinueOnError instead returns the error, and writes usage help to
the buffer, so error handling code in main is reached.

* Add test for parsing incorrect flags

Co-authored-by: Yann Hamon <yann@mandragor.org>
2022-06-19 18:38:52 +02:00
Carlos Sanchez
932b35d71f
chore: print the url of failed download (#96) 2022-02-22 23:59:39 +01:00
Yann Hamon
85b30f8c2a
Improve handling of cmdline errors (#91)
Improve handling of cmdline errors
2022-01-06 12:39:24 +01:00
Maxime Brunet
ff2ab3d770
feat(output/tap): Output qualified resource name 2021-12-17 19:18:55 -08:00
z0mbix
c3e6205f15
Move version to main package 2021-11-16 17:19:54 +00:00
z0mbix
d63de52458
Add -v to output version number 2021-11-16 15:30:33 +00:00
Yann Hamon
ab4745ddf0 Small clean-up 2021-09-26 22:55:01 +02:00
Yann Hamon
b5c823d6b5 Also read up to 256MB from stdin 2021-09-26 17:45:27 +02:00
Yann Hamon
8bb87b9a63 Allow bufio.Scanner to resize buffer when reading large files 2021-09-26 17:27:20 +02:00
Yann Hamon
4e83800979 gofmt 2021-09-26 11:58:09 +02:00
Christian Brauchli
dee75355d0 FIX: enable http_proxy environment variable 2021-09-17 09:32:36 +02:00
Yann Hamon
2eefa7fc22 Update Junit tests, fix #45 2021-08-29 12:57:25 +02:00
Victor Cardenas
44b7ba9aef Properly handle successful http requests to registries sending invalid schema responses 2021-08-03 19:46:18 -04:00
Yann Hamon
53a1689bac Fix unit tests 2021-07-11 22:57:20 +02:00
Yann Hamon
3a697f3ce2 validate against master by default, not 1.18.0 2021-07-11 22:53:23 +02:00
Yann Hamon
df386fc1fd Reformat strings 2021-07-03 16:01:51 +02:00
Yann Hamon
4eb75860d9 support for lists 2021-07-03 15:49:37 +02:00
Yann Hamon
77682c3142 fix junit test 2021-03-30 15:31:42 +02:00
Cameron Villers
e6e9eb8698 Add jUnit XML output formatter 2021-03-28 21:49:59 -04:00
Yann Hamon
b10927a052 Update Readme, add 'default' value for -schema-location parameter 2021-02-27 16:37:24 +01:00
Christoph Mertz
65968cf540 remove gosimple offences 2021-02-19 17:01:54 +01:00
Yann Hamon
61e708277d Use a custom, more up-to-date fork of kubernetes-json-schema by default 2021-01-24 01:17:35 +01:00
Yann Hamon
d53c2e9913 update config test 2021-01-02 14:22:45 +01:00
Yann Hamon
c1f0e9010d add tests for yaml scanning 2021-01-02 14:06:13 +01:00
Yann Hamon
92f8f4593d break down FromFiles for easier testing 2021-01-02 12:52:58 +01:00
Yann Hamon
f7a9c86717 Add / update a few tests 2021-01-02 12:32:12 +01:00
Yann Hamon
128fcf993b fail early when cache folder does not exist 2021-01-02 11:57:52 +01:00
Yann Hamon
18927ddf75 cache schemas downloaded over HTTP 2021-01-01 15:49:18 +01:00
Yann Hamon
1a76217195 fix - do try following schema registries when schema not found in local registry 2020-12-29 19:16:28 +01:00
Yann Hamon
9a56fc4176 Indicate field on validation error 2020-12-28 13:03:36 +01:00
Yann Hamon
509ad8e997 add test for missing apiVersion - better error message 2020-12-23 18:25:46 +01:00
Yann Hamon
031f83cbde linting 2020-12-15 22:20:02 +01:00
Yann Hamon
0bbee68c49 update verbose desc 2020-12-15 22:12:41 +01:00
Yann Hamon
69e2fc8ba9 Add TAP header 2020-12-15 22:09:07 +01:00
Yann Hamon
07dec90112 tap plan can be at the end, that way we can stream the output and not buffer 2020-12-15 21:54:44 +01:00
Yann Hamon
c5aa8e6da3 fix closing files 2020-12-15 19:36:22 +01:00
Yann Hamon
29a8f4c09e avoid double unmarshalling 2020-12-15 18:35:33 +01:00
Yann Hamon
4afe9b1977 reduce allocations done when splitting 2020-12-15 17:04:44 +01:00
Yann Hamon
11a3e8f64f add cpu profiling 2020-12-15 16:27:25 +01:00
Yann Hamon
a71d1eb59b
Merge pull request #18 from yannh/add-tap-support
Add tap support
2020-12-15 13:26:26 +01:00
Yann Hamon
8c6e855239 support tap output 2020-12-15 13:22:52 +01:00
Yann Hamon
43b5c5c152 add tests to DownloadSchema 2020-11-29 16:09:12 +01:00
Yann Hamon
f63d329742 throw error when file with key/values is missing a Kind, add acc test 2020-11-15 23:44:15 +01:00
Yann Hamon
cafdb09f6f comment 2020-11-15 20:25:16 +01:00
Yann Hamon
651d3b2c50 fail early when a broken -schema-location template is given 2020-11-15 20:23:37 +01:00
Yann Hamon
905f5e7417 set max resource size 2020-11-15 17:08:45 +01:00
Yann Hamon
7d9bb98a35 increase max size of k8s resource 2020-11-15 17:05:11 +01:00