Skip to content

kyverno/pre-commit-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

pre-commit-hook

For running pre-commit hooks for kyverno.

Hooks Available

There are two hooks available:

  • kyverno-validate
  • kyverno-test

Pre-Requisites

Kyverno CLI must be installed

Please use these instructions

Example Usage

create .pre-commit-config.yaml at the root of repo

repos:
  - repo: https://github.com/kyverno/pre-commit-hook
    rev: v1.0.0
    hooks:
      - id: kyverno-test
        args: ["kyverno-policies"]
      - id: kyverno-validate
        args: ["kyverno-policies"]

Note: the args for each hook should be the directory where your kyverno policies are stored

then run:

pre-commit install pre-commit run --all-files

Further configuration of pre-commit (to only run on push, for example) see the Pre-commit Documentation