Skip to content
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

Don't attempt to merge mustonlyhave list #165

Merged

Conversation

dhaiducek
Copy link
Member

Most objects have lists that are nested, so the compareLists() function was never called (since when it's nested mergeArrays() is ultimately called). However, in the case of Openshift Template objects, it has an un-nested list, which called the buggy code. To illustrate, this looks like:

objects
 - ...

Rather than:

spec:
  listKey:
   - ...

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

@dhaiducek
Copy link
Member Author

dhaiducek commented Oct 11, 2023

Re-running the workflows resulted in the tests passing. 🤷‍♂️ Here were the original failures for reference:

• [FAILED] [22.502 seconds]
Testing compliance event formatting [It] Records events for a policy that becomes noncompliant
/home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case15_event_format_test.go:141
  Timeline >>
  STEP: Creating the parent policy @ 10/11/23 16:28:20.966
  STEP: Creating the configuration policy with the owner reference @ 10/11/23 16:28:22.893
  STEP: Verifying the configuration policy exists @ 10/11/23 16:28:22.913
  STEP: Creating a pod to make it noncompliant @ 10/11/23 16:28:31.005
  STEP: Checking for noncompliant events on the configurationpolicy and the parent policy @ 10/11/23 16:28:39.536
  [FAILED] in [It] - /home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case15_event_format_test.go:167 @ 10/11/23 16:28:39.606
  STEP: Delete pods @ 10/11/23 16:28:40.855
  << Timeline
  [FAILED] Expected
      <[]v1.Event | len:0, cap:0>: []
  not to be empty
  In [It] at: /home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case15_event_format_test.go:167 @ 10/11/23 16:28:39.606
• [FAILED] [110.890 seconds]
Clean up old object when configurationpolicy is changed [It] check old pod is removed when name is changed in configpolicy 
/home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case20_delete_objects_test.go:628
  Timeline >>
  STEP: Changing the pod name @ 10/11/23 16:26:30.833
  [FAILED] in [It] - /home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case20_delete_objects_test.go:643 @ 10/11/23 16:27:31.538
  << Timeline
  [FAILED] Timed out after 60.001s.
  Unexpected error:
      <*errors.errorString | 0xc0004e91f0>: 
      expected 'pods/case20-name-changed-pod' in namespace '&{%!s(*dynamic.DynamicClient=&{0xc000348fa0}) default { v1 pods}}' to return IsNotFound error
      {
          s: "expected 'pods/case20-name-changed-pod' in namespace '&{%!s(*dynamic.DynamicClient=&{0xc000348fa0}) default { v1 pods}}' to return IsNotFound error",
      }
  occurred
  In [It] at: /home/runner/work/config-policy-controller/config-policy-controller/config-policy-controller/test/e2e/case20_delete_objects_test.go:643 @ 10/11/23 16:27:31.538

ref: https://issues.redhat.com/browse/ACM-7799
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
Using `reflect.deepEqual()` is unnecessary

Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
@openshift-ci
Copy link

openshift-ci bot commented Oct 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, mprahl

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-ci openshift-ci bot merged commit 8931b33 into open-cluster-management-io:main Oct 17, 2023
4 checks passed
@dhaiducek dhaiducek deleted the 7799-array-merge branch October 17, 2023 14:11
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.

3 participants