mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 02:01:02 -05:00
Check for kind when detecting Kubernetes files (#2612)
* Check for kind when detecting Kubernetes files * Fix condition * Check conditions one by one * Formatting * Formatting
This commit is contained in:
parent
d7cefe279b
commit
f26ace31b9
1 changed files with 4 additions and 2 deletions
|
@ -181,8 +181,10 @@ DetectKubernetesFile() {
|
|||
################
|
||||
FILE="${1}" # File that we need to validate
|
||||
debug "Checking if ${FILE} is a Kubernetes descriptor..."
|
||||
|
||||
if grep -v 'kustomize.config.k8s.io' "${FILE}" | grep -v tekton | grep -q -E '(apiVersion):'; then
|
||||
if grep -q -v 'kustomize.config.k8s.io' "${FILE}" &&
|
||||
grep -q -v "tekton" "${FILE}" &&
|
||||
grep -q -E '(apiVersion):' "${FILE}" &&
|
||||
grep -q -E '(kind):' "${FILE}"; then
|
||||
debug "${FILE} is a Kubernetes descriptor"
|
||||
return 0
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue