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. This example assumes you either have a *pullable* bundle image,
  2. or something similar to the following operator bundle layout present locally:
  3. $ tree ./bundle
  4. ./bundle
  5. ├── manifests
  6. ├── cache.my.domain_memcacheds.yaml
  7. └── memcached-operator.clusterserviceversion.yaml
  8. └── metadata
  9. └── annotations.yaml
  10. To validate a local bundle:
  11. $ operator-sdk bundle validate ./bundle
  12. To build and validate a *pullable* bundle image:
  13. $ operator-sdk bundle validate <some-registry>/<operator-bundle-name>:<tag>
  14. To list and run optional validators, which are specified by a label selector:
  15. $ operator-sdk bundle validate --list-optional
  16. NAME LABELS DESCRIPTION
  17. operatorhub name=operatorhub OperatorHub.io metadata validation
  18. suite=operatorframework
  19. $ operator-sdk bundle validate ./bundle --select-optional suite=operatorframework

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")
  3. --list-optional List all optional validators available. When set, no validators will be run
  4. --select-optional string Label selector to select optional validators to run. Run this command with '--list-optional' to list available optional validators

Options inherited from parent commands

  1. --verbose Enable verbose logging

SEE ALSO

Last modified September 22, 2020: `bundle validate`: enable optional validators (#3719) (1973360f)