yaml-language-server
yaml-language-server copied to clipboard
Can´t ignore, disable or change schema for certain files - kustomization yaml patches in this case
Describe the bug
Can´t ignore / disable or change the schema for validation on certain files. In this case it´s a kustomization patch file. It wants to validate to the kubernetes schema, therefore complains that the .yaml patch file doesn´t match the expectations.
Example
patch.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
spec:
replicas: 1
Possible solution
I could see a solution that configuring settings.json would ignore or at least change the validation schema following a glob pattern. Example:
{
"yaml.schemas": {
"https://json.schemastore.org/yamllint.json": "**/patch.yaml",
}
}
Or
{
"yaml.schemas": {
"ignore": "**/patch.yaml",
}
}
Expected Behavior
Different schema to validate against, or disable altogether.
Current Behavior
Everything gets validated according to kubernetes if it sees kubernetes stuff inside the yamls.
Steps to Reproduce
- Create a patch.yaml
- Use the previously attached code
- Observe the problems in VSCode
Environment
- [x ] Windows
- [ ] Mac
- [ ] Linux
- [ ] other (please specify)
Everything gets validated according to kubernetes if it sees kubernetes stuff inside the yamls.
Do you have vscode-kubernetes-tools or some other kubernetes related extension installed in VSCode? As far as I can remember in this extension we don't do any automatic schema matching for kubernetes you have to set everything manually. Whereas vscode-kubernetes-tools looks to see if the content looks like kubernetes yaml and if it is then applies the schemas itself
Do you have vscode-kubernetes-tools or some other kubernetes related extension installed in VSCode?
Yes, as a matter of fact I do. I guess more people should have problems with this. Guess it's not the scope of this VSCode Extension.
Closing as this is on the purview of vscode-kubernetes-tools