⚠️ 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.
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.
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.
+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.
So, I tested this, with help from @joelanford, and it appears to work.
Also requires update to controller-runtime
This should clear the way for other updates (that require k8s)
Description
Reviewer Checklist