Skip to main content

pre-commit rules for Kubernetes related files

Project description

pre-commit-k8s

An additional hook that can be used as a hook with pre-commit to validate Kubernetes objects.

Current hooks:

  • kubernetes-secrets - check if secrets are pushed

Usage

Install pre-commit

pip install pre-commit

Setup the .pre-commit-config.yaml config file:

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/zwennesm/pre-commit-k8s
  rev: master
  hooks:
  - id: pre-commit-k8s
    entry: pre-commit-k8s

Install the pre-commit hooks:

pre-commit install

Local install

Alternatively pre-commit-k8s can be installed locally for testing.

pip install pre-commit-k8s

pre-commit-k8s expects a list of files to be passed to it:

➜ pre-commit-k8s LICENCE                                          
2020-12-07 14:50:06,636 - INFO - Validating the following rules:
2020-12-07 14:50:06,636 - INFO - ✓ Kubernetes Secret check
2020-12-07 14:50:06,636 - INFO - No validation errors found

Rules can also be excluded:

➜ pre-commit-k8s --exclude kubernetes-secrets kubernetes-secret.yaml 
2020-12-07 14:52:08,569 - WARNING - No rules activated to validate files
2020-12-07 14:52:08,569 - INFO - No validation errors found

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre-commit-k8s-0.0.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pre_commit_k8s-0.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pre-commit-k8s-0.0.3.tar.gz.

File metadata

  • Download URL: pre-commit-k8s-0.0.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for pre-commit-k8s-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6294475054834b5e378d876fd40b1a18ed5fc12cc265365e756a3541d2f769be
MD5 274be638a5b2554a22179c033e17b3f7
BLAKE2b-256 d3e7fcf8b82f45a520e6d649e0a6e73ce8686ba1478444f3b64dbed7073caf72

See more details on using hashes here.

Provenance

File details

Details for the file pre_commit_k8s-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pre_commit_k8s-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for pre_commit_k8s-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b80baf60ae464cdc0e6879156cc0d683cc08101bf4cca457ef94255ed23689fa
MD5 aa65927a132f3a4149ae9fc834844794
BLAKE2b-256 2aa21f2099fe29081c96e7d312ecaa164aa9c77c380a4ecf4c8cbe4110f2386c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page