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

Ensuring the SG cleanup in case of error when creating the instance #179

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

bdematte
Copy link
Contributor

@bdematte bdematte commented Apr 20, 2023

What does this PR do? / Related Issues / Jira

Bug fix for OSD-16076
In case we got an error and we couldn't create the EC2 instance, we should still clean the SG up in case we created one so skipping the log analysis and the TerminateInstace but continuing the function to cleanup the SG.
This is only a first part of the fix (even though it should be the most common case we are facing) - we still need to better handle the error case inside the 'CreateSecurityGroup' function itself.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have tested the functionality against gcp / aws, it doesn't cause any regression
  • I have added execution results to the PR's readme

Reviewer's Checklist

  • (This needs to be done after technical review) I've run the branch on my local, verified that the functionality is ok

How to test this PR locally / Special Instructions

Logs

@openshift-ci openshift-ci bot requested review from abyrne55 and ritmun April 20, 2023 16:03
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2023

Codecov Report

Merging #179 (946f507) into main (b33fd4c) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
- Coverage   10.11%   10.10%   -0.01%     
==========================================
  Files          17       17              
  Lines        1137     1138       +1     
==========================================
  Hits          115      115              
- Misses       1012     1013       +1     
  Partials       10       10              
Impacted Files Coverage Δ
pkg/verifier/aws/entry_point.go 0.00% <0.00%> (ø)

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2023

@bdematte: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@abyrne55 abyrne55 left a comment

Choose a reason for hiding this comment

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

/label tide/merge-method-squash
/lgtm

Tested locally by creating an IAM user with a policy that allows everything the verifier needs, except for RunInstances. This triggered the newly-added error handler, which I've confirmed deletes the verifier's security group.

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 21, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 21, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abyrne55, bdematte

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit 4664a8b into openshift:main Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants