Skip to content

MCO-2211: MCO-2210: MCO-2234 MCO-Migrate MCO tests from openshift-tests-private#5902

Open
ptalgulk01 wants to merge 1 commit intoopenshift:mainfrom
ptalgulk01:migrate-prune-and-mcp-tests
Open

MCO-2211: MCO-2210: MCO-2234 MCO-Migrate MCO tests from openshift-tests-private#5902
ptalgulk01 wants to merge 1 commit intoopenshift:mainfrom
ptalgulk01:migrate-prune-and-mcp-tests

Conversation

@ptalgulk01
Copy link
Copy Markdown
Contributor

@ptalgulk01 ptalgulk01 commented Apr 30, 2026

Migrated 17 test cases from openshift-tests-private/test/extended/mco/ to machine-config-operator/test/extended-priv/:

  • mco_prune.go: 3 tests for prune renderedmachineconfigs functionality (73148, 73155, 74606)
  • mco_machineconfigpool.go: 10 tests for MCP operations (43048, 43064, 56131, 77354, 42390, 45318, 52373, 56123, 70125, 72007, 75149, 76108, 85073)
  • mco_drain.go: 4 tests for node drain behavior (43245, 51381, 49568, 49672)

Added supporting helper functions:

  • MachineConfig: NewMachineConfigList, GetRenderedMachineConfigForMaster, GetRenderedMachineConfigForMasterOrFail, GetMCPRenderedMachineConfigsOrFail
  • MachineConfigPool: SetMaxUnavailable, RemoveMaxUnavailable, GetSortedUpdatedNodes, IsOCL, GetAllApplicableExtensionsToMCPOrFail
  • Controller: GetLogsAsList, GetFilteredLogsAsList
  • Node: FilterSchedulableNodesOrFail
  • Util: IsSNO, IsExecShellError, UnwrapExecCode, getTimeDifferenceInMinute, filterTimestampFromLogs, AddToAllMachineSets, checkUpdatedLists

Added template files:

  • change-worker-ign-version.yaml
  • pod-disruption-budget.yaml
  • create-pod.yaml
  • add-mc-to-trigger-node-drain.yaml

All tests build successfully and appear in test listing.

- What I did

- How to verify it

- Description for the changelog

Summary by CodeRabbit

  • Tests

    • Added comprehensive long-duration test suites covering MCO drain behavior, MachineConfigPool update scenarios (including concurrency and canary flows), rendered configuration pruning, and node update ordering; includes many validation checks for file contents, permissions, and operator status.
    • Added test helpers for log parsing, node schedulability, polling/update ordering, exec error handling, cluster-shape gating, and scaling machine sets.
  • Chores

    • Added YAML test fixtures and templates to support the new test scenarios.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 30, 2026

@ptalgulk01: This pull request references MCO-2211 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Migrated 17 test cases from openshift-tests-private/test/extended/mco/ to machine-config-operator/test/extended-priv/:

  • mco_prune.go: 3 tests for prune renderedmachineconfigs functionality (73148, 73155, 74606)
  • mco_machineconfigpool.go: 10 tests for MCP operations (43048, 43064, 56131, 77354, 42390, 45318, 52373, 56123, 70125, 72007, 75149, 76108, 85073)
  • mco_drain.go: 4 tests for node drain behavior (43245, 51381, 49568, 49672)

Added supporting helper functions:

  • MachineConfig: NewMachineConfigList, GetRenderedMachineConfigForMaster, GetRenderedMachineConfigForMasterOrFail, GetMCPRenderedMachineConfigsOrFail
  • MachineConfigPool: SetMaxUnavailable, RemoveMaxUnavailable, GetSortedUpdatedNodes, IsOCL, GetAllApplicableExtensionsToMCPOrFail
  • Controller: GetLogsAsList, GetFilteredLogsAsList
  • Node: FilterSchedulableNodesOrFail
  • Util: IsSNO, IsExecShellError, UnwrapExecCode, getTimeDifferenceInMinute, filterTimestampFromLogs, AddToAllMachineSets, checkUpdatedLists

Added template files:

  • change-worker-ign-version.yaml
  • pod-disruption-budget.yaml
  • create-pod.yaml
  • add-mc-to-trigger-node-drain.yaml

All tests build successfully and appear in test listing.

- What I did

- How to verify it

- Description for the changelog

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Walkthrough

Adds exported test utilities and helpers (logs, MachineConfig/MCP queries, node filtering, exec helpers, scaling), multiple long-duration MCO Ginkgo test suites (drain, MCP lifecycle, prune), and new YAML test fixtures.

Changes

Cohort / File(s) Summary
Constants & Controller
test/extended-priv/const.go, test/extended-priv/controller.go
Added exported platform constant NonePlatform and two log helpers: GetLogsAsList() and GetFilteredLogsAsList(regex string).
MachineConfig helpers
test/extended-priv/machineconfig.go
Added NewMachineConfigList, methods to retrieve rendered MachineConfigs for master, and OrFail wrappers converting results into test failures.
MachineConfigPool helpers
test/extended-priv/machineconfigpool.go
Added MCP helpers to set/remove maxUnavailable, determine applicable extensions/packages, poll/sort updated nodes with concurrency awareness, and detect On-Cluster Layering (IsOCL).
MCO Test Suites
test/extended-priv/mco_drain.go, test/extended-priv/mco_machineconfigpool.go, test/extended-priv/mco_prune.go
Added multiple long-duration, serial/disruptive Ginkgo suites covering MCO drain retry/backoff, MCP lifecycle and extension install/uninstall scenarios, proxy/paused behavior, inheritance/canary rollout, cordon/uncordon behaviors, and renderedMachineConfigs pruning (dry-run and confirm).
Node utilities
test/extended-priv/node.go
Added FilterSchedulableNodesOrFail(nodes []*Node) []*Node to return only schedulable nodes.
Utility helpers & cluster ops
test/extended-priv/util.go
Added cluster-shape gating (SkipIfCompactOrSNO, IsSNO), exec error helpers (IsExecShellError, UnwrapExecCode), MCP test helper to create MC and assert RenderDegraded, log/timestamp parsing, AddToAllMachineSets scaling helper, and order-check utilities.
Test data fixtures
test/extended-priv/testdata/files/*
Added YAML templates: add-mc-to-trigger-node-drain.yaml, change-worker-ign-version.yaml, create-pod.yaml, and pod-disruption-budget.yaml used by the new tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (5 warnings, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.95% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Tests have multiple quality issues: error handling discarded, duplicate cleanup, lack of centralized lifecycle management, tests lack single responsibility, and missing assertion messages. Capture errors from GetFilteredLogsAsList(), remove duplicate defer cleanup, add BeforeEach/AfterEach blocks, split large tests into focused tests, and add meaningful failure messages to all assertions.
Microshift Test Compatibility ⚠️ Warning New tests use OpenShift APIs unavailable on MicroShift, missing explicit MicroShift detection or appropriate tags. Add [apigroup:machine.openshift.io] tags or IsMicroShiftCluster() checks with g.Skip() to protect tests from MachineAPI failures on MicroShift.
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning PR adds 20 new test cases across three files without comprehensive SNO compatibility protections. All four drain tests lack SNO guards and all three prune tests lack SNO protection. None use [Skipped:SingleReplicaTopology] labels. Add [Skipped:SingleReplicaTopology] labels to all four tests in mco_drain.go and SNO guards to all three tests in mco_prune.go. Ensure all remaining unprotected tests in mco_machineconfigpool.go include SNO guards.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Test fixture create-pod.yaml uses busybox image with imagePullPolicy: Always, requiring external registry access that will fail in disconnected IPv6-only environments without configured image mirrors. Replace busybox with cluster-internal ImageStream, use image digest from local registry, or add [Skipped:Disconnected] tag to skip tests in disconnected CI environments.
Title check ❓ Inconclusive The title references Jira issues (MCO-2211, MCO-2210, MCO-2234) and mentions the main objective (migrating MCO tests), but is unclear and difficult to parse due to the concatenated issue IDs and lack of clear action verb. Clarify the title by using a single primary action and issue ID; for example: 'Migrate MCO prune and MCP tests from openshift-tests-private' or 'MCO-2211: Migrate MCO drain and prune tests to machine-config-operator'.
Stable And Deterministic Test Names ❓ Inconclusive Test file content cannot be accessed to verify Ginkgo test names are stable and don't contain dynamic values like node names, pod names, or generated identifiers. Examine actual test files to verify all g.It(), Describe(), Context() calls use static strings without fmt.Sprintf, string concatenation, or variable references that produce dynamic test names.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds test code with topology-aware utilities (IsSNO, SkipIfCompactOrSNO) and test fixtures without problematic scheduling constraints for SNO, Two-Node, or HyperShift topologies.
Ote Binary Stdout Contract ✅ Passed All logging and test infrastructure occur within Ginkgo test blocks, not at process startup. No stdout writes found at the process level.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ptalgulk01
Once this PR has been reviewed and has the lgtm label, please assign yuqi-zhang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (1)
test/extended-priv/util.go (1)

1301-1318: Use errors.As for more robust and idiomatic exec error detection.

The current implementation manually unwraps one level and checks the type, which works for the current codebase structure but is less robust and idiomatic than using errors.As. This pattern will handle arbitrary error wrapping depths and aligns with Go best practices.

Proposed fix
 func IsExecShellError(err error) bool {
-	if unwrapped := errors.Unwrap(err); unwrapped != nil {
-		_, ok := unwrapped.(*exec.ExitError)
-		return ok
-	}
-	_, ok := err.(*exec.ExitError)
-	return ok
+	var exitErr *exec.ExitError
+	return errors.As(err, &exitErr)
 }
 
 // UnwrapExecCode unwraps the error and extracts the stderr string if possible
 func UnwrapExecCode(err error) (int, error) {
-	if unwrapped := errors.Unwrap(err); unwrapped != nil {
-		exitError, ok := unwrapped.(*exec.ExitError)
-		if ok {
-			return exitError.ExitCode(), nil
-		}
-	}
-	return -1, fmt.Errorf("No exit code available in the provided error %s", err)
+	var exitErr *exec.ExitError
+	if errors.As(err, &exitErr) {
+		return exitErr.ExitCode(), nil
+	}
+	return -1, fmt.Errorf("no exit code available in error: %w", err)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/util.go` around lines 1301 - 1318, The type checks in
IsExecShellError and UnwrapExecCode only inspect one unwrap level; replace the
manual unwrap logic with errors.As to robustly detect *exec.ExitError across
arbitrary wrapping. In IsExecShellError use errors.As(err, &exitError) and
return whether it matched; in UnwrapExecCode use errors.As to obtain the
*exec.ExitError and return exitError.ExitCode(), otherwise return -1 and a
formatted error mentioning the original err. Update references to
IsExecShellError and UnwrapExecCode accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended-priv/machineconfig.go`:
- Around line 184-189: GetMCPRenderedMachineConfigsOrFail currently calls
GetRenderedMachineConfigForMaster, so it returns only master-rendered
MachineConfigs; change it to return MCP-specific rendered MachineConfigs by
either renaming the method to reflect the master-only behavior or, preferably,
implement and call an MCP-aware lookup (e.g., create/use
GetRenderedMachineConfigForMCP or a filter by MCP label/selector inside
GetMCPRenderedMachineConfigsOrFail) and ensure you pass the MCP identifier to
that lookup and update any callers accordingly; search for
GetMCPRenderedMachineConfigsOrFail and GetRenderedMachineConfigForMaster to
locate the code to modify.

In `@test/extended-priv/mco_drain.go`:
- Around line 88-94: The test currently assumes filterTimestampFromLogs returns
at least 3 timestamps and indexes timestamps[0..2], which can cause a panic if
the log format changes; update the test around filterTimestampFromLogs and
timestamps to first assert the slice length (e.g., require or
o.Expect(len(timestamps)).To(BeNumerically(">=", 3))) before accessing
timestamps[0], timestamps[1], timestamps[2], and then perform the existing
getTimeDifferenceInMinute checks so failures surface as test assertions rather
than panics.

In `@test/extended-priv/mco_machineconfigpool.go`:
- Around line 330-332: The call to workerNode.PatchDesiredConfig(desiredConfig)
is unchecked; capture its returned error (e.g., err :=
workerNode.PatchDesiredConfig(desiredConfig)) and handle it explicitly: if err
!= nil, log the failure with context using logger.Errorf("failed to patch
desiredConfig for worker %s: %v", workerNode.GetName(), err) and fail the test
or return the error from the enclosing function (use the existing test assertion
mechanism if applicable) so a patch failure surfaces immediately.
- Around line 99-102: The test is checking for "NotFound" in stdout but
oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() only
returns stdout; change the call to use a method that captures stderr (e.g.,
CombinedOutput()) and assert against that result (update the mcpOut variable
usage) so the "NotFound" message emitted on stderr is detected; locate the call
to oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() and
replace it with the CombinedOutput-equivalent and assert Combined output
contains "NotFound".

In `@test/extended-priv/mco_prune.go`:
- Around line 50-53: The current rendered-MC collection misses worker configs
because GetMCPRenderedMachineConfigsOrFail() delegates to the master-only helper
GetRenderedMachineConfigForMaster; update GetMCPRenderedMachineConfigsOrFail()
to iterate all MachineConfigPools and for each pool call the appropriate helper
based on pool role (use GetRenderedMachineConfigForMasterOrFail() for master
pools and the worker equivalent helper for worker pools, or a unified helper
that returns rendered config for any pool), then return the combined
master+worker rendered configs so the call site
(mcList.GetMCPRenderedMachineConfigsOrFail() in mco_prune.go) receives both
master and worker rendered machineconfigs.
- Around line 39-40: The call to mMcp.WaitImmediateForUpdatedStatus() is
currently ignored; capture its return value and fail the test if it indicates a
timeout/error before logging "OK!"; specifically, replace the bare call to
mMcp.WaitImmediateForUpdatedStatus() with code that assigns the result (e.g.,
ok, err, or bool) and assert/fail accordingly (using the test harness's
Expect/require/t.Fatalf as used elsewhere in this file) so downstream assertions
only run when WaitImmediateForUpdatedStatus() succeeded, then log via
logger.Infof("OK!\n") after the check.
- Around line 252-259: Unwrap the exit code into variables instead of passing
UnwrapExecCode(err) directly into Expect: call something like (code, unwrapErr)
:= UnwrapExecCode(err), assert unwrapErr is nil/DidNot(HaveOccurred()) before
asserting the numeric exit code with Expect(code).Replace both usages in the
prune tests (the lines using UnwrapExecCode(err) to check non-zero return code)
so the unwrap error is explicitly checked and the actual code is asserted
separately.

In `@test/extended-priv/testdata/files/create-pod.yaml`:
- Around line 23-29: The Pod-level securityContext currently includes
container-only fields (allowPrivilegeEscalation and capabilities) which are
ignored; move allowPrivilegeEscalation and capabilities into the container's
securityContext (the container spec for the pod's container), leaving
runAsNonRoot and seccompProfile (pod-level or keep under pod's securityContext
if intended) appropriately placed—update the manifest so the container entry has
a securityContext block containing allowPrivilegeEscalation: false and
capabilities: { drop: ["ALL"] } while leaving runAsNonRoot and seccompProfile
where you want pod-level behavior.

In `@test/extended-priv/util.go`:
- Around line 1321-1339: The timestamp parsing is brittle:
filterTimestampFromLogs uses an unescaped "." so it can match wrong separators
and getTimeDifferenceInMinute blindly indexes split results causing panics; fix
by updating the regex in filterTimestampFromLogs to use a literal dot (e.g.
"\.[0-9]{1,6}") and a stricter pattern for timestamps, and change
getTimeDifferenceInMinute to validate split lengths before indexing (check
len(oldTimeValues)>=3 and that splitting the seconds contains two parts), or
better yet use time.Parse with a matching layout to parse both oldTimestamp and
newTimestamp safely; also normalize fractional seconds to nanoseconds when
constructing time.Date so you don’t mis-handle 1–6 digit fractions.

---

Nitpick comments:
In `@test/extended-priv/util.go`:
- Around line 1301-1318: The type checks in IsExecShellError and UnwrapExecCode
only inspect one unwrap level; replace the manual unwrap logic with errors.As to
robustly detect *exec.ExitError across arbitrary wrapping. In IsExecShellError
use errors.As(err, &exitError) and return whether it matched; in UnwrapExecCode
use errors.As to obtain the *exec.ExitError and return exitError.ExitCode(),
otherwise return -1 and a formatted error mentioning the original err. Update
references to IsExecShellError and UnwrapExecCode accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a3281dcc-aa80-4b54-80e9-fdcf3bdaef06

📥 Commits

Reviewing files that changed from the base of the PR and between b9964db and c1c47d6.

📒 Files selected for processing (13)
  • test/extended-priv/const.go
  • test/extended-priv/controller.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco_drain.go
  • test/extended-priv/mco_machineconfigpool.go
  • test/extended-priv/mco_prune.go
  • test/extended-priv/node.go
  • test/extended-priv/testdata/files/add-mc-to-trigger-node-drain.yaml
  • test/extended-priv/testdata/files/change-worker-ign-version.yaml
  • test/extended-priv/testdata/files/create-pod.yaml
  • test/extended-priv/testdata/files/pod-disruption-budget.yaml
  • test/extended-priv/util.go

Comment on lines +184 to +189
// GetMachineConfigCreatedByMCPs returns a list of the machineconfigs that were created by a MCP
func (mcl *MachineConfigList) GetMCPRenderedMachineConfigsOrFail() []*MachineConfig {
renderedMcList, err := mcl.GetRenderedMachineConfigForMaster()
o.Expect(err).NotTo(o.HaveOccurred(), "Error getting the list of the machineconfigs that were created by a MCP ")
return renderedMcList
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

GetMCPRenderedMachineConfigsOrFail returns the wrong data set.

This wrapper still delegates to the master-only lookup, so it cannot return rendered MachineConfigs for other MCPs. Either rename it to match the current behavior or point it at an MCP-specific filter.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/machineconfig.go` around lines 184 - 189,
GetMCPRenderedMachineConfigsOrFail currently calls
GetRenderedMachineConfigForMaster, so it returns only master-rendered
MachineConfigs; change it to return MCP-specific rendered MachineConfigs by
either renaming the method to reflect the master-only behavior or, preferably,
implement and call an MCP-aware lookup (e.g., create/use
GetRenderedMachineConfigForMCP or a filter by MCP label/selector inside
GetMCPRenderedMachineConfigsOrFail) and ensure you pass the MCP identifier to
that lookup and update any callers accordingly; search for
GetMCPRenderedMachineConfigsOrFail and GetRenderedMachineConfigForMaster to
locate the code to modify.

Comment on lines +88 to +94
timestamps := filterTimestampFromLogs(podLogs, 3)
logger.Infof("Timestamps %s", timestamps)
// First 3 retries should be queued every 1 minute. We check 1 min < time < 2.7 min
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically(">=", 1))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically(">=", 1))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard extracted timestamps before indexing.

This code assumes exactly 3 timestamp matches; if log format drifts, this will panic instead of producing a clear assertion failure.

💡 Proposed fix
 		timestamps := filterTimestampFromLogs(podLogs, 3)
+		o.Expect(timestamps).To(o.HaveLen(3), "Expected 3 timestamps in drain failure logs")
 		logger.Infof("Timestamps %s", timestamps)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
timestamps := filterTimestampFromLogs(podLogs, 3)
logger.Infof("Timestamps %s", timestamps)
// First 3 retries should be queued every 1 minute. We check 1 min < time < 2.7 min
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically(">=", 1))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically(">=", 1))
timestamps := filterTimestampFromLogs(podLogs, 3)
o.Expect(timestamps).To(o.HaveLen(3), "Expected 3 timestamps in drain failure logs")
logger.Infof("Timestamps %s", timestamps)
// First 3 retries should be queued every 1 minute. We check 1 min < time < 2.7 min
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[0], timestamps[1])).Should(o.BeNumerically(">=", 1))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically("<=", 2.7))
o.Expect(getTimeDifferenceInMinute(timestamps[1], timestamps[2])).Should(o.BeNumerically(">=", 1))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_drain.go` around lines 88 - 94, The test currently
assumes filterTimestampFromLogs returns at least 3 timestamps and indexes
timestamps[0..2], which can cause a panic if the log format changes; update the
test around filterTimestampFromLogs and timestamps to first assert the slice
length (e.g., require or o.Expect(len(timestamps)).To(BeNumerically(">=", 3)))
before accessing timestamps[0], timestamps[1], timestamps[2], and then perform
the existing getTimeDifferenceInMinute checks so failures surface as test
assertions rather than panics.

Comment on lines +99 to +102
mcpOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(mcpOut).Should(o.ContainSubstring("NotFound"))
logger.Infof("Custom mcp is deleted successfully!")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

NotFound check is reading stdout instead of stderr.

Run(...).Output() returns stdout; for failed oc get, the NotFound message is typically in stderr, so this assertion can fail even when behavior is correct.

💡 Proposed fix
-		mcpOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Output()
+		_, mcpErrOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Outputs()
 		o.Expect(err).Should(o.HaveOccurred())
-		o.Expect(mcpOut).Should(o.ContainSubstring("NotFound"))
+		o.Expect(mcpErrOut).Should(o.ContainSubstring("NotFound"))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mcpOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(mcpOut).Should(o.ContainSubstring("NotFound"))
logger.Infof("Custom mcp is deleted successfully!")
_, mcpErrOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Outputs()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(mcpErrOut).Should(o.ContainSubstring("NotFound"))
logger.Infof("Custom mcp is deleted successfully!")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_machineconfigpool.go` around lines 99 - 102, The test
is checking for "NotFound" in stdout but
oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() only
returns stdout; change the call to use a method that captures stderr (e.g.,
CombinedOutput()) and assert against that result (update the mcpOut variable
usage) so the "NotFound" message emitted on stderr is detected; locate the call
to oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() and
replace it with the CombinedOutput-equivalent and assert Combined output
contains "NotFound".

Comment thread test/extended-priv/mco_machineconfigpool.go
Comment on lines +39 to +40
mMcp.WaitImmediateForUpdatedStatus()
logger.Infof("OK!\n")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Check the MCP wait result instead of ignoring it.

If this wait fails, later assertions run against unstable state and can produce misleading failures.

💡 Proposed fix
-		mMcp.WaitImmediateForUpdatedStatus()
+		o.Expect(mMcp.WaitImmediateForUpdatedStatus()).To(o.Succeed(), "Master MCP did not reach Updated status")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mMcp.WaitImmediateForUpdatedStatus()
logger.Infof("OK!\n")
o.Expect(mMcp.WaitImmediateForUpdatedStatus()).To(o.Succeed(), "Master MCP did not reach Updated status")
logger.Infof("OK!\n")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_prune.go` around lines 39 - 40, The call to
mMcp.WaitImmediateForUpdatedStatus() is currently ignored; capture its return
value and fail the test if it indicates a timeout/error before logging "OK!";
specifically, replace the bare call to mMcp.WaitImmediateForUpdatedStatus() with
code that assigns the result (e.g., ok, err, or bool) and assert/fail
accordingly (using the test harness's Expect/require/t.Fatalf as used elsewhere
in this file) so downstream assertions only run when
WaitImmediateForUpdatedStatus() succeeded, then log via logger.Infof("OK!\n")
after the check.

Comment on lines +50 to +53
sortedRenderedMCs := mcList.GetMCPRenderedMachineConfigsOrFail()
logger.Infof(" %s", sortedRenderedMCs)

sortedMCListMaster := mcList.GetRenderedMachineConfigForMasterOrFail() // to get master rendered machine config
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

This rendered-MC validation currently misses worker-rendered configs.

GetMCPRenderedMachineConfigsOrFail() currently calls the master-only helper (GetRenderedMachineConfigForMaster) per test/extended-priv/machineconfig.go:185-189, so worker prune coverage here is incomplete.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_prune.go` around lines 50 - 53, The current
rendered-MC collection misses worker configs because
GetMCPRenderedMachineConfigsOrFail() delegates to the master-only helper
GetRenderedMachineConfigForMaster; update GetMCPRenderedMachineConfigsOrFail()
to iterate all MachineConfigPools and for each pool call the appropriate helper
based on pool role (use GetRenderedMachineConfigForMasterOrFail() for master
pools and the worker equivalent helper for worker pools, or a unified helper
that returns rendered config for any pool), then return the combined
master+worker rendered configs so the call site
(mcList.GetMCPRenderedMachineConfigsOrFail() in mco_prune.go) receives both
master and worker rendered machineconfigs.

Comment thread test/extended-priv/mco_prune.go Outdated
Comment on lines +23 to +29
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
runAsNonRoot: true
seccompProfile:
type: "RuntimeDefault"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n test/extended-priv/testdata/files/create-pod.yaml

Repository: openshift/machine-config-operator

Length of output: 1091


🌐 Web query:

Kubernetes securityContext allowPrivilegeEscalation capabilities pod vs container level

💡 Result:

In Kubernetes, securityContext is defined at both pod level (spec.securityContext as PodSecurityContext) and container level (spec.containers[].securityContext as SecurityContext). Container-level settings override pod-level settings for overlapping fields. allowPrivilegeEscalation (boolean, controls no_new_privs flag to prevent child processes gaining more privileges than parent): - Container level only: spec.containers[].securityContext.allowPrivilegeEscalation - Pod level: Not available (PodSecurityContext lacks this field) - Defaults to true unless explicitly set to false. Always true if container is privileged or has CAP_SYS_ADMIN. - Examples in official docs show it only in container securityContext. capabilities (add/drop Linux capabilities): - Container level only: spec.containers[].securityContext.capabilities - Pod level: Not available (PodSecurityContext lacks capabilities field) - PodSecurityContext has pod-wide fields like runAsUser, runAsGroup, fsGroup, runAsNonRoot, seccompProfile, seLinuxOptions, but not allowPrivilegeEscalation or capabilities. PodSecurity Standards (Restricted profile) enforce must be false/empty at container level for these fields, confirming container-level application. Best practice: Set allowPrivilegeEscalation: false and drop ALL capabilities (add only necessary) at container level for security hardening.

Citations:


Move container-only security settings under the container spec.

allowPrivilegeEscalation and capabilities are container-level fields only in Kubernetes; the PodSecurityContext does not support them. Placing them at the pod level (lines 24-26) means they are silently ignored, and the fixture does not actually enforce the restrictive container security posture it appears to define.

Suggested fix
 spec:
   containers:
     - args:
         - sleep
         - 4h
       image: quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f
       imagePullPolicy: Always
       name: "${NAME}"
+      securityContext:
+        allowPrivilegeEscalation: false
+        capabilities:
+          drop: ["ALL"]
   nodeSelector:
     kubernetes.io/hostname: "${HOSTNAME}"
   restartPolicy: Never
   securityContext:
-    allowPrivilegeEscalation: false
-    capabilities:
-      drop: ["ALL"]
     runAsNonRoot: true
     seccompProfile:
       type: "RuntimeDefault"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/testdata/files/create-pod.yaml` around lines 23 - 29, The
Pod-level securityContext currently includes container-only fields
(allowPrivilegeEscalation and capabilities) which are ignored; move
allowPrivilegeEscalation and capabilities into the container's securityContext
(the container spec for the pod's container), leaving runAsNonRoot and
seccompProfile (pod-level or keep under pod's securityContext if intended)
appropriately placed—update the manifest so the container entry has a
securityContext block containing allowPrivilegeEscalation: false and
capabilities: { drop: ["ALL"] } while leaving runAsNonRoot and seccompProfile
where you want pod-level behavior.

Comment thread test/extended-priv/util.go Outdated
Migrated 17 test cases from openshift-tests-private/test/extended/mco/ to machine-config-operator/test/extended-priv/:

- mco_prune.go: 3 tests for prune renderedmachineconfigs functionality (73148, 73155, 74606)
- mco_machineconfigpool.go: 10 tests for MCP operations (43048, 43064, 56131, 77354, 42390, 45318, 52373, 56123, 70125, 72007, 75149, 76108, 85073)
- mco_drain.go: 4 tests for node drain behavior (43245, 51381, 49568, 49672)

Added supporting helper functions:
- MachineConfig: NewMachineConfigList, GetRenderedMachineConfigForMaster, GetRenderedMachineConfigForMasterOrFail, GetMCPRenderedMachineConfigsOrFail
- MachineConfigPool: SetMaxUnavailable, RemoveMaxUnavailable, GetSortedUpdatedNodes, IsOCL, GetAllApplicableExtensionsToMCPOrFail
- Controller: GetLogsAsList, GetFilteredLogsAsList
- Node: FilterSchedulableNodesOrFail
- Util: IsSNO, IsExecShellError, UnwrapExecCode, getTimeDifferenceInMinute, filterTimestampFromLogs, AddToAllMachineSets, checkUpdatedLists

Added template files:
- change-worker-ign-version.yaml
- pod-disruption-budget.yaml
- create-pod.yaml
- add-mc-to-trigger-node-drain.yaml

All tests build successfully and appear in test listing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ptalgulk01 ptalgulk01 force-pushed the migrate-prune-and-mcp-tests branch from c1c47d6 to f8ce746 Compare April 30, 2026 10:58
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
test/extended-priv/mco_drain.go (1)

88-94: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard timestamp slice length before indexed access.

On Line 88–94, timestamps[0..2] is accessed without asserting length. If log format changes, this panics instead of failing as an assertion.

Proposed fix
 		timestamps := filterTimestampFromLogs(podLogs, 3)
+		o.Expect(timestamps).To(o.HaveLen(3), "Expected 3 timestamps in drain failure logs")
 		logger.Infof("Timestamps %s", timestamps)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_drain.go` around lines 88 - 94, The test accesses
timestamps[0..2] without checking length; update the block after calling
filterTimestampFromLogs to assert there are at least 3 entries (e.g.,
o.Expect(len(timestamps)).Should(o.BeNumerically(">=", 3))) before accessing
timestamps[0], timestamps[1], timestamps[2]; keep the existing
logger.Infof("Timestamps %s", timestamps) and then perform the existing
getTimeDifferenceInMinute assertions only after that guard so the test fails
with an assertion instead of panicking.
test/extended-priv/mco_machineconfigpool.go (1)

99-102: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Check NotFound from stderr, not stdout.

On Line 99–102, the assertion inspects stdout (Output()), but oc get failures usually emit NotFound on stderr.

Proposed fix
-		mcpOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Output()
+		_, mcpErrOut, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/" + mcpName).Outputs()
 		o.Expect(err).Should(o.HaveOccurred())
-		o.Expect(mcpOut).Should(o.ContainSubstring("NotFound"))
+		o.Expect(mcpErrOut).Should(o.ContainSubstring("NotFound"))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_machineconfigpool.go` around lines 99 - 102, The test
is checking for "NotFound" on stdout (mcpOut) but oc get writes that message to
stderr; replace the call to
oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() with a
call that captures stderr (for example CombinedOutput() or the library method
that returns combined stdout+stderr) and assert the combined output (or stderr)
contains "NotFound" instead of inspecting mcpOut; keep the existing expectation
that an error occurred (err) and update the variable name if needed (e.g.,
combinedOut) when asserting the substring.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended-priv/mco_drain.go`:
- Around line 77-78: The code is currently ignoring errors returned by
mcc.GetFilteredLogsAsList when polling for drain failures; update the poll logic
around calls to GetFilteredLogsAsList (the calls that assign to variables named
logs and the second call near the later poll) to capture the returned error,
check it, and surface it (e.g., fail the test or log the error via
t.Fatalf/t.Errorf or the test logger) instead of discarding it; ensure you
reference mcc and workerNode.GetName() when forming the error message so
failures from GetFilteredLogsAsList are visible and cause the poll to stop with
the real error rather than a generic timeout.
- Around line 52-62: The test defers call pod.Delete(oc) twice which can cause
flaky teardown; remove the duplicate defer so the pod is deleted only once (keep
the first defer that immediately follows pod creation), and ensure the
MachineConfig cleanup still uses mc.DeleteWithWait() and mc.create() as-is;
locate the duplicate defer wrapped around pod.Delete(oc) near where mc is
created and delete that second defer line.

---

Duplicate comments:
In `@test/extended-priv/mco_drain.go`:
- Around line 88-94: The test accesses timestamps[0..2] without checking length;
update the block after calling filterTimestampFromLogs to assert there are at
least 3 entries (e.g., o.Expect(len(timestamps)).Should(o.BeNumerically(">=",
3))) before accessing timestamps[0], timestamps[1], timestamps[2]; keep the
existing logger.Infof("Timestamps %s", timestamps) and then perform the existing
getTimeDifferenceInMinute assertions only after that guard so the test fails
with an assertion instead of panicking.

In `@test/extended-priv/mco_machineconfigpool.go`:
- Around line 99-102: The test is checking for "NotFound" on stdout (mcpOut) but
oc get writes that message to stderr; replace the call to
oc.AsAdmin().WithoutNamespace().Run("get").Args("mcp/"+mcpName).Output() with a
call that captures stderr (for example CombinedOutput() or the library method
that returns combined stdout+stderr) and assert the combined output (or stderr)
contains "NotFound" instead of inspecting mcpOut; keep the existing expectation
that an error occurred (err) and update the variable name if needed (e.g.,
combinedOut) when asserting the substring.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: efae0253-1a61-4846-b692-fe236a3879d2

📥 Commits

Reviewing files that changed from the base of the PR and between c1c47d6 and f8ce746.

📒 Files selected for processing (13)
  • test/extended-priv/const.go
  • test/extended-priv/controller.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco_drain.go
  • test/extended-priv/mco_machineconfigpool.go
  • test/extended-priv/mco_prune.go
  • test/extended-priv/node.go
  • test/extended-priv/testdata/files/add-mc-to-trigger-node-drain.yaml
  • test/extended-priv/testdata/files/change-worker-ign-version.yaml
  • test/extended-priv/testdata/files/create-pod.yaml
  • test/extended-priv/testdata/files/pod-disruption-budget.yaml
  • test/extended-priv/util.go
✅ Files skipped from review due to trivial changes (5)
  • test/extended-priv/const.go
  • test/extended-priv/testdata/files/change-worker-ign-version.yaml
  • test/extended-priv/testdata/files/pod-disruption-budget.yaml
  • test/extended-priv/testdata/files/add-mc-to-trigger-node-drain.yaml
  • test/extended-priv/testdata/files/create-pod.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/extended-priv/machineconfig.go
  • test/extended-priv/mco_prune.go
  • test/extended-priv/util.go
  • test/extended-priv/controller.go

Comment on lines +52 to +62
defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
pod.Create(oc)

exutil.By("Create new mc to add new file on the node and trigger node drain")
mcName := "test-file"
mcTemplate := "add-mc-to-trigger-node-drain.yaml"
mc := NewMachineConfig(oc.AsAdmin(), mcName, MachineConfigPoolWorker).SetMCOTemplate(mcTemplate)
mc.skipWaitForMcp = true
defer mc.DeleteWithWait()
defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
mc.create()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid double-deleting the same pod in defers.

Line 52 and Line 61 both defer pod.Delete(oc) with Expect(...).NotTo(HaveOccurred()). The second cleanup can fail after the first succeeds, producing teardown flakes.

Proposed fix
-		defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
 		mc.create()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
pod.Create(oc)
exutil.By("Create new mc to add new file on the node and trigger node drain")
mcName := "test-file"
mcTemplate := "add-mc-to-trigger-node-drain.yaml"
mc := NewMachineConfig(oc.AsAdmin(), mcName, MachineConfigPoolWorker).SetMCOTemplate(mcTemplate)
mc.skipWaitForMcp = true
defer mc.DeleteWithWait()
defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
mc.create()
defer func() { o.Expect(pod.Delete(oc)).NotTo(o.HaveOccurred()) }()
pod.Create(oc)
exutil.By("Create new mc to add new file on the node and trigger node drain")
mcName := "test-file"
mcTemplate := "add-mc-to-trigger-node-drain.yaml"
mc := NewMachineConfig(oc.AsAdmin(), mcName, MachineConfigPoolWorker).SetMCOTemplate(mcTemplate)
mc.skipWaitForMcp = true
defer mc.DeleteWithWait()
mc.create()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_drain.go` around lines 52 - 62, The test defers call
pod.Delete(oc) twice which can cause flaky teardown; remove the duplicate defer
so the pod is deleted only once (keep the first defer that immediately follows
pod creation), and ensure the MachineConfig cleanup still uses
mc.DeleteWithWait() and mc.create() as-is; locate the duplicate defer wrapped
around pod.Delete(oc) near where mc is created and delete that second defer
line.

Comment on lines +77 to +78
logs, _ := mcc.GetFilteredLogsAsList(workerNode.GetName() + ".*Drain failed")
if len(logs) > 2 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Don’t discard controller log read errors during polling.

On Line 77 and Line 98, errors from GetFilteredLogsAsList are ignored. That masks root causes and turns actionable failures into generic poll timeouts.

Proposed fix
-			logs, _ := mcc.GetFilteredLogsAsList(workerNode.GetName() + ".*Drain failed")
+			logs, err := mcc.GetFilteredLogsAsList(workerNode.GetName() + ".*Drain failed")
+			if err != nil {
+				logger.Infof("Error getting filtered controller logs: %v", err)
+				return false, nil
+			}
...
-			logs, _ := mcc.GetFilteredLogsAsList(workerNode.GetName() + ".*Drain has been failing for more than 10 minutes. Waiting 5 minutes")
+			logs, err := mcc.GetFilteredLogsAsList(workerNode.GetName() + ".*Drain has been failing for more than 10 minutes. Waiting 5 minutes")
+			if err != nil {
+				logger.Infof("Error getting filtered controller logs: %v", err)
+				return false, nil
+			}

Also applies to: 98-99

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended-priv/mco_drain.go` around lines 77 - 78, The code is currently
ignoring errors returned by mcc.GetFilteredLogsAsList when polling for drain
failures; update the poll logic around calls to GetFilteredLogsAsList (the calls
that assign to variables named logs and the second call near the later poll) to
capture the returned error, check it, and surface it (e.g., fail the test or log
the error via t.Fatalf/t.Errorf or the test logger) instead of discarding it;
ensure you reference mcc and workerNode.GetName() when forming the error message
so failures from GetFilteredLogsAsList are visible and cause the poll to stop
with the real error rather than a generic timeout.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

@ptalgulk01: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security f8ce746 link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants