Skip to content

Conversation

@magic-mirror-bot
Copy link

@magic-mirror-bot magic-mirror-bot bot commented Oct 8, 2025

@dhaiducek
Copy link
Contributor

/retest

ref: https://issues.redhat.com/browse/ACM-22932

No logic changed here. Refactor before adding a new dry run cli flag

Signed-off-by: Janelle Law <[email protected]>
(cherry picked from commit f9ab0929b618099ae08a0b43bf4c80bc97cc0d25)
ref: https://issues.redhat.com/browse/ACM-22932

Instead of providing input yaml files to the dryrun command args, set the --from-cluster flag to read cluster resources via default kubeconfig.

As before, the policies are patched with remediationAction: Inform, preventing modifications to the cluster.

Signed-off-by: Janelle Law <[email protected]>
(cherry picked from commit 3886abc3524cabb2106f4da64958d7c75099121b)
ref: https://issues.redhat.com/browse/ACM-22932

Tests the dryrun CLI can read resources from a cluster with
--from-cluster flag.
Reuses the dryrun unit test cases, applies the resources to the test
kind cluster, then runs the e2e tests.

Sometimes the policy diff from the cluster returns extra context lines
surrounding the relevant +/- changes. When this diff does not match the
expected output.txt from the unit tests, the e2e test will compare the output
with the output_from_cluster.txt file.

Assisted by Cursor.

Signed-off-by: Janelle Law <[email protected]>
(cherry picked from commit c823ed6b6f1c2300708f954f77cafb17606bc183)
Tests dryrun scenarios in any order. Refactored namespace
creation/deletion before and after each test Entry in DescribeTable.

Eventually() will retry the dryrun command to wait for any duplicate resources pending deletion from previous test cases.

ref: https://issues.redhat.com/browse/ACM-22932

Assisted by Cursor.

Signed-off-by: Janelle Law <[email protected]>
(cherry picked from commit d2c11fc2add9006ac871b0547d5591f94d8076ad)
@dhaiducek dhaiducek force-pushed the magic-mirror-main-1759933459406 branch from c511aaa to f5b1943 Compare October 17, 2025 20:39
Assisted-by: Claude code
Signed-off-by: Dale Haiducek <[email protected]>
Signed-off-by: Dale Haiducek <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm label Oct 18, 2025
@sonarqubecloud
Copy link

@openshift-ci
Copy link

openshift-ci bot commented Oct 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, jan-law, magic-mirror-bot[bot]

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 2150d1f into main Oct 20, 2025
28 of 30 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the magic-mirror-main-1759933459406 branch October 20, 2025 14:46
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.

😿 Failed to sync the upstream PRs: #388

2 participants