Nikolai Emil Damm
d3ae574bf2
fix: copy scanner bytes in FromStream to prevent aliasing data race
...
FromStream set each Resource's Bytes to scanner.Bytes(), which aliases
the bufio.Scanner's internal buffer. Resources are emitted on a channel
and retained/parsed by the consumer concurrently with the producer
goroutine; when the scanner refills its buffer for later documents it
overwrites the slices earlier Resources still point at. Consumers that
parse resources as they arrive (e.g. ValidateWithContext) then read
corrupted bytes — a later document spliced into the one being parsed —
surfacing as non-deterministic YAML parse errors on large multi-document
streams (a different resource fails on each run).
Clone the scanner bytes so each Resource owns its slice. Adds a
regression test that streams >4MB (forcing the scanner to refill) and
asserts every resource's bytes are intact after draining.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 02:50:27 +02:00
Mattias Bengtsson
05632000e1
openapi2jsonschema-go: Delete binary ( #361 )
...
ci / kubeconform-test (push) Has been cancelled
ci / openapi2jsonschema-go-test (push) Has been cancelled
ci / goreleaser (push) Has been cancelled
Delete `openapi2jsonschema-go` binary (probably) commited by mistake in
b83bf792b2 .
2026-06-13 13:53:22 +02:00
Yann Hamon
02374e583d
Update README ( #360 )
ci / kubeconform-test (push) Has been cancelled
ci / openapi2jsonschema-go-test (push) Has been cancelled
ci / goreleaser (push) Has been cancelled
2026-06-04 22:02:50 +02:00
Yann Hamon
1f6792c093
Small fixes, better sanitization ( #359 )
2026-06-04 21:55:22 +02:00
Daiki Nishikawa
e5c533b154
fix: update duration validation to use strfmt package ( #348 )
2026-06-04 21:40:42 +02:00
Yann Hamon
ab97ec7693
Update deps, make sure we use vendored dependencies ( #358 )
2026-06-04 21:32:04 +02:00
Yann Hamon
b83bf792b2
Openapi2jsonschema-go ( #357 )
...
* Go implementation of openapi2jsonschema
* Add go version of openapi2jsonschema to container
2026-06-04 21:17:41 +02:00
somaz
8e634e18c0
fix: avoid panic when a schema document decodes to null ( #356 )
ci / kubeconform-test (push) Waiting to run
ci / openapi2jsonschema-test (push) Waiting to run
ci / goreleaser (push) Blocked by required conditions
2026-06-04 09:40:54 +02:00
Yann Hamon
d412494432
Read resources from multiple workers ( #354 )
ci / kubeconform-test (push) Has been cancelled
ci / openapi2jsonschema-test (push) Has been cancelled
ci / goreleaser (push) Has been cancelled
2026-06-01 12:56:27 +02:00
Tomasz Janiszewski
e60892483e
Fix typo ( #339 )
2025-10-13 12:36:27 +02:00
George Gaál
c7f8490e52
fix: Github -> GitHub ( #340 )
...
Signed-off-by: George Gaál <gb12335@gmail.com>
2025-10-13 12:36:06 +02:00
Yann Hamon
e65429b1e5
Add support for duration ( #328 )
...
* Add custom validation logic for durations
2025-05-12 11:15:53 +02:00
Yann Hamon
a23275d5ca
Invalid JSON should not be considered an error - see https://github.com/yannh/kubeconform/issues/67 ( #327 )
2025-05-12 10:21:02 +02:00
Yann Hamon
3134f4477e
Add acceptance tests for caching of references ( #326 )
2025-05-12 08:14:28 +02:00
Yann Hamon
9f04fec268
Add tests for the HTTP loader ( #325 )
...
Add another test case, remove accidental double memory caching
2025-05-11 04:13:07 +02:00
Yann Hamon
31e9679c96
Update jsonschema library to v6 ( #324 )
2025-05-11 02:05:01 +02:00
Yann Hamon
df26febc54
Update go/goreleaser ( #322 )
2025-05-10 18:20:42 +02:00
Yann Hamon
1bd44986dd
Update some dependencies ( #283 )
2024-07-30 23:34:40 +02:00
Yann Hamon
43a2445cb4
Retry ( #282 )
...
* fix: use hashicorp/go-retryablehttp to retry failed schema downloads
---------
Co-authored-by: Carlos Sanchez <carlos@apache.org>
2024-07-30 23:22:45 +02:00
Yann Hamon
706cd56e87
Revert "fix: retry on download errors ( #274 )" ( #279 )
...
This reverts commit 50ce5f8ecb .
2024-07-29 10:37:43 +02:00
Carlos Sanchez
50ce5f8ecb
fix: retry on download errors ( #274 )
...
* Retry on download errors
---------
Co-authored-by: Yann Hamon <yann@mandragor.org>
2024-07-29 10:10:44 +02:00
guoguangwu
347cd5e4c9
fix: close resource ( #272 )
2024-06-30 15:15:53 +02:00
Yann Hamon
142517fc45
fix go.mod
2024-05-09 23:48:09 +02:00
Yann Hamon
7062384492
Slightly improve the coverage of the validator test ( #271 )
2024-05-09 16:37:20 +02:00
Michael Lee
20805f652c
Stop validating output of closed channel in Validate ( #265 )
...
Currently, Validate and ValidateWithContext always returns a
result with status `Empty` and a `missing 'kind' key` error as
the final item in the returned slice.
This is because ValidateWithContext currently will parse the output of
`resourcesChan`, even when the context is finished and we get back
a default `Resource` struct.
This PR modifies the code to skip validating this case.
2024-05-09 16:27:59 +02:00
Yann Hamon
9627dd185b
Update go version in go.mod ( #269 )
...
* Downgrade to latest version supported by goreleaser
2024-05-09 15:43:13 +02:00
Yann Hamon
14053aaa54
Update Go & Base images ( #268 )
...
* Update go and base images
2024-05-09 15:19:30 +02:00
Yann Hamon
71a59d74f2
Remove deprecated Maintainer tag in Dockerfile ( #267 )
2024-05-09 15:09:22 +02:00
PatDyn
ad166c7f0d
Sanitize csv strings ( #258 )
...
* Support spaces before/after commas when passing list of Kinds
2024-05-09 14:21:36 +02:00
David Ongaro
a8000fd445
Update kubeconform -h output ( #260 )
...
In particular, the `-output pretty` option is missing.
2024-02-02 22:17:49 +01:00
Yann Hamon
b6728f181c
Fix junit output, also ensure junit output is deterministic ( #253 )
2023-12-24 18:06:03 +01:00
Yann Hamon
a4d74ce7d2
Fail early on incorrect version of k8s ( #254 )
...
* Fail early on incorrect version of k8s
* fix tests
2023-12-24 18:05:04 +01:00
Yann Hamon
808e6d4aa5
Update GH actions and goreleaser ( #252 )
...
* Update GH actions and goreleaser
2023-12-24 14:26:09 +01:00
Yann Hamon
d8f00a3a30
Update Golang to 1.21.4 ( #245 )
2023-11-18 18:31:34 +01:00
Yann Hamon
6ae8c45bc1
openapi2jsonschema.py now correctly fails if no FILE is passed ( #244 )
...
* openapi2jsonschema.py now correctly fails if no FILE is passed
* Update acceptance tests
2023-11-18 18:08:18 +01:00
Lucien Boix
b7d7b4d0dc
Update Readme.md ( #232 )
...
* Update Readme.md
Just adding details for how to use the script command with args for the Gitlab CI usecase
* Update Readme.md
Good catch!
Co-authored-by: Yann Hamon <yannh@users.noreply.github.com>
---------
Co-authored-by: Yann Hamon <yannh@users.noreply.github.com>
2023-09-19 00:54:24 +02:00
Yann Hamon
2e50b79b16
Update Go and Goreleaser to 1.20, update dependencies ( #231 )
2023-09-04 00:11:25 +02:00
Yann Hamon
13a78ebad8
Avoid unnecessary type conversions ( #222 )
2023-07-16 10:27:26 +02:00
Yann Hamon
ae67bb4709
Force Draft version of JsonSchema ( #221 )
...
* Force Draft version of JsonSchema
* Add test validating using CRD that misses explicit draft version
2023-07-16 09:42:11 +02:00
Yamamoto, Hirotaka
278385f4c9
Update Readme.md to add fullgroup explanation ( #220 )
...
This is a follow-up to #219 to add a short description on how to use the `fullgroup` variable.
2023-07-09 13:46:12 +02:00
Yamamoto, Hirotaka
452f1fe1db
Fix #130 in a backward-compatible way ( #219 )
...
This is an alternative way to fix #130 .
Instead of changing the `group` variable content, this commit adds
a new variable `fullgroup` that does not split the group components.
With this, users can specify the filename format like:
FILENAME_FORMAT='{fullgroup}-{version}-{kind}'
2023-07-09 12:51:30 +02:00
Yann Hamon
f0a7d5203d
Update Readme.md
2023-06-26 14:48:15 +02:00
Will Yardley
71fd5f8386
fix: add missing output formats in error message ( #213 )
...
- Add missing 'junit' and 'pretty' output formats.
- Use quotes vs. backticks around command name
2023-06-14 22:41:51 +02:00
Denis N. Antonioli
c8bce62898
Fix for 196: Multi-architecture image ( #204 )
...
* 196: qemu
* 196: multi-arch; see also https://blog.devgenius.io/goreleaser-build-multi-arch-docker-images-8dd9a7903675
2023-06-07 12:26:22 +02:00
Juan Ignacio Donoso
065fad003f
Fix anchored link on Readme.md ( #205 )
...
The in page link to the CustomResourceDefinition (CRD) Support section is not working
2023-06-07 12:22:58 +02:00
Yann Hamon
c1a2c159de
Revert "Add support for Arm64 Docker images ( #201 )"
...
This reverts commit 65cfe7e16e .
2023-05-14 12:52:13 +02:00
Yann Hamon
65cfe7e16e
Add support for Arm64 Docker images ( #201 )
2023-05-14 12:51:53 +02:00
Yann Hamon
ce2f6de185
Move cfg parsing out of realmain, rename realmain to kubeconform
2023-04-23 14:34:25 +02:00
Yann Hamon
ad935b7e32
Add JSON/YAML annotations to Config struct
...
Co-authored-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com>
2023-04-23 13:55:09 +02:00
Yann Hamon
d038bf8840
Do not hardcode output stream in pkg/output
...
Co-authored-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com>
2023-04-23 13:39:43 +02:00