Slackbot
05/12/2023, 4:00 PMAsaf Cohen
05/12/2023, 4:02 PMAvo Sepp
05/12/2023, 4:07 PMtoJSON, and then encapsulates it in single quotes. Then it creates the Environment variable OPAL_CONFIG_DATA_SOURCES on my behalf. So there’s a few levels of transformations happening here. I was hoping that \ escaping would work, but it seems like I need to do something differently for the Helm tempalte to work. Was hoping someone had the answer on hand for the correct escape.Avo Sepp
05/12/2023, 4:07 PMAsaf Cohen
05/12/2023, 4:08 PMAvo Sepp
05/12/2023, 4:09 PMAsaf Cohen
05/12/2023, 4:09 PMAvo Sepp
05/12/2023, 4:42 PMtoRawJson in the Helm chart instead of toJson. Because it seems like my >= <= signs are being escaped.Avo Sepp
05/12/2023, 4:43 PMAvo Sepp
05/12/2023, 5:08 PMRaz Co
05/12/2023, 5:09 PMRaz Co
05/12/2023, 5:09 PMAvo Sepp
05/12/2023, 5:09 PM" they are being escaped by toJson and toRawJson as \". But this escape makes its way all the way to the OPAL environment variable. So the query is failing. When I supply single quotes, it breaks the squote mechanism applied to the template.Asaf Cohen
05/13/2023, 7:14 AMRo'e Katz
05/13/2023, 11:32 AMdataConfigSources:
config:
entries:
- url: <http://opal-server:7002/policy-data>
topics: ["policy_data"]
dst_path: "/static"Ro'e Katz
05/13/2023, 11:35 AMAvo Sepp
05/13/2023, 11:37 AMAvo Sepp
05/15/2023, 6:28 PM{"Id":demo.value.Id,"Abbr":demo.value.Abbr} AS Name gets parsed through the Helm JSON converter. Which will convert all " to \". Which is the proper escape for the Helm template’s point of view. But when that gets passed to the query itself, the escape character fails.Asaf Cohen
05/16/2023, 4:52 AMRo'e Katz
05/16/2023, 7:21 AMdataConfigSources is used to configure data sources for opal to pull data from, which it than loads into OPA.Avo Sepp
05/16/2023, 10:14 AMAvo Sepp
05/16/2023, 10:14 AMRo'e Katz
05/16/2023, 10:39 AMAvo Sepp
05/16/2023, 10:51 AMRo'e Katz
05/16/2023, 11:25 AMmyvalues.yaml file is:
server:
dataConfigSources:
config:
entries:
- dst_path: "/static"
topics: ["policy_data"]
url: "..."
config:
fetcher: CosmosFetchProvider
query: '{"Id":demo.value.Id,"Abbr":demo.value.Abbr} AS Name'
Have you tried something like that? (That works with either toJson or toRawJson )Avo Sepp
05/16/2023, 1:01 PMAvo Sepp
05/16/2023, 1:01 PMsquote in the helm chart.Avo Sepp
05/16/2023, 1:02 PMRo'e Katz
05/16/2023, 1:27 PMAvo Sepp
05/17/2023, 4:23 PMAvo Sepp
05/17/2023, 5:37 PM