-
Notifications
You must be signed in to change notification settings - Fork 58
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
⚠️ Update to k8s v0.30.1 #912
Conversation
Also requires update to controller-runtime Signed-off-by: Todd Short <tshort@redhat.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
uMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) | ||
if err != nil { | ||
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err)) | ||
return ctrl.Result{}, err | ||
} | ||
|
||
unstructuredObj := &unstructured.Unstructured{Object: uMap} | ||
if err := func() error { | ||
r.dynamicWatchMutex.Lock() | ||
defer r.dynamicWatchMutex.Unlock() | ||
|
||
_, isWatched := r.dynamicWatchGVKs[unstructuredObj.GroupVersionKind()] | ||
_, isWatched := r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] | ||
if !isWatched { | ||
if err := r.controller.Watch( | ||
source.Kind(r.cache, unstructuredObj), | ||
crhandler.EnqueueRequestForOwner(r.Scheme(), r.RESTMapper(), ext, crhandler.OnlyControllerOwner()), | ||
helmpredicate.DependentPredicateFuncs()); err != nil { | ||
source.Kind(r.cache, | ||
obj, | ||
crhandler.EnqueueRequestForOwner(r.Scheme(), r.RESTMapper(), ext, crhandler.OnlyControllerOwner()), | ||
helmpredicate.DependentPredicateFuncs())); err != nil { | ||
return err | ||
} | ||
r.dynamicWatchGVKs[unstructuredObj.GroupVersionKind()] = struct{}{} | ||
r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] = struct{}{} |
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.
There's a different version of this in: #905
https://github.com/operator-framework/operator-controller/pull/905/files#diff-a54f79b762054ccdc31e4011d28cce22af8f54d43e1fddc75745ce042f177f7e
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.
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.
Could we use the unstructured one for now and have this PR merged? #905 (comment)
Just curious if directly setting watches from typed objects would break anything, which is why suggesting the other option.
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.
+1 @varshaprasad96. I don't know for sure that using a structured type will break things, but I have at least some confidence that it might. So I think we should stick with the unstructured type for now.
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.
So, I tested this, with help from @joelanford, and it appears to work.
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
/approve
Also requires update to controller-runtime
This should clear the way for other updates (that require k8s)
Description
Reviewer Checklist