composable icon indicating copy to clipboard operation
composable copied to clipboard

Support sprintf-style transformer

Open dgrove-oss opened this issue 6 years ago • 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).

dgrove-oss avatar Oct 11 '19 18:10 dgrove-oss