mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-28 19:50:59 -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
|
FILE="${1}" # File that we need to validate
|
||||||
debug "Checking if ${FILE} is a Kubernetes descriptor..."
|
debug "Checking if ${FILE} is a Kubernetes descriptor..."
|
||||||
|
if grep -q -v 'kustomize.config.k8s.io' "${FILE}" &&
|
||||||
if grep -v 'kustomize.config.k8s.io' "${FILE}" | grep -v tekton | grep -q -E '(apiVersion):'; then
|
grep -q -v "tekton" "${FILE}" &&
|
||||||
|
grep -q -E '(apiVersion):' "${FILE}" &&
|
||||||
|
grep -q -E '(kind):' "${FILE}"; then
|
||||||
debug "${FILE} is a Kubernetes descriptor"
|
debug "${FILE} is a Kubernetes descriptor"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue