cub unit set-predicates
cub unit set-predicates
Set mutation predicates on a unit
Synopsis
Set the Predicate flags stored on a unit's MutationSources.
A Predicate records whether a path is eligible to be overwritten by a merge: true means a merge may patch it, false marks it a protected local override. Merges consult these stored values when no WhereMutation filter is supplied — most importantly when the merge's subtraction step is disabled (via --merge-disable-subtraction or a link's MergeDisableSubtraction), where the stored Predicate is the only mechanism preserving local overrides.
Each --predicate has the form RESOURCE_TYPE:RESOURCE_NAME:PATH=BOOL, where RESOURCE_TYPE and RESOURCE_NAME identify the resource (e.g. apps/v1/Deployment and default/myapp), PATH is a resolved path within that resource, and BOOL is true or false. Repeat --predicate to set several paths or resources at once. A path that is not already present inherits the closest ancestor mutation's provenance. Setting predicates creates a new revision only if they change.
Examples:
# Protect the downstream replica count from being overwritten by upgrades
cub unit set-predicates my-unit \
--predicate "apps/v1/Deployment:default/myapp:spec.replicas=false"
# Re-open a path so a future merge may overwrite it again
cub unit set-predicates my-unit \
--predicate "apps/v1/Deployment:default/myapp:spec.replicas=true"
cub unit set-predicates <unit-slug> --predicate <spec> [--predicate <spec> ...] [flags]
Options
-h, --help help for set-predicates
-o, --output string Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
--predicate stringArray predicate to set, as RESOURCE_TYPE:RESOURCE_NAME:PATH=BOOL (repeatable)
--quiet No default output.
--verbose Detailed output, additive with default output
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
--space string space ID to perform command on
SEE ALSO
- cub unit - Unit commands