Skip to content

Conversation

@ajaggapa
Copy link
Contributor

@ajaggapa ajaggapa commented Jan 7, 2026

Is this a BUG FIX or a FEATURE ?: add new e2e test case

Uncomment only one, leave it on its own line:

/kind bug
/kind cleanup
/kind feature
/kind design
/kind flake
/kind failing
/kind documentation
/kind regression

What this PR does / why we need it: Migrating two tests from https://github.com/rh-ecosystem-edge/eco-gotests/blob/074dcb73d119b91a6b01dff02e4998bfe50db0e7/tests/cnf/core/network/metallb/tests/bgp-tests.go#L144-L180

Special notes for your reviewer:

Release note:

NONE

@ajaggapa ajaggapa force-pushed the logleveltests branch 2 times, most recently from 9907ea4 to fed73b1 Compare January 7, 2026 13:50
Copy link
Member

@oribon oribon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! a few small comments

Comment on lines 813 to 820
err = testclient.Client.Get(context.Background(), goclient.ObjectKey{Namespace: metallb.Namespace, Name: metallb.Name}, metallb)
if !errors.IsNotFound(err) {
Expect(err).ToNot(HaveOccurred())
metallbutils.DeleteAndCheck(metallb)
// Get a fresh object after deletion to avoid ResourceVersion issues
metallb, err = metallbutils.Get(OperatorNameSpace, UseMetallbResourcesFromFile)
Expect(err).ToNot(HaveOccurred())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have this logic (starting from a clean state) in a BeforeEach?

}

Expect(testclient.Client.Create(context.Background(), metallb)).Should(Succeed())
defer metallbutils.DeleteAndCheck(metallb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we clean in AfterEach instead of this defer?

Comment on lines 831 to 836
By("Fetch controller pods from metallb-system namespace")
controllerPods, err := testclient.Client.Pods(OperatorNameSpace).List(context.Background(), metav1.ListOptions{
LabelSelector: "component=controller",
})
Expect(err).ToNot(HaveOccurred(), "Failed to list controller pods")
Expect(len(controllerPods.Items)).Should(BeNumerically(">", 0), "Controller Pods List should not be empty")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have this (and the speaker one) in a func?

@ajaggapa
Copy link
Contributor Author

@oribon I have addressed your comments. Also i updated webhook error message for bgpBackend. Please check.

@oribon
Copy link
Member

oribon commented Jan 12, 2026

Also i updated webhook error message for bgpBackend.

can you put it in a different commit please? 😅


// GetMetalLBPods fetches pods for a given MetalLB component (controller or speaker)
// and validates that the list is not empty
func GetMetalLBPods(namespace string, component string) *v1.PodList {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split this to two functions (speaker, controller)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. ptal

@ajaggapa ajaggapa force-pushed the logleveltests branch 4 times, most recently from 9c76614 to d6f3a4a Compare January 12, 2026 10:39
@ajaggapa
Copy link
Contributor Author

can you put it in a different commit please?

Updated

@ajaggapa ajaggapa force-pushed the logleveltests branch 2 times, most recently from 82f942b to 6e93720 Compare January 12, 2026 11:58
- Add tests to verify logLevel default and debug

Signed-off-by: Anvesh J <[email protected]>
Copy link
Member

@oribon oribon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@oribon oribon added this pull request to the merge queue Jan 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 13, 2026
@oribon oribon merged commit 5d03b1f into metallb:main Jan 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants