composable-operator/composable

Support sprintf-style transformer

Opened this issue · 0 comments

A useful pattern to support would be to allow multiple inputs to be combined into a single output. A canonical use case is combining a host and port stored in different config map entries (or different secrets) into a single URL. Similar patterns occur when configuring a database (host + utl + table name).

A proposed design might be something like:

combineValueFrom:
  format: 'http://%s:%s'
  inputs:
    - getValueFrom:
      ....
    - getValueFrom:
      ....

The combineValueFrom takes a format which is expected to be a sprintf-style format string and a list of inputs, each of which is a fully-functional getValueFrom block (including format-transformers on the individual items).