Skip to content

[FEATURE_REQUEST] Add support for using a non-default clientSchema #141

@aiyengar2

Description

@aiyengar2

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions