-
Notifications
You must be signed in to change notification settings - Fork 24
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
Bump controller-runtime, k8s libraries, openshift/library go, adjust CO to the new versions #337
Bump controller-runtime, k8s libraries, openshift/library go, adjust CO to the new versions #337
Conversation
/test e2e-aws-parallel |
1 similar comment
/test e2e-aws-parallel |
The parallel test failure could be related to the dependency bump:
The test times out after 30 minutes waiting for the remediation to error out, which it does to some extent, but doesn't register the remeidation state. |
hmm, that test passes locally when I run that test only. But the last three CI runs of this PR fail always on that single test. Running more tests locally. |
hmm all the parallel tests are passing locally. I'm going to re-run the tests again and watch them interactively to try and catch the error.. |
/test e2e-aws-parallel |
I /think/ I managed to catch the issue:
I guess the problem is that this should not be a |
/hold |
@@ -219,7 +219,7 @@ func (r *ReconcileComplianceRemediation) reconcileRemediation(instance *compv1al | |||
return common.NewNonRetriableCtrlError( | |||
"Unable to get fix object from ComplianceRemediation. "+ | |||
"Please update the compliance-operator's permissions: %w", err) | |||
} else if runtime.IsNotRegisteredError(err) || meta.IsNoMatchError(err) { | |||
} else if runtime.IsNotRegisteredError(err) || meta.IsNoMatchError(err) || (err != nil && strings.Contains(err.Error(), "the server could not find the requested resource")) { |
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.
OK, so this is the ugly workaround. I cannot for the life of me figure out how to catch the proper error. In the error string chain I see unable to retrieve the complete list of server APIs
which would suggest the error is ErrGroupDiscoveryFailed
which should be testable for with IsGroupDiscoveryFailedError
from k8s.io/client-go/discovery/discovery_client.go
but that doesn't seem to work for me. Which is especially odd with go 1.20 where errors.Is
should even work across wrapped errors. I'll continue trying to get to the root of the issue, but as the worst case solution, maybe this workaround would at least pass CI.
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.
Looks like it worked for CI at least.
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.
Strange - after looking at the implementation in client-go
I'm not sure why we wouldn't be able to use:
IsGroupDiscoveryFailedError(err)
Did you happen to check the type when you were poking at this?
…manager version In order to use the latest release of controller-manager we need to use the new style of setting up controller loops that uses ctrl.NewControllerManagedBy() and then the builder pattern instead of adding c.Watch for each resource. The tests had to be adjusted, too, to specifically name resources that can update its status.
This is pretty much fluxcd/flux2@aa65589 reused. The new controller-runtime version requires that the logger is set or else there's a stack trace printed. Since even the original code doesn't use any logger for tests, let's just use null logger with the new version as well.
I included the patch from PR #370 as a separate patch because go mod tidy was also needed and squashing would be too messy. |
/test e2e-aws-parallel |
I'm fine merging this for now and cleaning up the error after so we can at least get updated dependencies. But, yeah, that is odd... |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhrozek, rhmdnd 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 |
Adding other appropriate labels since this is a dep bump. |
Making sure @Vincent056 and @yuumasato have an opportunity to take a look at this before we remove the hold. |
@rhmdnd Thanks. LGTM, based on my little knowledge of Go and the operator. |
Getting this merged so we can cleanup the dep bump patches. |
Adjust CO reconcile loop setup and unit tests for the new controller-manager version
In order to use the latest release of controller-manager we need to use
the new style of setting up controller loops that uses
ctrl.NewControllerManagedBy() and then the builder pattern instead of
adding c.Watch for each resource.
The tests had to be adjusted, too, to specifically name resources that
can update its status.