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

fix: remediator ignores no resource/kind match #1348

Conversation

karlkfi
Copy link
Contributor

@karlkfi karlkfi commented Jul 19, 2024

  • Update remediator to record NoMatchErrors as a resource conflict.
    These are reported as metrics and cause retry, but are still not
    reported as sync errors, for now.
  • Update comments in TestCRDDeleteBeforeRemoveCustomResourceV1
    to explain why a conflict is expected and which ones might be
    encountered due to race condition.

if err != nil {
nt.T.Fatal(err)
}
Conflicts: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

The intent of the check here is to confirm the remediator detects the drift, but couldn't correct it.

Instead of checking no conflicts, what about adding a new metric for the remediator error, and validating a remediator error is recorded in the metrics? We can still check no conflicts, but it is just no enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added handling of NoMatchErrors as conflicts using the existing metric. This should make it report the error metric consistently in this test.

If we want to add a new metric, it'll need a one-pager, because we also need to separate management conflicts from resource conflict, and list all the cases to make sure they're handled correctly. The management conflict reporting is spotty at best today. It only works for RootSyncs and only sometimes. I don't really have time to do this now, due to the watch filter project.

@karlkfi karlkfi force-pushed the karl-fix-management-conflicts branch from 7d18566 to 44ee0ad Compare July 24, 2024 21:07
@google-oss-prow google-oss-prow bot added size/M and removed size/S labels Jul 24, 2024
@karlkfi karlkfi changed the title Fix TestCRDDeleteBeforeRemoveCustomResourceV1 fix: remediator ignores no resource/kind match Jul 24, 2024
@karlkfi karlkfi requested review from nan-yu and sdowell July 24, 2024 21:25
- Update remediator to record NoMatchErrors as a resource conflict.
  These are reported as metrics and cause retry, but are still not
  reported as sync errors, for now.
- Update comments in TestCRDDeleteBeforeRemoveCustomResourceV1
  to explain why a conflict is expected and which ones might be
  encountered due to race condition.
@karlkfi karlkfi force-pushed the karl-fix-management-conflicts branch from 44ee0ad to 33376bf Compare July 24, 2024 21:27
Copy link
Contributor

@sdowell sdowell left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sdowell

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

@google-oss-prow google-oss-prow bot merged commit 6299a2e into GoogleContainerTools:main Jul 24, 2024
6 checks passed
@karlkfi karlkfi deleted the karl-fix-management-conflicts branch July 25, 2024 17:40
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