yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.15k stars 121 forks source link

Enabling Validate for already unmarshalled yaml files and taking in a file system for the schema location #194

Closed jessefeinman closed 1 year ago

jessefeinman commented 1 year ago

I'm trying to validate k8s yaml files and want to take advantage of kubeconform to do this, however the files are already parsed.

I'm interested in making a few changes and pushing them upstream here:

Specifically, I want to split the validation code so that you can pass in an unmarshalled yaml map[string]interface{} to validate against. The existing validation method would then defer to that.

Modify Registry to take in a FileSystem instead of working on the OS, this allows for an embedded file system like embed to hold the schemas instead of needing to explicitly pass the json files around.

I put together these changes locally to satisfy our use case but want to get a thumbs up before polishing them and upstreaming them.