You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
currently there is no way to get data from inside a json string defined in a cm. you can specify type: json, but that only parses the json and leaves its keys as a second class citizen.
Describe the solution you'd like
give a way to pull a single key or all the keys from a json into the top level of the returned fetchEnvs obj.
Describe alternatives you've considered
use fetchEnvs to get the json, then do post processing on the returned object to flatten accordingly
env
- name: cluster-config # name of the key the fetched data will be assigned tovalueFrom:
configMapKeyRef:
key: cluster-config # key within configmapname: cluster-info # configmap namenamespace: kube-system # configmap namespacetype: json # tells fetchEnvs to parse the fetched key
example of using .env and being able to specify the path to a lower level json key
env:
- name: cluster_created # name of key retrieved data will be assigned tovalueFrom:
configMapKeyRef:
key: cluster-config # key within configmapname: cluster-info # configmap namenamespace: kube-system # configmap namespacetype: json # tells fetchEnvs to parse the fetched keypathStr: 'cluster_metadata.created'# must have type defined
example of using .env and being able to specify the path to a lower level json key
env:
- name: cluster_created # name of key retrieved data will be assigned tovalueFrom:
configMapKeyRef:
key: cluster-config# key within configmapname: cluster-info # configmap namenamespace: kube-system # configmap namespacetype: json # tells fetchEnvs to parse the fetched keypath: ['cluster.metadata', 'created'] # must have type defined
example of using .env and being able to specify the path to get all json items
env:
- name: cluster_created # not used when path all `.` is definedvalueFrom:
configMapKeyRef:
key: cluster-config # key within configmapname: cluster-info # configmap namenamespace: kube-system # configmap namespacetype: json # tells fetchEnvs to parse the fetched keypathStr: '.'# must have type defined
thanks for the suggestion. the actual motivation for this issue was to do with FeatureFlagSetLD. In mustache, it actually works just fine, since you can reference lower level json objects in a template. ie. when you specify type: json today, it already parses the json and adds it to the view, and you can reference anything you want in the view like this {{ cluster-config.cluster_metadata.created }}
we wanted a way to get items from within a json string to the top to be used directly, instead of needing any post processing within FeatureFlagSetLD
Is your feature request related to a problem? Please describe.
currently there is no way to get data from inside a json string defined in a cm. you can specify type: json, but that only parses the json and leaves its keys as a second class citizen.
Describe the solution you'd like
give a way to pull a single key or all the keys from a json into the top level of the returned fetchEnvs obj.
Describe alternatives you've considered
use fetchEnvs to get the json, then do post processing on the returned object to flatten accordingly
Additional context
example configmap
a normal example of using
.env
in razeewith a result of
example configmap
example of using
.env
and being able to specify the path to a lower level json keywith a result of
example configmap with
.
in key nameexample of using
.env
and being able to specify the path to a lower level json keywith a result of
example configmap
example of using
.env
and being able to specify the path to get all json itemswith a result of
The text was updated successfully, but these errors were encountered: