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
OCPBUGS-16684: Set cr.status.provisioned=false on syncErr path #583
OCPBUGS-16684: Set cr.status.provisioned=false on syncErr path #583
Conversation
@bentito: This pull request references Jira Issue OCPBUGS-16684, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. 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. |
@fxierh I think I could have fixed it with this change, but I'm not totally sure. If you can run this PR, set conditions again, and we'll see if it is fixed. If it's not fixed, I'll see how I can debug on this PR, perhaps with the STS workflow with clusterbot. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #583 +/- ##
==========================================
+ Coverage 48.15% 48.38% +0.23%
==========================================
Files 94 94
Lines 11543 11641 +98
==========================================
+ Hits 5558 5633 +75
- Misses 5377 5398 +21
- Partials 608 610 +2
|
@@ -688,20 +688,17 @@ func (r *ReconcileCredentialsRequest) Reconcile(ctx context.Context, request rec | |||
|
|||
var syncErr error | |||
syncErr = r.CreateOrUpdateOnCredsExist(ctx, credsExists, syncErr, cr) |
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.
When CR.spec.providerSpec.stsIAMRoleARN is unset, syncErr is still nil
cloud-credential-operator/pkg/aws/actuator/actuator.go
Lines 342 to 345 in 859de53
if awsSTSIAMRoleARN == "" { | |
logger.Debug("CredentialsRequest has no awsSTSIAMRoleARN, no reason to sync") | |
return nil | |
} |
So we fall into the else branch below where we call
cloud-credential-operator/pkg/operator/credentialsrequest/credentialsrequest_controller.go
Line 724 in 859de53
updateErr := r.UpdateProvisionedStatus(cr, true) |
In other words CR.status.provisioned is still set to true when CR.spec.providerSpec.stsIAMRoleARN is unset and there is no Secret provisioned.
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.
The comment above aligns with what I observed today in a test (on this PR).
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.
Thanks! I think my next commit fixes it then.
For debugging IMO you can try to install an STS cluster, scale down CVO & CCO and then run the controllers locally with the latest commit. |
Btw just wanted to check if you're planning to address the comment I left under https://issues.redhat.com/browse/OCPBUGS-16684 in this PR (or I can open another card for it if you want them to be separated) ? |
Yeah, that's basically what's happening with clusterbot, but with automation, but it's way slow for a quick test to see if I got something wrong or right. |
If you could make a new card about the |
if awsSTSIAMRoleARN == "" { | ||
logger.Debug("CredentialsRequest has no awsSTSIAMRoleARN, no reason to sync") | ||
return nil |
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.
I haven't tested your latest commit in action yet but it appears to me that:
if the stsIAMRoleARN field is unset, this awsSTSIAMRoleARN
string would be empty and err would be nil. So returning err would be equivalent to returning nil.
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.
Yep, new commit, didn't think that through very well. Thanks!
@bentito With the current implementation the .status field of CRs without .stsIAMRoleARN (e.g. the ones extracted via
Just wanted to make sure this is expected behavior. |
On the other hand, the aforementioned failing condition ( cloud-credential-operator/pkg/operator/credentialsrequest/status.go Lines 107 to 108 in 859de53
This makes me wonder if we should display Secret provision failures on CO/cloud-credential in STS mode just like in mint. |
Done. |
/test e2e-aws-ovn |
Co-authored-by: Andrew Butcher <abutcher@redhat.com>
I'll make a card for the CO level status. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abutcher, bentito 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 |
@abutcher |
Related to a recent change we made to the tests which should have made e2e-azure-manual-oidc required for changes which impact specific pathing but are instead making the test required. /override ci/prow/e2e-azure-manual-oidc |
@abutcher: Overrode contexts on behalf of abutcher: ci/prow/e2e-azure-manual-oidc 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. |
/test e2e-hypershift |
3 similar comments
/test e2e-hypershift |
/test e2e-hypershift |
/test e2e-hypershift |
@bentito: 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. |
@bentito: Jira Issue OCPBUGS-16684: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-16684 has been moved to the MODIFIED state. 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. |
I think this cures the bug as long as I tracked from the correct part of the code that was setting
cr.status.provisioned
to true despite a failure to actually provision the Secret.