Commit graph

403 commits

Author SHA1 Message Date
Emil Thorenfeldt
104d436f46
Merge 5dcb6cfa3b into e60892483e 2025-10-13 13:10:07 +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
Emil Thorenfeldt
5dcb6cfa3b
Merge pull request #1 from cyrgim/fix-schema-matching
Fix schema matching for custom schema files without kind constraints
2025-08-08 15:31:13 +02:00
cyrgim
cda284dac5 Fix schema matching for custom schema files without kind constraints
When using multiple custom schema locations with direct JSON files,
kubeconform incorrectly applied the first schema to all resources.
This occurred because schemas without explicit kind constraints
(enum/const values) would match any resource type.

Added intelligent path-based matching for schemas without kind
constraints, allowing proper validation of resources like SecretStore
against their intended schemas rather than defaulting to the first
available schema.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 09:44:05 +02:00
Emil Thorenfeldt
5582d069a8 Fix schema matching when using multiple schema locations
When multiple schema locations are provided, ensure each resource
is validated against the correct schema by checking if the schema's
kind constraints match the expected resource type.

Fixes #299

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 14:13:15 +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
Yann Hamon
8bc9f42f39
Add support for "pretty" output (#195)
* feat: add pretty output format

---------

Co-authored-by: William Yardley <wyardley@users.noreply.github.com>
2023-04-22 18:41:51 +02:00
Mateusz Łoskot
9294e94a8d
docs: Add winget as installation method on Windows (#192)
The kubeconform package has been accepted to winget,
see https://github.com/microsoft/winget-pkgs/pull/101691
2023-04-13 09:56:49 +02:00
Benjamin Muschko
16d52804d4
Fix CI badge image (#184)
I guess the name of the CI build has been changed which led to a broken image.
2023-03-28 18:53:49 +02:00
Aleksey Levenstein
e3bb34851d
fix: expose error instance path instead of schema path (#177) 2023-02-27 16:16:00 +01:00
w7089
aaecabe0b7
support disabling ssl validation in openapi2jsonschema.py (#167)
* support disabling ssl validation in openapi2jsonschema.py
* added acceptance tests for disable ssl feature
* speed up bats docker build
2023-02-26 12:33:54 +01:00