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

Finalizers added after first read operation on AWS in AWSMachines #2601

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

shivi28
Copy link
Contributor

@shivi28 shivi28 commented Jul 26, 2021

What type of PR is this?
/kind bug

What this PR does / why we need it:
Update finalizer addition logic for AWSMachine. If we apply AWS workload cluster yaml with invalid credentials, then AWSMachine object is created and stuck because of invalid credentials. Once we try to delete that yaml, AWSMachine object stuck. So adding finalizer in AWSMachine only after first successful AWS read operation.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2270

Special notes for your reviewer:
With this change AWSMachine object is deleted in case of invalid credentials, same needs to be done for AWSCluster. WIP because AWSCluster finalizer updation requires a bit of refactoring in reconciliation logic

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

AWSMachine objects successfully deleted in case of invalid credentials

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Jul 26, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 26, 2021
@randomvariable
Copy link
Member

Need to update the tests appropriately, as the logic has changed.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 28, 2021
@shivi28 shivi28 changed the title [WIP] Finalizers added after first read operation on AWS in AWSMachines Finalizers added after first read operation on AWS in AWSMachines Jul 28, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 28, 2021
@randomvariable
Copy link
Member

/lgtm
/priority important-soon

/assign @sedefsavas for another set of 👁️ and approval

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Jul 28, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 28, 2021
@sedefsavas
Copy link
Contributor

One problem might be: this does not solve the case where the credentials were valid initially (the first findInstance() call succeeded), then for example it expired.

I don't think there is an easy solution for this.

@randomvariable
Copy link
Member

randomvariable commented Jul 29, 2021

No probably not. I don't think there's much more we can do here without modelling a more complex state machine. It at least unblocks the most trivial use case.

@sedefsavas
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7f4ff45 into kubernetes-sigs:main Jul 29, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.7.0 milestone Jul 29, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWSMachine cannot be removed if controller is installed with invalid credentials
4 participants