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

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

Description

@flanksaul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions