-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix memory optimisation feature after upgrade to controller-runtime v0.14.5 #1543
Conversation
/assign @saschagrunert |
/retest |
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.
Thank you!
|
…0.14.5 It seems that BuilderWithOptins has introduced a bug when combining the options provided by the cluster with the custom options, which breaks the memory optimization feature. BuilderWithOptions creates a new scheme object which is configured in the cache object but not in the cluster object where the original scheme object is maintained. This means that the registered schemes in the cluster scheme are not reflected into the cache. This prevents the controller from starting with error messages such as: E0314 10:44:24.541264 1302480 source.go:146] controller-runtime/source "msg"="kind must be registered to the Scheme" "error"="no kind is registered for the type v1beta1.SeccompProfile in scheme \"pkg/runtime/scheme.go:100\""
3f58734
to
42f4bf4
Compare
/test all |
1 similar comment
/test all |
@saschagrunert All tests passed, please could you lgtm this again? Thanks |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ccojocar, JAORMX, saschagrunert 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
It seems that after upgrading to
controller-runtime
v0.14.5
, theBuilderWithOptins
function has introduced a bug when combiningthe options provided by the cluster with the custom options, which breaks the memory optimization feature.
BuilderWithOptions
function creates a new scheme object which is configured in the cache object, but not into the cluster objectwhere the original scheme object is maintained. This means that the registered schemes in the cluster scheme are not reflected
into the cache scheme. This prevents the controller from starting with this error messages:
The issue was introduced by 892ee33.
It seems that our e2e test for memory optimization didn't catch the issue
security-profiles-operator/test/tc_memoptm_test.go
Line 19 in 98d0e09
I think because we just test the start-up but in this case the spod pods got restarted after 1-2 minutes and keep restarting because of the registration issue.
Which issue(s) this PR fixes:
Does this PR have test?
Yes
Special notes for your reviewer:
Does this PR introduce a user-facing change?