Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Support prefix, postfix and circumfix options on Output type. #28

Open
flanksaul opened this issue Jul 2, 2021 · 0 comments
Open

Support prefix, postfix and circumfix options on Output type. #28

flanksaul opened this issue Jul 2, 2021 · 0 comments

Comments

@flanksaul
Copy link
Contributor

The suggestion is supporting the following config for the konfig-manager:

apiVersion: konfigmanager.flanksource.com/v1
kind: Konfig
metadata:
    name: "konfig-{{name}}"
    namespace: "{{namespace}}"
spec:
    hierarchy:
        - name: globalssys
          namespace: "{{namespace}}"
          kind: ConfigMap
    output:
        name: "{{name}}-runtime"
        namespace: "{{namespace}}"
        kind: ConfigMap
        type: file
        filetype: js
        key: runtime.js
        key-transforms:
              - prefix: __
              - postfix: __
              - circumfix: __
              - prefix: __
                postfix: __

Where

key-transforms:
      - prefix: __
      - postfix: __
      - circumfix: __

for single env key 'FOO', output keys are as follows:

window['__FOO']=<value>
window['FOO__']=<value>
window['__FOO__']=<value>

and where

key-transforms:
      - circumfix: __

output keys are as follows:

window['__FOO__']=<value>

And where

key-transforms:
      - prefix: __
        postfix: __

output keys are as follows:

window['__FOO__']=<value>

and mutatis mutandis for all supported filetypes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant