Skip to content

cub run where-filter

cub run where-filter

Returns true if all terms of the conjunction of relational expressions evaluate to true for at least one matching path of a resource of the specified type. Intended to be used for filtering rather than validating, though it returns the same output type. Validating. Supported toolchains: ConfigHub/YAML, Kubernetes/YAML, OpenTofu/HCL, AppConfig/Env, AppConfig/JSON, AppConfig/TOML, AppConfig/YAML, AppConfig/INI, AppConfig/Properties

cub run where-filter [flags]

Options

  -h, --help                   help for where-filter
      --resource-type string   (required) Resource type (EntityType) to match
      --where-expression AND   (required) The specified string is an expression for the purpose of evaluating whether the configuration data matches the filter. It supports conjunctions using AND of relational expressions of the form *path* *operator* *literal*. The path specifications are dot-separated, for both map fields and array indices, as in `spec.template.spec.containers.0.image = 'ghcr.io/headlamp-k8s/headlamp:latest' AND spec.replicas > 1`. Path expressions support `*` for wildcard array or map segments and `?key=value` syntax for associative matches of array elements containing objects with a `key` attribute. Strings support the following operators: `<`, `>`, `<=`, `>=`, `=`, `!=`, `LIKE`, `ILIKE`, `~~`, `!~~`, `~`, `!~`, `~*`, `!~*`, `IN`, `NOT IN`. String pattern operators: `LIKE` and `~~` for pattern matching with `%` and `_` wildcards, `ILIKE` for case-insensitive pattern matching, `!~~` for NOT LIKE. String regex operators: `~` for regex matching, `~*` for case-insensitive regex, `!~` and `!~*` for regex not matching (case-sensitive and insensitive). Integers support the following operators: `<`, `>`, `<=`, `>=`, `=`, `!=`, `IN`, `NOT IN`. Boolean values support equality and inequality only. The `IN` and `NOT IN` operators accept a comma-separated list of values in parentheses, such as `spec.template.spec.containers.0.image#reference IN (':latest', ':arm64-latest')`. The syntax `.|` requires the preceding path to exist; otherwise the relation `!=` will always return true regardless what it is compared with. String literals are quoted with single quotes, such as `'string'`. Integer and boolean literals are also supported for attributes of those types.

Options inherited from parent commands

      --change-desc string      change description
      --changeset string        changeset to associate units with
      --context string          The context to use for this command
      --data-only               show config data without other response details
      --debug                   Debug output
      --display-mutations       display resource mutations
      --dry-run                 dry run mode: execute functions but skip updating configuration data
      --executor-space string   Space ID or slug whose executor to use for builtin functions (org-level only)
      --filter string           filter to apply (slug, space/filter, or UUID)
      --jq string               jq expression
      --json                    JSON output
      --livestate-type string   Invoke the function on the live state and use the flag value as the toolchain type for live state.
      --output-jq string        apply jq to output JSON
      --output-only             show output without other response details
      --quiet                   No output
      --space string            space ID to perform command on
      --toolchain string        Toolchain type for the function invocations (default "Kubernetes/YAML")
      --unit strings            target specific units by slug or UUID (can be repeated or comma-separated)
      --wait                    wait for completion
      --where string            where filter
      --where-data string       where data filter
      --where-resource string   filter which resources the function operates on
      --worker string           worker to execute the function
      --yaml                    YAML output
      --yq string               yq expression

SEE ALSO