-
Notifications
You must be signed in to change notification settings - Fork 4.8k
NE-906: fix DCM tests #30734
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
Merged
openshift-merge-bot
merged 1 commit into
openshift:main
from
jcmoraisjr:NE-906-fix-dcm-test
Feb 27, 2026
Merged
NE-906: fix DCM tests #30734
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import ( | |
| "k8s.io/apimachinery/pkg/util/intstr" | ||
| "k8s.io/apimachinery/pkg/util/wait" | ||
| e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output" | ||
| "k8s.io/pod-security-admission/api" | ||
| utilpointer "k8s.io/utils/pointer" | ||
|
|
||
| routev1 "github.com/openshift/api/route/v1" | ||
|
|
@@ -46,12 +47,9 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:route.openshift.io]", | |
| } | ||
| }) | ||
|
|
||
| oc = exutil.NewCLI("router-config-manager") | ||
| oc = exutil.NewCLIWithPodSecurityLevel("router-config-manager", api.LevelPrivileged) | ||
|
|
||
| g.BeforeEach(func() { | ||
| // the test has been skipped since July 2018 because it was flaking. | ||
| // TODO: Fix the test and re-enable it in https://issues.redhat.com/browse/NE-906. | ||
| g.Skip("HAProxy dynamic config manager tests skipped in 4.x") | ||
| ns = oc.Namespace() | ||
|
|
||
| routerImage, err := exutil.FindRouterImage(oc) | ||
|
|
@@ -89,8 +87,8 @@ daemon off; | |
| events { } | ||
| http { | ||
| server { | ||
| listen 8443; | ||
| ssl on; | ||
| listen 8443 ssl; | ||
| listen [::]:8443 ssl; | ||
| ssl_certificate /etc/serving-cert/tls.crt; | ||
| ssl_certificate_key /etc/serving-cert/tls.key; | ||
| server_name "*.svc"; | ||
|
|
@@ -350,6 +348,10 @@ http { | |
| }, | ||
| }, | ||
| }, | ||
| { | ||
| Name: "ROUTER_IP_V4_V6_MODE", | ||
| Value: "v4v6", | ||
| }, | ||
| }, | ||
| Args: []string{ | ||
| "--namespace=$(POD_NAMESPACE)", | ||
|
|
@@ -462,7 +464,7 @@ http { | |
| Name: "cert", | ||
| VolumeSource: corev1.VolumeSource{ | ||
| Secret: &corev1.SecretVolumeSource{ | ||
| SecretName: "service-cert", | ||
| SecretName: "serving-cert", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
@@ -491,9 +493,6 @@ http { | |
|
|
||
| g.Describe("The HAProxy router", func() { | ||
| g.It("should serve the correct routes when running with the haproxy config manager", func() { | ||
| // the test has been skipped since July 2018 because it was flaking. | ||
| // TODO: Fix the test and re-enable it in https://issues.redhat.com/browse/NE-906. | ||
| g.Skip("HAProxy dynamic config manager tests skipped in 4.x") | ||
| ns := oc.KubeFramework().Namespace.Name | ||
| execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") | ||
| defer func() { | ||
|
|
@@ -532,7 +531,10 @@ http { | |
| for i := 0; i < 16; i++ { | ||
| name := fmt.Sprintf("hapcm-stress-insecure-%d", i) | ||
| hostName := fmt.Sprintf("stress.insecure-%d.hapcm.test", i) | ||
| err := oc.AsAdmin().Run("expose").Args("service", "insecure-service", "--name", name, "--hostname", hostName, "--labels", "select=haproxy-cfgmgr").Execute() | ||
| err := oc.AsAdmin().Run("expose").Args("service", "insecure-service", "--name", name, "--hostname", hostName).Execute() | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| // --labels on `oc expose` (above) does not override the ones coming from service's selector. | ||
| err = oc.AsAdmin().Run("label").Args("route", name, "select=haproxy-cfgmgr").Execute() | ||
|
Comment on lines
+536
to
+537
Contributor
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. For reference, that's OCPBUGS-74543, right?
Member
Author
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. Exactly, and this implementation is the one that helped me to catch it. |
||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
|
|
||
| err = waitForRouteToRespond(ns, execPod.Name, "http", hostName, "/", routerIP, 0) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What specific router operations require privileged mode? This should be documented at least in a code comment
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.
As we talked, #30741 is built on top of this branch, and I'll describe the reason we are using privileged namespace for the router.