Skip to content

cub function

cub function

Function commands

Synopsis

The function subcommands are used to discover and execute functions.

Functions are explained at https://docs.confighub.com/background/entities/function/. A guide for how to use functions is at https://docs.confighub.com/guide/functions/.

Invoke a function with the verb matching its kind. Each verb rejects functions of the wrong kind before invoking anything, so a mistake is an error rather than an unintended write, and an agent or role can be granted "function get" alone:

get non-mutating functions (Mutating=false), including validating ones: get-container-image, get-replicas, get-placeholders, get-resources, get-yq set mutating functions (Mutating=true): set-container-image, set-replicas, set-yq, search-replace, ensure-namespaces vet validating functions (Validating=true): vet-schemas, vet-placeholders, vet-cel do any kind. The escape hatch for a single command that must mix kinds.

The verb supplies a missing prefix, so "function set replicas 3" invokes set-replicas and "function vet placeholders" invokes vet-placeholders.

Arguments are positional, in signature order. To pass them by name ("--parameter-name=value") put "--" before the function name, so that cub does not read them as its own flags.

Functions are toolchain-specific (Kubernetes/YAML, AppConfig/Properties, etc.) and operate on the units selected by --space or --variant, --unit, --where, and --where-data. --where-resource narrows which resources within those units are operated on, and --resource names exactly one of them the way kubectl does, as /, finding the unit that holds it:

cub function set --variant web/base --resource Deployment/backend set-replicas 3

Options

      --component string        the Component of --variant, when that names the variant alone; --variant <component>/<variant> says the same in one flag
      --executor-space string   Space ID or slug whose executor to use for builtin functions (org-level only)
  -h, --help                    help for function
      --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>; "*" means the same as omitting it
      --variant string          variant to operate in, as <component>/<variant>, or as <variant> with --component: the space naming that Component whose Variant label is <variant>. The same scope as --space, named by what it is rather than by the space's slug; the two cannot be combined

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO