-
Notifications
You must be signed in to change notification settings - Fork 60
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
✨ remove unnecessary flag, optimize catalog watch handler, stop watching non-existent unpack pods #941
✨ remove unnecessary flag, optimize catalog watch handler, stop watching non-existent unpack pods #941
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import ( | |
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/apimachinery/pkg/util/rand" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
crfinalizer "sigs.k8s.io/controller-runtime/pkg/finalizer" | ||
|
||
"github.com/operator-framework/operator-registry/alpha/declcfg" | ||
"github.com/operator-framework/operator-registry/alpha/property" | ||
|
@@ -116,6 +117,7 @@ func TestClusterExtensionRegistryV1DisallowDependencies(t *testing.T) { | |
ActionClientGetter: helmClientGetter, | ||
Unpacker: unpacker, | ||
InstalledBundleGetter: mockInstalledBundleGetter, | ||
Finalizers: crfinalizer.NewFinalizers(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit disconcerting to me that so much of the
If we had that setup, we wouldn't actually need to configure the ClusterExtension reconciler any differently. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More immediately, we should have unit tests that make sure finalizers are actually being handled properly during reconcile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is definitely up for discussion and needs separate set of effort. The whole point of these unit tests is to make sure that the reconciler code path traversed during various instances is as expected. Which is why we ensure that the mock unpacker returns quickly as expected. The code coverage for unpacking and storage has separate unit tests (currently in rukpak). I'm not sure if we immediately need to focus on this - rather if possible try finishing up #879 as immediately as possible (even if it requires us to mock some of the components) to ensure we don't skip any nuances in the reconciler code. |
||
} | ||
|
||
installNamespace := fmt.Sprintf("test-ns-%s", rand.String(8)) | ||
|
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.
Since we're on it - we should also be able to remove the rbac to watch pods:
operator-controller/internal/controllers/clusterextension_controller.go
Lines 105 to 107 in cb63023
If not in this PR, it can be done in follow up too
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 can do it 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.
Pushed a change. I removed the pods stuff, and changed the configmaps RBAC (what was that for?) to secrets since the helm stuff needs to manage release secrets.
It's all sorta moot though because:
*/*/*
in the next line.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 think it may have gotten ported over from Extension, where Kapp needed CRUD permissions for configmaps.