-
Notifications
You must be signed in to change notification settings - Fork 545
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
Move install plan e2e to one namespace per spec #2708
Move install plan e2e to one namespace per spec #2708
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva 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 |
a99e366
to
37649c9
Compare
37649c9
to
2ed7ea4
Compare
2ed7ea4
to
5800775
Compare
@perdasilva I'm going to pull this down locally and now and push to your remote if there's any requisite changes that need to be made. |
2bd4932
to
2a290de
Compare
@perdasilva I had a second to pull down the latest change and it looks like we're still leaking resources. I think I'm at the point with these PRs where we should be more interested in ensuring we aren't leaking namespaces to avoid scope creep with an already large effort. How do you feel about pushing this through, and tracking this resource leakage separately? Edit: maybe the A/C for this type of effort, at least from the reviewer side-of-things, is to ensure there are zero references to the global |
@@ -12,6 +12,8 @@ import ( | |||
"time" | |||
|
|||
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" | |||
k8serror "k8s.io/apimachinery/pkg/api/errors" |
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.
nit: it would be nice to standardize import naming conventions at some point. This can be enforced by introducing more configuration through golangci-lint's importas linter like we currently do with rukpak.
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.
Maybe we could add a ticket to the CI epic?
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.
Yep - sounds reasonable to me.
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.
Updated the Epic and added a ticket for this. Opened #2715 since then that tackles that kind of linting enforcement.
csv := newCSV(packageStable, ns.GetName(), "", semver.MustParse("0.1.0"), []apiextensions.CustomResourceDefinition{crd}, nil, nil) | ||
|
||
defer func() { | ||
Eventually(func() error { | ||
return ctx.Ctx().KubeClient().ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crd.GetName(), metav1.DeleteOptions{}) |
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.
nit: context.TODO -> context.Background.
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.
nit: return client.IgnoreNotFound(...)
so we can avoid having to use any complex gomega matching expressions?
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 realize I'm making the assumption that this is client utility is still applicable for non-controller-runtime clients)
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.
Fixed. Looking at the implementation of IgnoreNotFound
it's exactly what you'd expect lol ^^ so should work with any err
apiextensionsv1.AddToScheme, | ||
kscheme.AddToScheme, | ||
operatorsv1alpha1.AddToScheme, | ||
operatorsv1.AddToScheme, | ||
operatorsv2.AddToScheme, | ||
apiextensionsv1.AddToScheme, | ||
apiextensions.AddToScheme, | ||
) |
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.
Nice catch.
@@ -418,6 +444,10 @@ var _ = Describe("Install Plan", func() { | |||
Succeed(), | |||
WithTransform(k8serrors.IsNotFound, BeTrue()), | |||
)) | |||
Expect(ctx.Ctx().Client().Delete(context.Background(), plan)).To(Or( |
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.
nit: wrap this with client.IgnoreNotFound(...) to avoid having to enforce this through gomega expressions?
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.
Fixed
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'm still seeing it's using the gomega expressions?
|
||
It("UpdatePreexistingCRDFailed", func() { | ||
|
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.
super off topic: we really need to refactor these top-level It specs (that also deserve a more descriptive name).
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.
One more ticket for the CI epic =D
@perdasilva One more thing: I think this is ready to go from my perspective, but I want to make sure we're aligned with what I had described in #2708 (comment) before we push this through. |
Yeah, I'm good with that. There are tests that might still require the |
Signed-off-by: perdasilva <perdasilva@redhat.com>
2a290de
to
ff414e5
Compare
Holding just in case we need another reviewer. /lgtm |
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
Signed-off-by: perdasilva perdasilva@redhat.com
Description of the change:
This PR moves the install plan e2e to one namespace per spec
Motivation for the change:
e2e stability
Reviewer Checklist
/doc
[FLAKE]
are truly flaky[FLAKE]
tag are no longer flaky