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

sendgrid: cluster_uuid is not available in cluster uninstalling log

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • None
    • None
    • RHOAM Sprint 42

      WHY

      The cluster uninstalling cluster log does not provide a cluster_uuid field that is expected by sendgrid service. This causes sendgrid service to reject processing this request to mark clusters jobs for deletion for this event 

       

      I0612 18:31:35.740305       1 logger.go:84]  performing api request with details, url=https://api.sendgrid.com/v3/subusers method=GET [sendgrid=sendgrid_service_api_client]
      I0612 18:31:35.961270       1 logger.go:84] [opid=2R7ISqbapWZOaIszr2tXnU7QABh] {"request_method":"POST","request_url":"/api/ocm-sendgrid-service/v1/webhook","request_remote_ip":"10.129.12.22:53864"}
      {"cluster_id":"24ahbsq6niu400fntf9e2pl2e3sh8mun","cluster_uuid":"","created_at":"2023-06-12T18:31:30.912031454Z","created_by":"service-account-ocm-cs-staging","description":"Cluster '24ahbsq6niu400fntf9e2pl2e3sh8mun' starting uninstall process","email":"sd-devel@redhat.com","event_stream_id":"2R7ISHZR4aLnFrYdel1SiGe6A7V","first_name":"","href":"/api/service_logs/v1/cluster_logs/2R7ISGW4OwR6Wnf7UQTSmdIJykK","id":"2R7ISGW4OwR6Wnf7UQTSmdIJykK","internal_only":false,"kind":"ClusterLog","last_name":"","log_type":"","service_name":"ClusterService","severity":"Info","summary":"Cluster '24ahbsq6niu400fntf9e2pl2e3sh8mun' is being deleted","timestamp":"2023-06-12T18:31:30Z","username":"etabak_privileged_uhc_25022019"}
      I0612 18:31:35.963002       1 logger.go:84] [opid=2R7ISqbapWZOaIszr2tXnU7QABh] OCM-EX-8: cluster_uuid is required 

       

      WHAT
      As it seems cluster_uuid field can be empty sometimes, we should use the provided cluster_id field to mark jobs for deletion instead 

      HOW

      1. Update the validation to require "cluster_uuid" or "cluster_id" to be present in the cluster log received
        1. Request should fail validation if both are empty
      2. Update the deletion queries to mark jobs for deletion using the cluster_uuid or cluster_id
      3. e2e tests for these new scenarios

      TESTS

      • e2e tests should be sufficient

      DONE

      • Cluster logs with no cluster_uuid but with cluster_id is successfully processed by sendgrid service

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

                Created:
                Updated:
                Resolved: