Uploaded image for project: 'Data Collection, Analytics, and Events'
  1. Data Collection, Analytics, and Events
  2. DCAEGEN2-3223

CBS client environment variable substitution fails for complex cases

XMLWordPrintable

      Some microservices have an application configuration set in their values.yaml files that include references to environment variables.  Prior to the KOHN release, an initContainer running the "envsubst" command performed environment variable substitution on these configurations.

      For the KOHN release, DCAEGEN2-2935 removes the initContainer. Microservices use the dcaegen2-services-sdk/rest-services/cbs-client library to read their configurations, and the library performs the environment variable substitutions.  This works for most microservices, but the restconf-collector microservice has an application configuration that includes a key ("rcc_policy") whose value is a string representation of a JSON array with multiple references to environment variables.  (See https://github.com/onap/oom/blob/master/kubernetes/dcaegen2-services/components/dcae-restconf-collector/values.yaml, line 142.)   Instead of substituting each of the environment variables in the string, the cbs-client library sets the value of "rcc_policy" to the value of one of the environment variables.

      See https://github.com/onap/dcaegen2-services-sdk/blob/master/rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/impl/CbsClientEnvironmentParsing.java, line 72.  The code is constructing a new JSON object that has the environment variable references expanded, but it is not processing the value string to substitute each of the environment variables.  Instead, it's just setting the value to the variable of the environment variable.

            twrobel twrobel
            jackl Jack Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: