Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit415cc32

Browse files
authored
feat: add kubeconform (#7011)
Close#6967
1 parent18d7882 commit415cc32

21 files changed

+96
-4
lines changed

‎.github/dependabot.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ updates:
112112
-dart
113113
-powershell
114114
-composer/composer
115+
-yannh/kubeconform
115116
docker-base-images:
116117
applies-to:version-updates
117118
patterns:

‎.github/linters/.checkov.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ skip-path:
2323
-test/linters/dockerfile_hadolint
2424
-test/linters/jscpd
2525
-test/linters/json
26+
-test/linters/kubernetes_kubeconform
2627
-test/linters/openapi
2728
-test/linters/terraform_fmt
2829
-test/linters/terraform_tflint

‎.github/linters/trivy.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ scan:
1717
-"**/test/linters/dockerfile_hadolint"
1818
-"**/test/linters/go_modules"
1919
-"**/test/linters/jscpd"
20+
-"**/test/linters/kubernetes_kubeconform"
2021
-"**/test/linters/terraform_fmt"
2122
-"**/test/linters/terraform_terrascan"
2223
-"**/test/linters/terraform_tflint"

‎Dockerfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0.304-alpine3.21 AS dotnet-sdk
3131
FROM mcr.microsoft.com/powershell:7.5-alpine-3.20 AS powershell
3232
FROM composer/composer:2.8.11 AS php-composer
3333
FROM ghcr.io/aquasecurity/trivy:0.66.0 AS trivy
34+
FROM ghcr.io/yannh/kubeconform:v0.7.0 AS kubeconform
3435

3536
FROM python:3.13.7-alpine3.22 AS python-base
3637

@@ -372,6 +373,9 @@ RUN scalafmt --version | awk ' { print $2 }' > /tmp/scalafmt-version.txt
372373
######################
373374
COPY --from=actionlint /usr/local/bin/actionlint /usr/bin/
374375

376+
# Install kubeconform
377+
COPY --from=kubeconform /kubeconform /usr/bin/
378+
375379
#####################
376380
# Install clj-kondo #
377381
#####################

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ lint-subset-files-enable-expensive-io-checks: ## Lint a small subset of files in
266266
-e VALIDATE_ALL_CODEBASE=true\
267267
-e VALIDATE_ARM=true\
268268
-e VALIDATE_CLOUDFORMATION=true\
269+
-e VALIDATE_KUBERNETES_KUBECONFORM=true\
269270
-e VALIDATE_MARKDOWN=true\
270271
-e VALIDATE_OPENAPI=true\
271272
-e VALIDATE_STATES=true\

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Super-linter supports the following tools:
8585
|**JSONC**,**JSON5**|[eslint-plugin-jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc)|[Prettier](https://prettier.io/)|
8686
|**JSX**,**TSX**|[eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y),[eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)|[Prettier](https://prettier.io/)|
8787
|**Jupyter Notebook**|[nbqa](https://nbqa.readthedocs.io/en/latest/index.html)|[nbqa](https://nbqa.readthedocs.io/en/latest/index.html)|
88-
|**Kubernetes**|[Checkov](https://www.checkov.io/),[Trivy](https://trivy.dev/)| See YAML formatters|
88+
|**Kubernetes**|[Checkov](https://www.checkov.io/),[Trivy](https://trivy.dev/),[kubeconform](https://github.com/yannh/kubeconform)| See YAML formatters|
8989
|**Kotlin**|[ktlint](https://github.com/pinterest/ktlint)||
9090
|**LaTeX**|[ChkTex](https://www.nongnu.org/chktex/)||
9191
|**Licenses**|[Trivy](https://trivy.dev/)| N/A|
@@ -298,6 +298,7 @@ You can configure Super-linter using the following environment variables:
298298
|**JAVA_FILE_NAME**|`sun_checks.xml`| Filename for[Checkstyle configuration](https://checkstyle.sourceforge.io/config.html). Checkstyle embeds several configuration files, such as`sun_checks.xml`,`google_checks.xml` that you can use without providing your own configuration file.|
299299
|**JAVASCRIPT_ES_CONFIG_FILE**|`eslint.config.mjs`| Filename for[ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats)|
300300
|**JSCPD_CONFIG_FILE**|`.jscpd.json`| Filename for JSCPD configuration|
301+
|**KUBERNETES_KUBECONFORM_OPTIONS**| not set| Additional arguments to pass to the command-line when running Kubeconform (Example:`--ignore-missing-schemas`)|
301302
|**LINTER_RULES_PATH**|`.github/linters`| Directory for all linter configuration rules.|
302303
|**LOG_FILE**|`super-linter.log`| The filename for outputting logs. Super-linter saves the log file to`${DEFAULT_WORKSPACE}/${LOG_FILE}`.|
303304
|**LOG_LEVEL**|`INFO`| How much output the script will generate to the console. One of`ERROR`,`WARN`,`NOTICE`,`INFO`, or`DEBUG`.|
@@ -393,6 +394,7 @@ You can configure Super-linter using the following environment variables:
393394
|**VALIDATE_JUPYTER_NBQA_PYLINT**|`true`| Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa pylint)|
394395
|**VALIDATE_JUPYTER_NBQA_RUFF**|`true`| Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa ruff)|
395396
|**VALIDATE_KOTLIN**|`true`| Flag to enable or disable the linting process of the Kotlin language.|
397+
|**VALIDATE_KUBERNETES_KUBECONFORM**|`true`| Flag to enable or disable linting Kubernetes files using Kubeconform.|
396398
|**VALIDATE_LATEX**|`true`| Flag to enable or disable the linting process of the LaTeX language.|
397399
|**VALIDATE_LUA**|`true`| Flag to enable or disable the linting process of the language.|
398400
|**VALIDATE_MARKDOWN**|`true`| Flag to enable or disable the linting process of the Markdown language.|

‎docs/upgrade-guide.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
This document helps you upgrade from a super-linter version to newer ones:
44

5+
-[Upgrade from v8.1.0 to v8.2.0](#upgrade-from-v810-to-v820)
56
-[Upgrade from v7.4.0 to v8.0.0](#upgrade-from-v740-to-v8)
67
-[Upgrade from v7.3.0 to v7.4.0](#upgrade-from-v730-to-v740)
78
-[Upgrade from v6 to v7](#upgrade-from-v6-to-v7)
89
-[Upgrade from v6.7.0 to v6.8.0](#upgrade-from-v670-to-v680)
910
-[Upgrade from v5 to v6](#upgrade-from-v5-to-v6)
1011

12+
##Upgrade from v8.1.0 to v8.2.0
13+
14+
Super-linter`v8.2.0` adds back Kubeconform and related configuration variables:
15+
16+
-`KUBERNETES_KUBECONFORM_OPTIONS`
17+
-`VALIDATE_KUBERNETES_KUBECONFORM`
18+
1119
##Upgrade from v7.4.0 to v8
1220

1321
This section helps you upgrade from super-linter`v7.4.0` to`v8.0.0`.

‎lib/functions/buildFileList.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,10 @@ BuildFileArrays() {
616616
if DetectOpenAPIFile"${FILE}";then
617617
echo"${FILE}">>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-OPENAPI"
618618
fi
619+
620+
if DetectKubernetesFile"${FILE}";then
621+
echo"${FILE}">>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-KUBERNETES_KUBECONFORM"
622+
fi
619623
else
620624
CheckFileType"${FILE}"
621625
fi

‎lib/functions/detectFiles.sh‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ DetectCloudFormationFile() {
8787
DetectKubernetesFile() {
8888
FILE="${1}"
8989

90+
if ["${VALIDATE_KUBERNETES_KUBECONFORM}"=="false" ];then
91+
debug"Don't check if${FILE} is a Kubernetes file because VALIDATE_KUBERNETES_KUBECONFORM is:${VALIDATE_KUBERNETES_KUBECONFORM}"
92+
return 1
93+
fi
94+
9095
debug"Checking if${FILE} is a Kubernetes descriptor..."
9196
if grep -q -v'kustomize.config.k8s.io'"${FILE}"&&
9297
grep -q -E'(^apiVersion):'"${FILE}"&&

‎lib/functions/linterCommands.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ LINTER_COMMANDS_ARRAY_JSONC=(eslint -c "${JAVASCRIPT_ES_LINTER_RULES}")
214214
LINTER_COMMANDS_ARRAY_JSONC_PRETTIER=("${PRETTIER_COMMAND[@]}")
215215
LINTER_COMMANDS_ARRAY_JSX=(eslint -c"${JSX_LINTER_RULES}")
216216
LINTER_COMMANDS_ARRAY_JSX_PRETTIER=("${PRETTIER_COMMAND[@]}")
217+
LINTER_COMMANDS_ARRAY_KUBERNETES_KUBECONFORM=(kubeconform -strict)
218+
if [-n"${KUBERNETES_KUBECONFORM_OPTIONS:-}" ];then
219+
export KUBERNETES_KUBECONFORM_OPTIONS
220+
if! AddOptionsToCommand"LINTER_COMMANDS_ARRAY_KUBERNETES_KUBECONFORM""${KUBERNETES_KUBECONFORM_OPTIONS}";then
221+
fatal"Error while adding options to Kubeconform command"
222+
fi
223+
fi
217224
LINTER_COMMANDS_ARRAY_KOTLIN=(ktlint"{/}")
218225
LINTER_COMMANDS_ARRAY_LATEX=(chktex -q -l"${LATEX_LINTER_RULES}")
219226
LINTER_COMMANDS_ARRAY_LUA=(luacheck --config"${LUA_LINTER_RULES}")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp