Commit graph

156 commits

Author SHA1 Message Date
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
Yann Hamon
b33767a477 fix acc tests 2020-11-15 16:24:27 +01:00
Yann Hamon
4ae74305d1 Updated names for schema-location vars, added documentation, updated openapi2jsonschema 2020-11-15 16:19:49 +01:00
Yann Hamon
300b571c33 linting / refactor 2020-11-15 12:12:37 +01:00
Yann Hamon
22e82c4922 Properly close streams after processing them 2020-11-15 10:19:09 +01:00
Yann Hamon
4e96b44a8b Add example how to use kubeconform as a library 2020-11-15 10:01:36 +01:00
Yann Hamon
4672ded043 only expose interfac 2020-11-14 16:23:33 +01:00
Yann Hamon
9936e43d47 opts should not be a pointer 2020-11-14 15:57:39 +01:00
Yann Hamon
649c2ca4d6 refactor validator pkg so it can be usable in a third party app 2020-11-14 15:54:45 +01:00
Yann Hamon
94f8e9e631 fix race condition when shutting down 2020-11-11 22:50:59 +01:00
Yann Hamon
3a2d4705f5 better yaml splitting - not perfect but similar to k8s - fix path logging 2020-11-08 23:48:02 +01:00
Yann Hamon
d64a376779 do not buffer all of stdin before starting to process resources 2020-11-08 22:54:41 +01:00
Yann Hamon
4b16128b75 Add comments to most exported functions/types 2020-11-08 22:35:17 +01:00
Yann Hamon
f78b65b025 add -ignore-filename-pattern option 2020-11-08 19:57:01 +01:00
Yann Hamon
44710f9053 cache http client in http registry 2020-11-08 16:50:21 +01:00
Yann Hamon
9d7a79b253 renaming 2020-11-08 16:46:01 +01:00
Yann Hamon
207371cbc2 fix behaviour when passing erroneous flags 2020-11-08 16:33:31 +01:00
Yann Hamon
49ad2fc375 make http part of registry class 2020-11-08 16:25:45 +01:00
Yann Hamon
45040c3fe2 rename HTTP error 2020-11-08 16:21:48 +01:00
Yann Hamon
ec56304efd add -insecure-skip-tls-verify 2020-11-08 13:06:21 +01:00
Yann Hamon
b162c5b6f5 Add support for -reject and update README 2020-11-08 10:36:53 +01:00
Yann Hamon
358f145023 Add support for -exit-on-error 2020-11-08 10:08:14 +01:00
Yann Hamon
dfb80055fe use different pattern for processResults 2020-11-02 00:23:03 +01:00
Yann Hamon
81c097f1bb add back json output tests 2020-11-02 00:03:03 +01:00
Yann Hamon
1b4bc79841 add back text output tests cases 2020-11-01 23:57:44 +01:00
Yann Hamon
99bc85d016 rename signature.go -> resource.go 2020-11-01 23:32:52 +01:00
Yann Hamon
6911b9cf30 Add another flags parsing test to validate all flags 2020-11-01 23:29:50 +01:00
Yann Hamon
0152d8c209 add tests for command line parsing 2020-11-01 23:18:39 +01:00
Yann Hamon
51e5f38430 Add unit tests for reading resources from an io.Reader 2020-11-01 22:41:18 +01:00
Yann Hamon
423b9536da Refactor resource discovery 2020-11-01 20:10:03 +01:00
Yann Hamon
0a7f885768 Refactor resource discovery 2020-11-01 20:09:48 +01:00
Yann Hamon
2391d82281 Factor out isYaml 2020-11-01 16:50:16 +01:00
Yann Hamon
0c22457919 refactor 2020-11-01 16:35:38 +01:00
Yann Hamon
1bc9283240 refactor 2020-11-01 16:28:32 +01:00
Yann Hamon
939b44e3ca remove last mentions of flag in main 2020-10-31 16:09:53 +01:00
Yann Hamon
5bd09a483e move flag handling to pkg 2020-10-31 15:47:34 +01:00
Yann Hamon
ea8ecafa38 refactor output 2020-10-31 14:29:13 +01:00
Yann Hamon
7402d0fed8 Add support for passing manifests via stdin 2020-10-31 14:02:15 +01:00
Yann Hamon
b3b16ceccc Improve help 2020-10-18 19:43:43 +02:00
Yann Hamon
490c789632
Merge pull request #7 from cmertz/reorder-imports
reorder imports
2020-10-18 14:10:22 +02:00
Yann Hamon
9dda2ff599 more acceptance tests 2020-10-18 14:04:23 +02:00
Yann Hamon
51732e6a21 count empty files in the number of parsed files in text output 2020-10-18 13:52:40 +02:00
Yann Hamon
54d899f8f6 add more acceptance tests 2020-10-18 13:13:37 +02:00
Yann Hamon
5920cccf07 fine-tune text logging 2020-10-18 12:57:17 +02:00
Yann Hamon
52437c00d1 Add resource name to logging 2020-10-18 12:50:52 +02:00
Christoph Mertz
0cffc7994d reorder imports
Reorder imports with `goimports`.
2020-10-18 11:30:20 +02:00
Yann Hamon
b4995aa02c Support for CRDs 2020-10-17 15:35:41 +02:00
Yann Hamon
59c23325d3 replace -schema with -local-registry 2020-06-07 18:59:03 +02:00
Yann Hamon
d9a6468d09 add a few comments on exported vars 2020-06-06 18:42:44 +02:00
Yann Hamon
cdcacb080d more unit tests 2020-06-06 16:32:27 +02:00
Yann Hamon
8fed078b9e support schemas in YAML, added acceptance tests for parsing custom resources 2020-06-05 00:51:35 +02:00
Yann Hamon
7bfb0b51f1 Display number of files / resources in text output 2020-06-04 23:59:50 +02:00
Yann Hamon
f64ecad867 Add comments on some exported resources 2020-06-04 00:51:36 +02:00
Yann Hamon
90e53c74d0 rename package files 2020-06-01 23:32:20 +02:00
Yann Hamon
42e5fd0c43 output write/flush return an error 2020-06-01 23:17:06 +02:00
Yann Hamon
dba9f97c1a add tests for text output, small fix 2020-06-01 23:09:31 +02:00
Yann Hamon
c3a25b9689 fix json output 2020-06-01 19:15:12 +02:00
Yann Hamon
f718b2c919 first simple test for json output 2020-06-01 19:09:53 +02:00
Yann Hamon
9b129d021a loggers take an io.writer 2020-06-01 17:15:52 +02:00
Yann Hamon
1f019066c7 -verbose instead of -quiet, -quiet seems a better default 2020-06-01 12:59:46 +02:00
Yann Hamon
0ddf4e9a50 more nits 2020-06-01 12:44:59 +02:00
Yann Hamon
5ff2d1a037 minor nits 2020-06-01 12:24:45 +02:00
Yann Hamon
8fc1df8d8b minor nits 2020-06-01 12:20:15 +02:00
Yann Hamon
742d8cdf7e bugfixes 2020-06-01 05:08:45 +02:00
Yann Hamon
a33ba035fa first test 2020-06-01 04:53:37 +02:00
Yann Hamon
c4bd7d0668 some linting simplifications 2020-05-31 19:29:30 +02:00
Yann Hamon
93f7dbc83a remove comment - files with multiple resources are now supported 2020-05-31 17:09:52 +02:00
Yann Hamon
d94b0abf64 make logging non-concurrent, remove mutexes from output pkg 2020-05-31 17:03:02 +02:00
Yann Hamon
05da409a0a Support multi-resource files, include kind/version in logging 2020-05-31 16:47:30 +02:00
Yann Hamon
a1c2e9dc68 fix format string 2020-05-31 14:56:10 +02:00
Yann Hamon
c6526d7278 Default to non-strict 2020-05-31 04:36:29 +02:00
Yann Hamon
11cfca1498 Better logging messages 2020-05-31 04:27:18 +02:00
Yann Hamon
ae5fbffb95 add quiet mode, fix race condition in statistics 2020-05-31 03:48:38 +02:00
Yann Hamon
b918da9c59 rework caching - less leak of goschema everywhere 2020-05-31 03:12:28 +02:00
Yann Hamon
8eb297d4c4 better logic mgmt in output plugins, go fmt 2020-05-31 02:10:19 +02:00
Yann Hamon
79d8ce3055 forgot to commit files 2020-05-31 01:09:53 +02:00
Yann Hamon
ef44c39ff2 be more explicit about caching of download failures 2020-05-31 01:09:05 +02:00
Yann Hamon
30a6fe69b1 cache Schema unmarshalling, cache schema download failures (WIP) 2020-05-30 21:40:54 +02:00
Yann Hamon
928d694e66 differentiate between an invalid resource and a validation error in output 2020-05-30 20:08:51 +02:00
Yann Hamon
bb478da7e0 enable printing a summary at the end of the run 2020-05-30 20:03:27 +02:00
Yann Hamon
5f3504724f add support for local schemas 2020-05-30 18:28:04 +02:00
Yann Hamon
8a25986e79 add configurable output 2020-05-30 17:20:24 +02:00