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

🐛 On deletion, should ignore if the secret cannot be found #4557

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Oct 9, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

E1009 14:38:14.462868   54510 logger.go:83] "unable to delete machine" err="failed to get raw userdata: failed to retrieve bootstrap data secret for AWSMachine openshift-cluster-api-guests/vpri-4ll2w-master-0: Secret \"vpri-4ll2w-master\" not found"
E1009 14:38:14.463556   54510 controller.go:324] "Reconciler error" err="failed to get raw userdata: failed to retrieve bootstrap data secret for AWSMachine openshift-cluster-api-guests/vpri-4ll2w-master-0: Secret \"vpri-4ll2w-master\" not found" controller="awsmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachine" AWSMachine="openshift-cluster-api-guests/vpri-4ll2w-master-0" namespace="openshift-cluster-api-guests" name="vpri-4ll2w-master-0" reconcileID="5feec441-59f3-41f8-aaac-a0eddf5c1952"

If a Machine fails to bootstrap due to a problem with the bootstrap secret (which is generated separately), when the AWSMachine tries to delete the machine, it can get stuck trying to find that secret. Ignore not found errors.

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 #

Special notes for your reviewer:

Checklist:

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

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 9, 2023
@k8s-ci-robot k8s-ci-robot added needs-priority size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 9, 2023
@vincepri
Copy link
Member Author

vincepri commented Oct 9, 2023

/assign @JoelSpeed @richardcase @Skarlso

@Skarlso
Copy link
Contributor

Skarlso commented Oct 10, 2023

I swear I've seen this one before. 🤣🤣

@@ -777,7 +777,7 @@ func (r *AWSMachineReconciler) ignitionUserData(scope *scope.MachineScope, objec

func (r *AWSMachineReconciler) deleteBootstrapData(machineScope *scope.MachineScope, clusterScope cloud.ClusterScoper, objectStoreScope scope.S3Scope) error {
_, userDataFormat, err := machineScope.GetRawBootstrapDataWithFormat()
if err != nil {
if client.IgnoreNotFound(err) != nil {
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent across, can we use apierrors.IsNotFound(err) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We added this in controller runtime to be easier for folks to deal with, I don't have a strong opinion on either; but this requires one less import in general, and it's a bit easier to read

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense 👍

@Ankitasw
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-blocking

@Ankitasw
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitasw

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 Oct 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit f88f0fa into kubernetes-sigs:main Oct 12, 2023
11 checks passed
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. needs-priority release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants