-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
3
-
False
-
-
False
-
No
-
-
WHAT
Service log now provides the cluster id as part of the cluster log [1]
{ "cluster_id": "205vf2vast6147tq4q0rdc0fa8tdjt6h", "cluster_uuid": "10a19c6c-189d-4a1d-8e58-a2ed3e4ac557", "created_at": "2022-11-23T17:01:41.945159Z", "created_by": "service-account-ocm-cs-staging", "description": "Add-on 'Red Hat Openshift API Management' was added and is awaiting installation", "email": "", "event_stream_id": "2HxNiSi35atx0N9zGtChIHRdHmo", "first_name": "", "href": "/api/service_logs/v1/cluster_logs/2HxNiQca6MErTzDfxtFF9Eask1G", "id": "2HxNiQca6MErTzDfxtFF9Eask1G", "internal_only": false, "kind": "ClusterLog", "last_name": "", "service_name": "ClusterService", "severity": "Info", "summary": "Add-on 'Red Hat Openshift API Management' is being installed", "timestamp": "2022-11-23T17:01:41Z", "username": "chfan_rhmi" }
OCM sendgrid service performs a call to find the cluster by cluster_uuid to get the cluster_id but this is no longer required now that service log provides this in the cluster log itself [2]. So we should remove this logic and use the cluster id from the cluster log directly
[1] https://gitlab.cee.redhat.com/service/ocm-service-log/-/merge_requests/268
[2] https://gitlab.cee.redhat.com/service/ocm-sendgrid-service/-/blob/master/pkg/services/webhook.go#L65-69
HOW
- Remove logic to find cluster by uuid
- Update cluster log examples with id
- Ensure tests passes
- Update documentation
TESTS
- Provision cluster
- Run service locally
- Verify secret is created / deleted using the addon install / uninstall logs targetting provisioned cluster
DONE
- Sendgrid service uses cluster_id from cluster_log directly