Skip to content

cub run set-template

cub run set-template

Renders a Go text/template expression and writes the result to the specified path of each resource matched by WhereResource. FunctionContext fields are accessible at the top level; vararg key=value params are accessible under .Params. Mutating. Supported toolchains: AppConfig/Env, AppConfig/INI, AppConfig/JSON, AppConfig/TOML, AppConfig/YAML, ConfigHub/YAML, Kubernetes/YAML, AppConfig/Properties, AppConfig/Text

cub run set-template [flags]

Options

      --expression param   (required) Go text/template expression. FunctionContext fields are accessible at the top level (e.g. {{.UnitSlug}}); params passed via the param argument are accessible as {{.Params.<key>}}.
  -h, --help               help for set-template
      --param string       Parameters passed to the template as key=value strings, accessible as {{.Params.<key>}} (values are strings).
      --path string        (required) Dot-separated path of the attribute to set. See https://docs.confighub.com/guide/functions/#configuration-path-syntax for more details regarding path syntax.

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
      --debug                   Debug output
      --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)
      --livestate-type string   Invoke the function on the live state and use the flag value as the toolchain type for live state.
  -o, --output string           Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
      --quiet                   No output
      --resource-type string    resource-type filter
      --show string             Select which part of the function response to display. One of: output, values, data
      --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

SEE ALSO