Skip to content

cub function set

cub function set

Run mutating functions on units

Synopsis

Run one or more mutating functions on units.

Only functions whose signature has Mutating=true are accepted; non-mutating functions are rejected. For inspection use 'cub function get'; for validation use 'cub function vet'.

A missing set- prefix is supplied, so 'cub function set replicas 3' invokes set-replicas.

Pass --change-desc to record why the change was made; it becomes the new revision's description. Pass --protect to record the paths this change writes as protected local overrides, so a later merge from upstream does not overwrite them -- leave it off when applying a value decided elsewhere, such as propagating a release.

Common idioms: cub function set --dry-run -o mutations set-container-image nginx nginx:1.25 cub function set --show data set-replicas 3

cub function set <function> [<arg1> ...] [flags]

Options

      --change-desc string            change description
      --changeset string              changeset to associate units with
      --clearance stringArray         class of guarded reason this change is cleared for, as KEY, KEY=VALUE[;VALUE...], KEY!=VALUE[;VALUE...], or !KEY to refuse any path carrying KEY (repeatable). A guarded path this does not cover is not written, and the withheld change is reported as a conflict
      --dry-run                       dry run mode: execute functions but skip updating configuration data
      --filter string                 Filter entity to apply to the list. Specify as 'space/filter' for cross-space filters or just 'filter' for current space. Supports both slugs and UUIDs. The filter will be combined with any --where clause using AND logic. Examples: "production-filters/security-check", "my-filter-uuid", "validation-rules"
      --guard stringArray             reason to record on the paths this change writes, as KEY=VALUE (repeatable). A later operation must be cleared for it before overwriting those paths, this one included, so --clearance has to cover it. Adds and overwrites only; retiring a guard is cub unit set-guard --remove-guard
  -h, --help                          help for set
      --include-hidden string[="*"]   Also select hidden entities, to list or to act on: those hidden for the given HiddenReasons, comma-separated, as in --include-hidden=BackingUnit, or for any reason when given no value or "*". ConfigHub/YAML Units, which hold the configuration of other entities, are hidden with the reason BackingUnit. A --where naming entities by Slug or ID selects them whether hidden or not
      --invocation strings            execute invocations by UUID, slug, or space/slug (can be repeated or comma-separated)
      --other-data-source string      additional data source to pass to functions (e.g., LastReleasedRevisionNum)
  -o, --output string                 Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
  -O, --output-file string            Write payload to FILE. Accepts {space}, {unit}, {section} placeholders.
      --protect                       record the paths this change writes as protected local overrides, so a later merge from upstream does not overwrite them; by default a change claims nothing and each path keeps the protection it already has
      --quiet                         No default output.
      --resource-type string          resource-type filter
      --revision string               target a specific revision (format: unit-slug/revision-number, e.g. mydeployment/3)
      --show string                   Select which part of the function response to display. One of: output, values, data
      --timeout string                completion timeout as a duration with units, such as 10s or 2m (default "10m0s")
      --toolchain string              Toolchain type for the function invocations (default "Kubernetes/YAML")
      --trigger strings               execute triggers by UUID, slug, or space/slug (can be repeated or comma-separated)
      --unit strings                  target specific units by slug or UUID (can be repeated or comma-separated)
      --update-validation-results     update ValidationErrors and ValidationWarnings on units based on trigger results (requires --trigger)
      --verbose                       Detailed output, additive with default output
      --wait                          wait for completion (default true)
      --where string                  Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. A related entity is referenced by prefix, as in "UpstreamUnit.Slug = 'base'"; when the reference names a list, a * segment matches any element, as in "FromLink.*.Slug = 'upgrade-app'". Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
      --where-data string             where data filter
      --where-resource string         filter which resources the function operates on
      --worker string                 worker to execute the function

Options inherited from parent commands

      --context string          The context to use for this command
      --debug                   Debug output
      --executor-space string   Space ID or slug whose executor to use for builtin functions (org-level only)
      --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>

SEE ALSO