operator-sdk bundle validate

operator-sdk bundle validate

Validate an operator bundle

Synopsis

The ‘operator-sdk bundle validate’ command can validate both content and format of an operator bundle image or an operator bundle directory on-disk containing operator metadata and manifests. This command will exit with an exit code of 1 if any validation errors arise, and 0 if only warnings arise or all validators pass.

More information about operator bundles and metadata: https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md

NOTE: if validating an image, the image must exist in a remote registry, not just locally.

  1. operator-sdk bundle validate [flags]

Examples

  1. The following command flow will generate test-operator bundle manifests and metadata,
  2. then validate them for 'test-operator' version v0.1.0:
  3. # Generate manifests and metadata locally.
  4. $ make bundle
  5. # Validate the directory containing manifests and metadata.
  6. $ operator-sdk bundle validate ./bundle
  7. To build and validate an image built with the above manifests and metadata:
  8. # Create a registry namespace or use an existing one.
  9. $ export NAMESPACE=<your registry namespace>
  10. # Build and push the image using the docker CLI.
  11. $ docker build -f bundle.Dockerfile -t quay.io/$NAMESPACE/test-operator:v0.1.0 .
  12. $ docker push quay.io/$NAMESPACE/test-operator:v0.1.0
  13. # Ensure the image with modified metadata and Dockerfile is valid.
  14. $ operator-sdk bundle validate quay.io/$NAMESPACE/test-operator:v0.1.0

Options

  1. -h, --help help for validate
  2. -b, --image-builder string Tool to pull and unpack bundle images. Only used when validating a bundle image. One of: [docker, podman, none] (default "docker")

Options inherited from parent commands

  1. --verbose Enable verbose logging

SEE ALSO

Last modified July 20, 2020: *: remove legacy CLI docs (#3455) (132dbe2c)