{"id":13647277,"url":"https://github.com/jtyr/kubeconform-helm","last_synced_at":"2025-04-30T17:09:41.120Z","repository":{"id":69604246,"uuid":"582638299","full_name":"jtyr/kubeconform-helm","owner":"jtyr","description":"Tools to test Helm chats with \"kubeconform\".","archived":false,"fork":false,"pushed_at":"2024-04-12T13:04:49.000Z","size":41,"stargazers_count":55,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T17:09:32.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtyr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T12:46:01.000Z","updated_at":"2025-04-28T22:51:27.000Z","dependencies_parsed_at":"2024-01-14T10:02:30.102Z","dependency_job_id":"47c474d5-abf3-46ed-b4d1-9670b3f47528","html_url":"https://github.com/jtyr/kubeconform-helm","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fkubeconform-helm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fkubeconform-helm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fkubeconform-helm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fkubeconform-helm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtyr","download_url":"https://codeload.github.com/jtyr/kubeconform-helm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748950,"owners_count":21637418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:03:27.602Z","updated_at":"2025-04-30T17:09:41.092Z","avatar_url":"https://github.com/jtyr.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Kubeconform Helm\n\nThis repo contains tools that allow to use `kubeconform` to test [Helm\ncharts](https://helm.sh) in the form of [Helm\nplugin](https://helm.sh/docs/topics/plugins/) and [`pre-commit`\nhook](https://pre-commit.com/).\n\n## Usage\n\n### Helm plugin\n\nThe `kubeconform` [Helm plugin](https://helm.sh/docs/topics/plugins/) can be\ninstalled using this command:\n\n```shell\nhelm plugin install https://github.com/jtyr/kubeconform-helm\n```\n\nOnce installed, the plugin can be used from any Helm chart directory:\n\n```shell\n# Enter the chart directory\ncd charts/mychart\n# Run kubeconform plugin\nhelm kubeconform .\n```\n\nThe plugin uses `helm template` internally and passes its output to the\n`kubeconform`. There is several `helm template` command line options supported\nby the plugin that can be specified:\n\n```shell\nhelm kubeconform --namespace myns .\n```\n\nThere is also several `kubeconform` command line options supported by the plugin\nthat can be specified:\n\n```shell\n# Kubeconform options\nhelm kubeconform --verbose --summary .\n```\n\nIt's also possible to create `.kubeconform` file in the Helm chart directory\nthat can contain default `kubeconform` settings:\n\n```yaml\n# Command line options that can be set multiple times can be defined as an array\nschema-location:\n  - default\n  - https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json\n# Command line options that can be specified without a value must have boolean\n# value in the config file\nsummary: true\nverbose: true\n```\n\nThe full list of options for the\n[plugin](https://github.com/jtyr/kubeconform-helm/blob/master/scripts/plugin_wrapper.py)\nis as follows:\n\n```text\n$ ./scripts/plugin_wrapper.py --help\nusage: plugin_wrapper.py [-h] [--cache] [--cache-dir DIR] [--config FILE]\n                         [--values-dir DIR] [--values-pattern PATTERN] [-d] [--stdout]\n                         [--errors-only] [--fail-fast] [--skip-refresh] [--verify]\n                         [-f FILE] [-n NAME] [-r NAME] [--ignore-missing-schemas]\n                         [--insecure-skip-tls-verify] [--kubernetes-version VERSION]\n                         [--goroutines NUMBER] [--output {json,junit,tap,text}]\n                         [--reject LIST] [--schema-location LOCATION] [--skip LIST]\n                         [--strict] [--summary] [--verbose]\n                         CHART\n\nWrapper to run kubeconform for a Helm chart.\n\noptions:\n  -h, --help            show this help message and exit\n  --cache               whether to use kubeconform cache\n  --cache-dir DIR       path to the cache directory (default: ~/.cache/kubeconform)\n  --config FILE         config file name (default: .kubeconform)\n  --values-dir DIR      directory with optional values files for the tests (default:\n                        tests/kubeconform)\n  --values-pattern PATTERN\n                        pattern to select the values files (default: *-values.yaml)\n  -d                    debug output\n  --stdout              log to stdout\n  --errors-only         output only errors\n  --fail-fast           fail on first error\n\nhelm build:\n  Options passed to the 'helm build' command\n\n  --skip-refresh        do not refresh the local repository cache\n  --verify              verify the packages against signatures\n\nhelm template:\n  Options passed to the 'helm template' command\n\n  -f FILE, --values FILE\n                        values YAML file or URL (can specified multiple)\n  -n NAME, --namespace NAME\n                        namespace\n  -r NAME, --release NAME\n                        release name\n  CHART                 chart path (e.g. '.')\n\nkubeconform:\n  Options passsed to the 'kubeconform' command\n\n  --ignore-missing-schemas\n                        skip files with missing schemas instead of failing\n  --insecure-skip-tls-verify\n                        disable verification of the server's SSL certificate\n  --kubernetes-version VERSION\n                        version of Kubernetes to validate against, e.g. 1.18.0 (default:\n                        master)\n  --goroutines NUMBER   number of goroutines to run concurrently (default: 4)\n  --output {json,junit,tap,text}\n                        output format (default: text)\n  --reject LIST         comma-separated list of kinds or GVKs to reject\n  --schema-location LOCATION\n                        override schemas location search path (can specified multiple)\n  --skip LIST           comma-separated list of kinds or GVKs to ignore\n  --strict              disallow additional properties not in schema or duplicated keys\n  --summary             print a summary at the end (ignored for junit output)\n  --verbose             print results for all resources (ignored for tap and junit output)\n```\n\n## Helm `pre-commit` hook\n\nThe `kubeconform` [`pre-commit` hook](https://pre-commit.com) can be added into the\n`.pre-commit-config.yaml` file like this:\n\n```yaml\nrepos:\n  - repo: https://github.com/jtyr/kubeconform-helm\n    rev: v0.1.17\n    hooks:\n      - id: kubeconform-helm\n```\n\nThe hook uses `helm template` internally and passes its output to the\n`kubeconform`. There is several `helm template` command line options supported\nby the hook that can be specified:\n\n```yaml\n  - repo: https://github.com/jtyr/kubeconform-helm\n    rev: v0.1.17\n    hooks:\n      - id: kubeconform-helm\n        args:\n          - --namespace=myns\n          - --release=myrelease\n```\n\nThere is also several `kubeconform` command line options supported by the hook\nthat can be specified:\n\n```yaml\n  - repo: https://github.com/jtyr/kubeconform-helm\n    rev: v0.1.17\n    hooks:\n      - id: kubeconform-helm\n        args:\n          - --kubernetes-version=1.24.0\n          - --verbose\n          - --summary\n```\n\nThe full list of options for the\n[hook](https://github.com/jtyr/kubeconform-helm/blob/master/scripts/pre-commit.py)\nis as follows:\n\n```text\n$ ./scripts/pre-commit.py --help\nusage: pre-commit.py [-h] [--charts-path PATH] [--include-charts LIST]\n                     [--exclude-charts LIST] [--path-sub-pattern PATTERN]\n                     [--path-sub-separator SEP] [--cache] [--cache-dir DIR] [--config FILE]\n                     [--values-dir DIR] [--values-pattern PATTERN] [-d] [--stdout]\n                     [--errors-only] [--fail-fast] [--skip-refresh] [--verify] [-f FILE]\n                     [-n NAME] [-r NAME] [--ignore-missing-schemas]\n                     [--insecure-skip-tls-verify] [--kubernetes-version VERSION]\n                     [--goroutines NUMBER] [--output {json,junit,tap,text}] [--reject LIST]\n                     [--schema-location LOCATION] [--skip LIST] [--strict] [--summary]\n                     [--verbose]\n                     FILES [FILES ...]\n\nWrapper to run kubeconform for a Helm chart.\n\npositional arguments:\n  FILES                 files that have changed\n\noptions:\n  -h, --help            show this help message and exit\n  --charts-path PATH    path to the directory with charts, can be multiple (default:\n                        charts)\n  --include-charts LIST\n                        comma-separated list of chart names to include in the testing\n  --exclude-charts LIST\n                        comma-separated list of chart names to exclude from the testing\n  --path-sub-pattern PATTERN\n                        substitution pattern to rewrite chart directory path for library\n                        charts (e.g. '^charts/(commonlib),helper-charts/\\1-test')\n  --path-sub-separator SEP\n                        separator used to split the path-sub-pattern (default: ,)\n  --cache               whether to use kubeconform cache\n  --cache-dir DIR       path to the cache directory (default: ~/.cache/kubeconform)\n  --config FILE         config file name (default: .kubeconform)\n  --values-dir DIR      directory with optional values files for the tests (default:\n                        tests/kubeconform)\n  --values-pattern PATTERN\n                        pattern to select the values files (default: *-values.yaml)\n  -d                    debug output\n  --stdout              log to stdout\n  --errors-only         output only errors\n  --fail-fast           fail on first error\n\nhelm build:\n  Options passed to the 'helm build' command\n\n  --skip-refresh        do not refresh the local repository cache\n  --verify              verify the packages against signatures\n\nhelm template:\n  Options passed to the 'helm template' command\n\n  -f FILE, --values FILE\n                        values YAML file or URL (can specified multiple)\n  -n NAME, --namespace NAME\n                        namespace\n  -r NAME, --release NAME\n                        release name\n\nkubeconform:\n  Options passsed to the 'kubeconform' command\n\n  --ignore-missing-schemas\n                        skip files with missing schemas instead of failing\n  --insecure-skip-tls-verify\n                        disable verification of the server's SSL certificate\n  --kubernetes-version VERSION\n                        version of Kubernetes to validate against, e.g. 1.18.0 (default:\n                        master)\n  --goroutines NUMBER   number of goroutines to run concurrently (default: 4)\n  --output {json,junit,tap,text}\n                        output format (default: text)\n  --reject LIST         comma-separated list of kinds or GVKs to reject\n  --schema-location LOCATION\n                        override schemas location search path (can specified multiple)\n  --skip LIST           comma-separated list of kinds or GVKs to ignore\n  --strict              disallow additional properties not in schema or duplicated keys\n  --summary             print a summary at the end (ignored for junit output)\n  --verbose             print results for all resources (ignored for tap and junit output)\n```\n\n## Contribution\n\nThis repo utilises [`pre-commit`](https://pre-commit.com/) hooks to lint code\nchanges. Make sure you install it before contributing to the repo.\n\n### Installation\n\nFollowing are the installation instructions for `pre-commit`. Further details\ncan be found [here](https://pre-commit.com/#installation).\n\n#### Mac\n\n```shell\nbrew install pre-commit\n```\n\n#### Ubuntu\n\n```shell\npip install pre-commit\n```\n\n#### Arch Linux\n\n```shell\npacman -S python-pre-commit\n```\n\n### Usage\n\n`pre-commit` can run automatically on every commit. This requires to run the\nfollowing command once:\n\n```shell\npre-commit install\n```\n\nUse the following command to run `pre-commit` manually for all files in the\nrepository:\n\n```shell\npre-commit run --all-files\n```\n\n## License\n\nMIT\n\n## Author\n\nJiri Tyr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fkubeconform-helm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtyr%2Fkubeconform-helm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fkubeconform-helm/lists"}