Uploaded image for project: 'Microservices Bus'
  1. Microservices Bus
  2. MSB-534

kube2msb fails to register SO services including braces in url

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • Istanbul Release
    • Guilin Release
    • None

      OOM SO helm chart has MSB annotation but it is not registered into MSB on deploy due to JSON unmarshal error.

      MSB annotation in OOM SO helm chart (file: oom/kubernetes/so/templates/service.yaml) and I'm expecting this is registered :

        annotations:
          msb.onap.org/service-info: '[
               {
              "serviceName": "so",
              "version": "v1",
              "url": "/onap/so/infra/cloudResources/{version:[vV][1]}/operationalEnvironments",
              "protocol": "REST",
              "port": "8080",
              "visualRange":"0",
              "lb_policy":"ip_hash"
               },
         ...
      

      I saw the following error from kube2msb pod :

      2020-10-29 06:05:03.704929 I | Failed to Unmarshal serviceInfo to ServiceAnnotation:invalid character 'i' after object key:value pair
      

      also confirmed that the so service was not registered in msb-discovery

      Environment

      Guilin RC0 (OOM) as of Oct.29

      Identified cause

      mergeIP() in msb_work.go does not handle braces '{' properly. SO's annotation includes braces in its url so the method broke structure by improper string replacement.
      https://github.com/onap/oom-registrator/blob/66c00e4df2bcb8f6142d6f5573e4db3f429cfeb4/src/kube2msb/msb_work.go#L89

            jinquanni Jinquan Ni
            s4fujii s4fujii
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: