Uploaded image for project: 'Managed Service - API'
  1. Managed Service - API
  2. MGDAPI-3978

Sendgrid: immutable id field in supported service config map

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • None
    • 8
    • False
    • Hide

      None

      Show
      None
    • False
    • No

      WHAT
      Sendgrid service uses a config map to map between addons, secret name and namespace [1]. However, it seems that Addon names can change / be updated over time. If the add on name changes, then existing job db entries that reference this addon will no longer be found and would likely cause issues for existing installations.

      We should include an id field that is instead intended to be never be changed once added to this config map and use this as the reference in DB entries

      We can perhaps use the id of addons as the value for this field

      ocm get /api/clusters_mgmt/v1/addons --parameter size=50 --parameter search="enabled is 'true'"  | jq '.items[].id' 
      

      [1] https://gitlab.cee.redhat.com/service/app-interface/-/blob/master/data/services/sendgrid/cicd/saas/saas-ocm-sendgrid-supported-services-stage.yaml

      HOW

      • Add an id field to the config map
      • Update logic around using saving addon name as part of jobs to use id instead [2][3][4]
      • Add a database migration to migrate existing jobs using addons names to use id instead
      • Update docs to include this new id field, noting that it should not be changed

      [2] https://gitlab.cee.redhat.com/service/ocm-sendgrid-service/-/blob/master/pkg/services/webhook.go#L152-189
      [3] https://gitlab.cee.redhat.com/service/ocm-sendgrid-service/-/blob/master/pkg/services/syncset.go#L128-135
      [4] https://gitlab.cee.redhat.com/service/ocm-sendgrid-service/-/blob/master/pkg/api/smtp_types.go#L30-34

      TESTS
      <List of related tests>

      DONE

      • ID field added to config map
      • E2E tests passes
      • Pushed to stage
      • Pushed to production once validated working on stage

              Unassigned Unassigned
              chfan@redhat.com Kevin Chi Keen Fan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: