ManageIQ / manageiq-providers-vmware

ManageIQ plugin for the VMware vSphere and vCloud providers.
Apache License 2.0
22 stars 70 forks source link

Continue refresh if cis_connect fails #917

Closed agrare closed 1 month ago

agrare commented 1 month ago

The CIS vsphere-automation endpoint allows us to get tags and content libraries that aren't present in the VIM API. If there is a failure connecting to this endpoint for whatever reason we shouldn't fail the rest of the refresh.

Fryguy commented 1 month ago

How will we know if it's having trouble connecting though? Is there like a warning we can issue in the UI or on the authentication? Maybe put refresh status to yellow? I didn't mind merging as is, but I am concerned this will "hide" real issues.

agrare commented 1 month ago

I can log a warning, I don't think we have a way to set the refresh status to "warning" though. We have last_refresh_error nil or present and the UI shows a warning if there are no errors but the last_refresh_date is > N days ago

miq-bot commented 1 month ago

Checked commit https://github.com/agrare/manageiq-providers-vmware/commit/1708722e25889c6ebb0f9c55e3131c0a614104d3 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 1 file checked, 0 offenses detected Everything looks fine. :trophy:

Fryguy commented 1 month ago

Might be interesting to have a last_refresh_warning and be able to show warning status. Or perhaps last_refresh_error plus success is interpreted as a warning.

This is fine for now though.

agrare commented 1 month ago

Yeah I was thinking we could replace last_refresh_error (which has the message) to last_refresh_status=success/error/warning and last_refresh_message

Fryguy commented 1 month ago

Backported to radjabov in commit e98c62e8b7ba1bc32c807cafb6233d78abb36925.

commit e98c62e8b7ba1bc32c807cafb6233d78abb36925
Author: Jason Frey <fryguy9@gmail.com>
Date:   Fri Jul 12 12:21:44 2024 -0400

    Merge pull request #917 from agrare/handle_cis_connect_failure

    Continue refresh if cis_connect fails

    (cherry picked from commit 097e54688200ae5de00e66108a3813709d0e221a)