cub apply
cub apply
Create or update ConfigHub entities from their documents
Synopsis
Create or update ConfigHub entities from documents describing them, the way kubectl apply creates or updates Kubernetes objects.
A document is YAML naming the entity's type and slug, with the fields it sets, the shape
"cub
EntityType: Trigger Slug: standard-vets Event: Mutation ToolchainType: Kubernetes/YAML FunctionName: vet-schemas UnitFilter: all-k8s-units
Each document is written to the entity's backing Unit, which is created if the entity has none, and the entity is then created or patched from the Unit, after the Unit's Triggers have run. Documents naming each other are written in order: a Trigger after the Filter it names. A field the document stops stating is removed from the entity; a field changed in ConfigHub that the document did not change is left alone.
The documents go to the Space --space names, which must exist; a name in a document is in
that Space unless it is qualified as
Applying writes only the documents given: nothing the source applied before is removed. With --prune, the documents given are all the source's: the backing Unit of an entity the source applied before and whose document is not among them is emptied, and the entity is then deleted, keeping the empty Unit, which revives if the document comes back. A Unit of the source's whose file is not among them is emptied too.
Documents are owned by their source (--source, cub-apply by default), and a document for an entity another source owns is refused unless --adopt is given.
cub apply -f <file or directory>... [flags]
Options
--adopt take over entities another source owns
--backing-unit-space string space, by slug, for the backing Unit of a Space document, which is in no space of its own; required with one
--dry-run report what would be created and updated, and change nothing
-f, --filename strings a file or directory of documents to apply, or - for stdin (repeatable)
-h, --help help for apply
-o, --output string Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
--prune take the documents given as all the source's, and delete the entities it applied before whose documents are not among them
--source string the source that owns what this applies (default "cub-apply")
--space string space to operate in, by slug or UUID. Omitted, a list or bulk operation spans the organization and a single entity is named as <space>/<slug>
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
SEE ALSO
- cub - ConfigHub CLI