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

Check that target version is set #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lizard-boy
Copy link

Upgrade state can be erased in NSX due to various reasons, e.g restoration from backup. In this case the TF state could allow execution of the nsxt_upgrade_run resource even though there is no ongoing backup.
This case should be properly handled instead of failing with a SIGSEGV.

Upgrade state can be erased in NSX due to various reasons, e.g restoration from backup.
In this case the TF state could allow execution of the nsxt_upgrade_run resource even though
there is no ongoing backup.
This case should be properly handled instead of failing with a SIGSEGV.

Signed-off-by: Kobi Samoray <[email protected]>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds a nil check for the target version in the nsxt_upgrade_run resource to handle cases where the upgrade state has been erased in NSX.

  • Added error handling in getTargetVersion function when obj.TargetVersion is nil
  • Prevents potential SIGSEGV errors by returning a descriptive error message
  • Improves robustness of the upgrade process when NSX state is inconsistent
  • Suggests restarting the upgrade process with a clean state when target version is missing

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants