https://github.com/everettraven/crd-diff
a CLI tool to compare CustomResourceDefinitions and identify breaking changes
https://github.com/everettraven/crd-diff
crd customresourcedefinition customresourcedefinitions kubernetes
Last synced: 3 months ago
JSON representation
a CLI tool to compare CustomResourceDefinitions and identify breaking changes
- Host: GitHub
- URL: https://github.com/everettraven/crd-diff
- Owner: everettraven
- License: apache-2.0
- Created: 2024-10-30T21:15:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T15:19:11.000Z (5 months ago)
- Last Synced: 2024-12-25T21:41:35.851Z (5 months ago)
- Topics: crd, customresourcedefinition, customresourcedefinitions, kubernetes
- Language: Go
- Homepage: https://everettraven.github.io/crd-diff/
- Size: 146 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crd-diff
`crd-diff` is a CLI tool for comparing Kubernetes `CustomResourceDefinition` resources (CRDs) for differences.
It checks for incompatible changes to help:
- Cluster administrators protect CRDs on their clusters from breaking changes
- GitOps practitioners prevent CRDs with breaking changes being committed
- Developers of Kubernetes extension identify when changes to their CRDs are incompatible## Usage
```sh
crd-diff is a tool for evaluating changes to Kubernetes CustomResourceDefinitions
to help cluster administrators, gitops practitioners, and Kubernetes extension developers identify
changes that might result in a negative impact to clusters and/or users.Example use cases:
Evaluating a change in a CustomResourceDefinition on a Kubernetes Cluster with one in a file:
$ crd-diff kube://{crd-name} file://{filepath}Evaluating a change from file to file:
$ crd-diff file://{filepath} file://{filepath}Evaluating a change from git ref to git ref:
$ crd-diff git://{ref}?path={filepath} git://{ref}?path={filepath}Usage:
crd-diff [flags]
crd-diff [command]Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
version installed version of crd-diffFlags:
--config string the filepath to load the check configurations from
-h, --help help for crd-diff
-o, --output string the format the output should take when incompatibilities are identified. May be one of plaintext, json, yaml (default "plaintext")Use "crd-diff [command] --help" for more information about a command.
```The `` and `` arguments are required and should be the sourcing information for the old and new
`CustomResourceDefinition` YAMLThe supported sources are:
- `kube://{name}`
- `git://{ref}?path={filepath}`
- `file://{filepath}`An example of using `crd-diff` to compare a `CustomResourceDefinition` on a Kubernetes cluster to the same one in a local file:
```sh
crd-diff kube://memcacheds.cache.example.com file://crd.yaml
```## Installation
`crd-diff` can be installed by running:
```sh
go install github.com/everettraven/crd-diff@{revision}
```Replace `{revision}` with a tag, commit, or `latest` to build and install the tool from source at that particular revision.