Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cargoship validate

Checks a cluster inventory, package definition, or config file against its schema

Synopsis

Checks one or more files against the JSON Schema cargoship generates for that file format, reporting every problem rather than the first. Cargoship parses these files without strict key checking, so a misspelled key is dropped rather than reported; this catches that, along with a wrong type and a value outside an enumerated list. The schema is read from the binary, so no network access is needed.

The schema is chosen from the document’s own ‘kind’ field. A cargoship config file declares no kind and has to be named with –kind.

spec.config.values is untyped in the inventory schema, because its shape belongs to whichever package is being installed. Pass –package to check it as well.

cargoship validate FILE... [flags]

Examples


# Check a cluster inventory against the inventory schema:
$ cargoship validate ./inventory.yaml

# Check every inventory in a directory, reporting all of them in one pass:
$ cargoship validate ./inventories/*.yaml

# Check a cargoship config file, which declares no kind of its own:
$ cargoship validate --kind config ./cargoship-config.yaml

# Check an inventory's spec.config.values against the package it will be installed with:
$ cargoship validate ./inventory.yaml --package ./package.tar.zst

Options

  -a, --architecture string        Architecture for OCI images and Zarf packages
  -h, --help                       help for validate
      --insecure-skip-tls-verify   Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture.
  -k, --key string                 Path to public key file for validating signed packages
      --kind string                Name the schema to check against instead of reading the document's 'kind' field. Required for a cargoship config file, which declares no kind.
      --package string             Check spec.config.values against a package's own values schema. Takes anything 'cargoship apply' takes -- a tarball, an oci:// or https:// reference -- or a package source directory or distro.yaml, so it works before the package is built. Only valid for the 'inventory' schema.
      --plain-http                 Allow OCI registry connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture.
      --tmpdir string              Specify the temporary directory to use for intermediate files (default "/tmp")
      --verify verifyMode          Verify the Cargoship package signature. (default if-possible)
      --zarf-cache string          Specify the location of the Zarf cache directory (default "$HOME/.cache/cargoship")

Options inherited from parent commands

      --log-file            Always write a full-verbosity debug log to a file, regardless of --log-level.
  -L, --log-format string   Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console")
  -l, --log-level string    Log level when running cargoship. Valid options are: warn, info, debug, trace (default "info")
      --no-color            Disable terminal color codes in logging and stdout prints.

SEE ALSO