We support either passing variables with the prefix 'proxy.config.' or 'records.' Internally we need to use 'records.variable' as the root node starts with 'records' for records configs.
| 40 | /// Internally we need to use 'records.variable' as the root node starts with 'records' for records |
| 41 | /// configs. |
| 42 | std::string |
| 43 | amend_variable_name(swoc::TextView variable) |
| 44 | { |
| 45 | std::string var{TS_PREFIX}; |
| 46 | // If the variable is prefixed with "proxy.config" we will remove it and replace it |
| 47 | // with the records "records." root name. |
| 48 | if (swoc::TextView{variable}.starts_with(PREFIX)) { |
| 49 | var += variable.substr(PREFIX.size()); |
| 50 | return var; |
| 51 | } |
| 52 | |
| 53 | // you may be using "records." already or some other name maybe for a different file. |
| 54 | // we expect either `ts` or `proxy.config` |
| 55 | return {variable.data(), variable.size()}; |
| 56 | } |
| 57 | |
| 58 | /// traffic_ctl should work without the need to pass the filename, so use the data |
| 59 | /// we have to figure out the file path. If the filename is specified in the traffic_ctl |
no test coverage detected