mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 04:32:16 -05:00
ignore kustomize file with kubeval
currently, kubeval doesn't support kustomize file so kubeval returns a false-positive about a missing `metadata` key: ``` 2020-10-09 06:19:19 [ERROR ] Found errors in [kubeval] linter! 2020-10-09 06:19:19 [ERROR ] [ERR - .../kustomization.yml: Missing 'metadata' key] 2020-10-09 06:19:19 [ERROR ] Linter CMD:[kubeval --strict .../kustomization.yml] ```
This commit is contained in:
parent
2e126e59e2
commit
d975791bb9
1 changed files with 5 additions and 0 deletions
|
@ -559,6 +559,11 @@ DetectKubernetesFile() {
|
|||
FILE="${1}" # File that we need to validate
|
||||
debug "Checking if ${FILE} is a Kubernetes descriptor..."
|
||||
|
||||
if grep -q -E 'apiVersion:\s*kustomize.config.k8s.io' "${FILE}" >/dev/null; then
|
||||
debug "${FILE} is NOT a Kubernetes descriptor (Kustomize only)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if grep -q -E '(apiVersion):' "${FILE}" >/dev/null; then
|
||||
debug "${FILE} is a Kubernetes descriptor"
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue