Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't assume driver isn't nil in StepConnect #437

Merged
merged 2 commits into from
Jun 12, 2024

Commits on May 17, 2024

  1. common/connect: don't assume driver isn't nil

    When attempting to cleanup the existing connections to the VSphere
    cluster, we get the driver from the state shared between all steps in
    order to run the commands necessary for that.
    
    This can however fail, if the step couldn't succeed for any reason.
    
    Then, if the connection fails and the driver isn't set in the state,
    when running Cleanup on the connect step, we get the driver from state
    and cast it to a driver.Driver.
    This will make the plugin crash, and so we change how we proceed here,
    by getting the driver with a `GetOk`, exiting if it failed to be fetched
    from state, then casting the result if it was created in state.
    
    This should prevent crashes like those.
    lbajolet-hashicorp committed May 17, 2024
    Configuration menu
    Copy the full SHA
    4b8312a View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. Apply suggestions from code review

    Co-authored-by: Ryan Johnson <johnsonryan@vmware.com>
    nywilken and tenthirtyam authored Jun 12, 2024
    Configuration menu
    Copy the full SHA
    52f75ba View commit details
    Browse the repository at this point in the history