Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Helm Chart linting #11108

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,10 @@ repos:
language: system
files: ^.pre-commit-config.yaml$|^INTHEWILD.md$
require_serial: true
- id: helm-lint
name: Lint Helm Chart
entry: ./scripts/ci/pre_commit/pre_commit_helm_lint.sh
language: system
pass_filenames: false
files: ^chart
require_serial: true
14 changes: 7 additions & 7 deletions BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1815,13 +1815,13 @@ This is the current syntax for `./breeze <./breeze>`_:
check-executables-have-shebangs check-hooks-apply check-integrations
check-merge-conflict check-xml consistent-pylint daysago-import-check
debug-statements detect-private-key doctoc dont-use-safe-filter end-of-file-fixer
fix-encoding-pragma flake8 forbid-tabs incorrect-use-of-LoggingMixin insert-license
isort language-matters lint-dockerfile lint-openapi mermaid mixed-line-ending mypy
no-relative-imports pre-commit-descriptions provide-create-sessions pydevd
pydocstyle pylint pylint-tests python-no-log-warn restrict-start_date rst-backticks
setup-order shellcheck sort-in-the-wild stylelint trailing-whitespace
update-breeze-file update-extras update-local-yml-file update-setup-cfg-file
yamllint
fix-encoding-pragma flake8 forbid-tabs helm-lint incorrect-use-of-LoggingMixin
insert-license isort language-matters lint-dockerfile lint-openapi mermaid
mixed-line-ending mypy no-relative-imports pre-commit-descriptions
provide-create-sessions pydevd pydocstyle pylint pylint-tests python-no-log-warn
restrict-start_date rst-backticks setup-order shellcheck sort-in-the-wild stylelint
trailing-whitespace update-breeze-file update-extras update-local-yml-file
update-setup-cfg-file yamllint

You can pass extra arguments including options to to the pre-commit framework as
<EXTRA_ARGS> passed after --. For example:
Expand Down
2 changes: 2 additions & 0 deletions STATIC_CODE_CHECKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ require Breeze Docker images to be installed locally:
----------------------------------- ---------------------------------------------------------------- ------------
``forbid-tabs`` Fails if tabs are used in the project.
----------------------------------- ---------------------------------------------------------------- ------------
``helm-lint`` Verifies if helm lint passes for the chart
----------------------------------- ---------------------------------------------------------------- ------------
``incorrect-use-of-LoggingMixin`` Checks if LoggingMixin is properly imported.
----------------------------------- ---------------------------------------------------------------- ------------
``insert-license`` Adds licenses for most file types.
Expand Down
1 change: 1 addition & 0 deletions breeze-complete
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ end-of-file-fixer
fix-encoding-pragma
flake8
forbid-tabs
helm-lint
incorrect-use-of-LoggingMixin
insert-license
isort
Expand Down
24 changes: 24 additions & 0 deletions scripts/ci/pre_commit/pre_commit_helm_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
export REMEMBER_LAST_ANSWER="true"
export PRINT_INFO_FROM_SCRIPTS="false"
export SKIP_CHECK_REMOTE_IMAGE="true"


# shellcheck source=scripts/ci/static_checks/lint_dockerfile.sh
. "$( dirname "${BASH_SOURCE[0]}" )/../static_checks/helm_lint.sh" "${@}"
28 changes: 28 additions & 0 deletions scripts/ci/static_checks/helm_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# shellcheck source=scripts/ci/libraries/_script_init.sh
. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"

function run_helm_lint() {
kind::make_sure_kubernetes_tools_are_installed

cd "${AIRFLOW_SOURCES}/chart" || exit 1
helm lint . -f values.yaml
}

run_helm_lint