-
Task
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
-
8
-
False
-
-
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'
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