Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
244 changes: 122 additions & 122 deletions go.mod

Large diffs are not rendered by default.

430 changes: 210 additions & 220 deletions go.sum

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pkg/clioptions/clusterdiscovery/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (

// these are loading important global flags that we need to get and set
_ "k8s.io/kubernetes/test/e2e"
_ "k8s.io/kubernetes/test/e2e/lifecycle"
)

func InitializeTestFramework(context *e2e.TestContextType, config *ClusterConfiguration, dryRun bool) error {
Expand Down
4 changes: 2 additions & 2 deletions test/extended/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ spec:
}
o.Expect(readyWorkerNode).NotTo(o.BeEmpty(), "No ready worker node found")

err = oc.AsAdmin().Run("debug").Args("node/"+readyWorkerNode, "--image="+image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"), "--keep-labels=true", "--preserve-pod=true", "--", "sleep", "1").Execute()
err = oc.AsAdmin().Run("debug").Args("node/"+readyWorkerNode, "--image="+image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"), "--keep-labels=true", "--preserve-pod=true", "--", "sleep", "1").Execute()
pods, err := oc.AdminKubeClient().CoreV1().Pods(ns).List(context.TODO(), metav1.ListOptions{LabelSelector: "debug.openshift.io/managed-by=oc-debug"})
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(pods.Items).To(o.HaveLen(1))
Expand All @@ -335,7 +335,7 @@ spec:
})
o.Expect(err).NotTo(o.HaveOccurred(), "Expected debug pod to be deleted")

err = oc.AsAdmin().Run("debug").Args("node/"+readyWorkerNode, "--image="+image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"), "--preserve-pod=true", "--", "sleep", "1").Execute()
err = oc.AsAdmin().Run("debug").Args("node/"+readyWorkerNode, "--image="+image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"), "--preserve-pod=true", "--", "sleep", "1").Execute()

// Tests the code fix in https://github.com/openshift/oc/pull/2074
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion test/extended/cpu_partitioning/crio.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func collectContainerInfo(ctx context.Context, oc *exutil.CLI, node corev1.Node,
info := []crioContainerData{}
err = retry.OnError(backoff, shouldRetryExec,
func() error {
out, outStdErr, execErr := e2epod.ExecWithOptions(oc.KubeFramework(), execOptions)
out, outStdErr, execErr := e2epod.Exec(oc.KubeFramework().TContext(context.Background()), execOptions)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- cpu_partitioning/crio.go: surrounding function ---'
sed -n '330,400p' test/extended/cpu_partitioning/crio.go

printf '%s\n' '--- gpu_validator.go: relevant declarations and call sites ---'
sed -n '1,125p' test/extended/node/dra/nvidia/gpu_validator.go
sed -n '285,375p' test/extended/node/dra/nvidia/gpu_validator.go

printf '%s\n' '--- context and execution call structure ---'
rg -n -C 4 'context\.Background\(\)|TContext\(|e2epod\.Exec\(' \
  test/extended/cpu_partitioning/crio.go \
  test/extended/node/dra/nvidia/gpu_validator.go

Repository: openshift/origin

Length of output: 14554


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- exact enclosing function signatures ---'
python3 - <<'PY'
from pathlib import Path
targets = [
    Path("test/extended/cpu_partitioning/crio.go"),
    Path("test/extended/node/dra/nvidia/gpu_validator.go"),
]
for path in targets:
    lines = path.read_text().splitlines()
    wanted = {375, 50, 98, 326, 356}
    print(f"--- {path} ---")
    for n in sorted(wanted):
        if n > len(lines):
            continue
        start = max(0, n - 45)
        while start > 0 and not lines[start].lstrip().startswith(("func ", "var ", "const ")):
            start -= 1
        print(f"site line {n}; context starts at {start + 1}")
        for i in range(start, min(len(lines), n + 2)):
            print(f"{i+1}: {lines[i]}")
PY

printf '%s\n' '--- all TContext definitions and related context helpers ---'
rg -n -C 5 'func .*TContext|TContext\(' --glob '*.go' .

printf '%s\n' '--- context.Background usage in the affected files ---'
rg -n -C 2 'context\.Background\(\)|\bctx\b' \
  test/extended/cpu_partitioning/crio.go \
  test/extended/node/dra/nvidia/gpu_validator.go

Repository: openshift/origin

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- enclosing signatures from the previous log ---'
sed -n '1,220p' /tmp/coderabbit-shell-logs/shell-output-GDzRTl

printf '%s\n' '--- TContext implementation locations ---'
rg -l 'func .*TContext' vendor/k8s.io/kubernetes/test/e2e vendor/k8s.io/kubernetes/test -g '*.go' | head -20
rg -n -C 12 '^func \(.*\) TContext|^func TContext' vendor/k8s.io/kubernetes/test/e2e/framework vendor/k8s.io/kubernetes/test -g '*.go' | head -120

printf '%s\n' '--- affected call sites and method declarations only ---'
rg -n '^(func |[[:space:]]*stdout, stderr, err := e2epod\.Exec|[[:space:]]*out, outStdErr, execErr := e2epod\.Exec)' \
  test/extended/cpu_partitioning/crio.go \
  test/extended/node/dra/nvidia/gpu_validator.go

Repository: openshift/origin

Length of output: 26230


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Framework.TContext implementation ---'
sed -n '174,200p' vendor/k8s.io/kubernetes/test/e2e/framework/framework.go

printf '%s\n' '--- e2epod.Exec implementation and context use ---'
rg -n -C 10 '^func Exec|TContext\.Context|ctx\.Context|context\.Done|WithContext' \
  vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go \
  vendor/k8s.io/kubernetes/test/utils/ktesting \
  vendor/k8s.io/kubernetes/test/utils/client-go/ktesting/client.go | head -240

printf '%s\n' '--- concise static verifier for all listed sites ---'
python3 - <<'PY'
from pathlib import Path
import re

sites = {
    "test/extended/cpu_partitioning/crio.go": [375],
    "test/extended/node/dra/nvidia/gpu_validator.go": [50, 98, 326, 356],
}
for name, lines in sites.items():
    text = Path(name).read_text().splitlines()
    print(name)
    for line_no in lines:
        line = text[line_no - 1]
        call = "context.Background()" in line
        # Find the nearest preceding function declaration.
        fn = None
        for candidate in reversed(text[:line_no]):
            match = re.search(r'^\s*func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)\s*\(', candidate)
            if match:
                fn = candidate.strip()
                break
        print(f"  line {line_no}: background={call}; enclosing_function={fn}")
PY

Repository: openshift/origin

Length of output: 26143


Pass ctx to every TContext call.

The five listed calls use context.Background(), so e2epod.Exec cannot receive caller cancellation or deadlines. Replace it with ctx in collectContainerInfo and all four GPU validator methods.

📍 Affects 2 files
  • test/extended/cpu_partitioning/crio.go#L375-L375 (this comment)
  • test/extended/node/dra/nvidia/gpu_validator.go#L50-L50
  • test/extended/node/dra/nvidia/gpu_validator.go#L98-L98
  • test/extended/node/dra/nvidia/gpu_validator.go#L326-L326
  • test/extended/node/dra/nvidia/gpu_validator.go#L356-L356
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/extended/cpu_partitioning/crio.go` at line 375, Replace
context.Background() with the caller-provided ctx in every TContext call used by
collectContainerInfo and the four GPU validator methods. Update
test/extended/cpu_partitioning/crio.go:375 and
test/extended/node/dra/nvidia/gpu_validator.go:50, 98, 326, and 356; make no
other changes.

Sources: Path instructions, MCP tools

if execErr != nil {
return execErr
}
Expand Down
2 changes: 1 addition & 1 deletion test/extended/networking/egress_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
egressFWE2E = "egress-firewall-e2e"
wcEgressFWE2E = "wildcard-egress-firewall-e2e"
noEgressFWE2E = "no-egress-firewall-e2e"
egressFWTestImage = "registry.k8s.io/e2e-test-images/agnhost:2.63.0"
egressFWTestImage = "registry.k8s.io/e2e-test-images/agnhost:2.66.1"
oVNKManifest = "ovnk-egressfirewall-test.yaml"
oVNKWCManifest = "ovnk-egressfirewall-wildcard-test.yaml"
)
Expand Down
8 changes: 4 additions & 4 deletions test/extended/node/dra/nvidia/gpu_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (gv *GPUValidator) ValidateGPUInPod(ctx context.Context, namespace, podName

// Exec nvidia-smi to verify GPU is accessible
nvidiaSmiCmd := []string{"nvidia-smi", "--query-gpu=index,name", "--format=csv,noheader"}
stdout, stderr, err := e2epod.ExecWithOptions(gv.framework, e2epod.ExecOptions{
stdout, stderr, err := e2epod.Exec(gv.framework.TContext(context.Background()), e2epod.ExecOptions{
Command: nvidiaSmiCmd,
Namespace: namespace,
PodName: podName,
Expand Down Expand Up @@ -95,7 +95,7 @@ func (gv *GPUValidator) validateCudaVisibleDevices(ctx context.Context, namespac
}

envCmd := []string{"sh", "-c", "echo $CUDA_VISIBLE_DEVICES"}
stdout, stderr, err := e2epod.ExecWithOptions(gv.framework, e2epod.ExecOptions{
stdout, stderr, err := e2epod.Exec(gv.framework.TContext(context.Background()), e2epod.ExecOptions{
Command: envCmd,
Namespace: namespace,
PodName: podName,
Expand Down Expand Up @@ -323,7 +323,7 @@ func (gv *GPUValidator) ValidateCDISpec(ctx context.Context, podName, namespace

for _, devicePath := range devicePaths {
lsCmd := []string{"ls", "-la", devicePath}
stdout, stderr, err := e2epod.ExecWithOptions(gv.framework, e2epod.ExecOptions{
stdout, stderr, err := e2epod.Exec(gv.framework.TContext(context.Background()), e2epod.ExecOptions{
Command: lsCmd,
Namespace: namespace,
PodName: podName,
Expand Down Expand Up @@ -353,7 +353,7 @@ func (gv *GPUValidator) GetGPUCountInPod(ctx context.Context, namespace, podName

// Exec nvidia-smi to count GPUs
nvidiaSmiCmd := []string{"nvidia-smi", "--query-gpu=count", "--format=csv,noheader"}
stdout, stderr, err := e2epod.ExecWithOptions(gv.framework, e2epod.ExecOptions{
stdout, stderr, err := e2epod.Exec(gv.framework.TContext(context.Background()), e2epod.ExecOptions{
Command: nvidiaSmiCmd,
Namespace: namespace,
PodName: podName,
Expand Down
2 changes: 1 addition & 1 deletion test/extended/operators/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func fetchOnDiskCertificates(ctx context.Context, kubeClient kubernetes.Interfac
}
defer kubeClient.RbacV1().ClusterRoleBindings().Delete(ctx, nodeReaderCRB, metav1.DeleteOptions{})

pauseImage := image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0")
pauseImage := image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1")
podNameOnNode, err := createPods(ctx, kubeClient, namespace, nodeList, testPullSpec, pauseImage)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions test/extended/router/config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ http {
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{"netexec"},
Ports: []corev1.ContainerPort{
{
Expand All @@ -487,7 +487,7 @@ http {
Containers: []corev1.Container{
{
Name: "serve",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/nginx:1.15-4"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/nginx:1.27.0-2"),
Command: []string{"/usr/sbin/nginx"},
Args: []string{"-c", "/etc/nginx/nginx.conf"},
Ports: []corev1.ContainerPort{
Expand Down Expand Up @@ -565,7 +565,7 @@ http {
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{"serve-hostname"},
Ports: []corev1.ContainerPort{
{
Expand Down Expand Up @@ -593,7 +593,7 @@ http {
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{"serve-hostname"},
Ports: []corev1.ContainerPort{
{
Expand Down
6 changes: 3 additions & 3 deletions test/extended/router/weighted.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:image.openshift.io]",
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{
"netexec",
},
Expand Down Expand Up @@ -276,7 +276,7 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:image.openshift.io]",
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{
"netexec",
},
Expand Down Expand Up @@ -307,7 +307,7 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:image.openshift.io]",
Containers: []corev1.Container{
{
Name: "test",
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.63.0"),
Image: image.LocationFor("registry.k8s.io/e2e-test-images/agnhost:2.66.1"),
Args: []string{
"netexec",
},
Expand Down
11 changes: 5 additions & 6 deletions test/extended/storage/csi/pvc_clone_larger.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,18 @@ func (s *pvcCloneLargerCSISuite) GetTestSuiteInfo() storageframework.TestSuiteIn
return s.tsInfo
}

func (s *pvcCloneLargerCSISuite) SkipUnsupportedTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) {
func (s *pvcCloneLargerCSISuite) SkipUnsupportedTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) string {
dInfo := driver.GetDriverInfo()
if !dInfo.Capabilities[storageframework.CapPVCDataSource] {
e2eskipper.Skipf("Driver %q does not support cloning - skipping", dInfo.Name)
return fmt.Sprintf("Driver %q does not support cloning - skipping", dInfo.Name)
}
if pattern.VolMode == v1.PersistentVolumeBlock && !dInfo.Capabilities[storageframework.CapBlock] {
e2eskipper.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolMode)
return fmt.Sprintf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolMode)
}
// Cloning to a larger filesystem volume requires the driver to expand the
// filesystem when presenting the volume (same requirement as snapshot restore).
if pattern.VolMode != v1.PersistentVolumeBlock && dInfo.Capabilities[storageframework.CapFSResizeFromSourceNotSupported] {
e2eskipper.Skipf("Driver %q does not support filesystem resizing from source - skipping", dInfo.Name)
return fmt.Sprintf("Driver %q does not support filesystem resizing from source - skipping", dInfo.Name)
}
return ""
}

func (s *pvcCloneLargerCSISuite) DefineTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) {
Expand Down
4 changes: 2 additions & 2 deletions test/extended/storage/csi/scsi_overflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func (csiSuite *scsiLUNOverflowCSISuite) GetTestSuiteInfo() storageframework.Tes
return csiSuite.tsInfo
}

func (csiSuite *scsiLUNOverflowCSISuite) SkipUnsupportedTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) {
return
func (csiSuite *scsiLUNOverflowCSISuite) SkipUnsupportedTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) string {
return ""
}

func (csiSuite *scsiLUNOverflowCSISuite) DefineTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) {
Expand Down
28 changes: 14 additions & 14 deletions test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"containers": [
{
"name": "hello-openshift",
"image": "registry.k8s.io/e2e-test-images/agnhost:2.63.0",
"image": "registry.k8s.io/e2e-test-images/agnhost:2.66.1",
"args": [
"netexec"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ items:
spec:
containers:
- name: hello-openshift
image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/idling-echo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ items:
deployment: idling-echo
spec:
containers:
- image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
- image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
name: idling-echo-server
args: [ "netexec", "--http-port", "8675", "--udp-port", "3090" ]
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/idling-echo-server-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ items:
replicationcontroller: idling-echo
spec:
containers:
- image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
- image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
name: idling-echo-server
args: [ "netexec", "--http-port", "8675" ]
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/idling-echo-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ items:
deploymentconfig: idling-echo
spec:
containers:
- image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
- image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
name: idling-echo-server
args: [ "netexec", "--http-port", "8675", "--udp-port", "3090" ]
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
terminationGracePeriodSeconds: 5
containers:
- name: nginx-with-delayed-ready
image: registry.k8s.io/e2e-test-images/nginx:1.15-4
image: registry.k8s.io/e2e-test-images/nginx:1.27.0-2
command:
- /usr/sbin/nginx
args:
Expand Down
4 changes: 2 additions & 2 deletions test/extended/testdata/router/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ items:
terminationGracePeriodSeconds: 1
containers:
- name: test
image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
args: ["netexec"]
ports:
- containerPort: 8080
Expand All @@ -109,7 +109,7 @@ items:
terminationGracePeriodSeconds: 1
containers:
- name: test
image: registry.k8s.io/e2e-test-images/agnhost:2.63.0
image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
args: ["netexec"]
ports:
- containerPort: 8080
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/router/reencrypt-serving-cert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ items:
app: serving-cert
spec:
containers:
- image: registry.k8s.io/e2e-test-images/nginx:1.15-4
- image: registry.k8s.io/e2e-test-images/nginx:1.27.0-2
name: serve
command:
- /usr/sbin/nginx
Expand Down
Loading