-
Notifications
You must be signed in to change notification settings - Fork 249
Description
Description of the problem/feature request
A clear and concise description of the problem, or the proposed new feature.
Currently, the scheme used to unmarshall the JSON objects from the manifest is hard-coded to scheme.Scheme
here:
kube-linter/pkg/lintcontext/parse_yaml.go
Line 33 in a64df58
clientSchema = scheme.Scheme |
This scheme is used to deserialize the k8s manifests, so any valid k8s objects that are not recognized by the default scheme (e.g. CustomResources) are unable to be deserialized.
Instead, would it be possible to modify the function signature for CreateContexts
to optionally take in a *runtime.Scheme
?
func CreateContexts(filesOrDirs ...string) ([]LintContext, error) { |
From a CLI context, this would probably be set to nil
or scheme.Scheme
, but this would be helpful for other packages consuming this code.
Additional context
Probably a followup for #119.
I've been trying to consume kube-linter to create a Helm chart testing framework and I hope to upstream it at some point. Making a one-line change to the code linked above seems to be the only blocker, but if this issue is resolved I can go back to consuming upstream directly instead of forking.