-
Notifications
You must be signed in to change notification settings - Fork 578
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
Do not return error if secret does not exist #3805
Do not return error if secret does not exist #3805
Conversation
pkg/cloud/scope/machine.go
Outdated
@@ -275,6 +276,10 @@ func (m *MachineScope) GetRawBootstrapDataWithFormat() ([]byte, string, error) { | |||
secret := &corev1.Secret{} | |||
key := types.NamespacedName{Namespace: m.Namespace(), Name: *m.Machine.Spec.Bootstrap.DataSecretName} | |||
if err := m.client.Get(context.TODO(), key, secret); err != nil { | |||
if apierrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enxebre is it possible to add a unit test for the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also add a debug log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enxebre can these comments be taken care of?
I agree with the goal of the PR. However, Moreover, we want to return an error to indicate that the first return parameter should not be used. @enxebre, what if this function continue to return an error, and any caller that wants to ignore the NotFound error can check for it? |
The non existence of the bootstrap secret should not prevent an awsMachine from being deleted
ab56ca7
to
cbb7032
Compare
@dlipovetsky update PTAL. |
cc @Ankitasw |
@enxebre could you please take care of open comment? |
@enxebre would you be able to continue with this PR? |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
All comments have been addressed via #3805 (comment) |
/milestone v2.2.0 |
/lgtm |
@muraee: changing LGTM is restricted to collaborators In response to this:
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. |
/approve |
[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 |
/lgtm |
/cherry-pick release-2.1.4 |
@enxebre: cannot checkout In response to this:
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-sigs/prow repository. |
We currently need to keep old userdata secrets in AWS < 4.16 to prevent machineDeployments rollout from failing to delete old Machines. https://github.com/openshift/hypershift/blob/3efa23b932a59681346a7a432d349cfb6e44b13d/hypershift-operator/controllers/nodepool/nodepool_controller.go#L775-L777 kubernetes-sigs/cluster-api-provider-aws#3805 We regress that behaviour here openshift#3969 This PR fixes that by statically checking the hc release version.
We currently need to keep old userdata secrets in AWS < 4.16 to prevent machineDeployments rollout from failing to delete old Machines. https://github.com/openshift/hypershift/blob/3efa23b932a59681346a7a432d349cfb6e44b13d/hypershift-operator/controllers/nodepool/nodepool_controller.go#L775-L777 kubernetes-sigs/cluster-api-provider-aws#3805 We regress that behaviour here openshift#3969 This PR fixes that by statically checking the hc release version.
We currently need to keep old userdata secrets in AWS < 4.16 to prevent machineDeployments rollout from failing to delete old Machines. https://github.com/openshift/hypershift/blob/3efa23b932a59681346a7a432d349cfb6e44b13d/hypershift-operator/controllers/nodepool/nodepool_controller.go#L775-L777 kubernetes-sigs/cluster-api-provider-aws#3805 We regress that behaviour here openshift#3969 This PR fixes that by statically checking the hc release version.
We currently need to keep old userdata secrets in AWS < 4.16 to prevent machineDeployments rollout from failing to delete old Machines. https://github.com/openshift/hypershift/blob/3efa23b932a59681346a7a432d349cfb6e44b13d/hypershift-operator/controllers/nodepool/nodepool_controller.go#L775-L777 kubernetes-sigs/cluster-api-provider-aws#3805 We regress that behaviour here openshift#3969 This PR fixes that by statically checking the hc release version.
We currently need to keep old userdata secrets in AWS < 4.16 to prevent machineDeployments rollout from failing to delete old Machines. https://github.com/openshift/hypershift/blob/3efa23b932a59681346a7a432d349cfb6e44b13d/hypershift-operator/controllers/nodepool/nodepool_controller.go#L775-L777 kubernetes-sigs/cluster-api-provider-aws#3805 We regress that behaviour here openshift#3969 This PR fixes that by statically checking the hc release version.
What type of PR is this?
The non existence of the bootstrap secret should not prevent an awsMachine from being deleted
What this PR does / why we need it:
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:
This change in behaviour was most likely introduced during the ignition support introduction
https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/2271/files#diff-4f8240f4e7ff07dcfa9627342b62772c1fe6ae0943021abe53fbb966db88886e
https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/2271/files#diff-0b559bbd149f0e6d54d789235423f66fa8906fdc6ee9c99b9e85db912912011e
Checklist:
Release note: