Skip to content

Fix wrong clientset used for target cluster in CompareCronJobs#36

Open
prjanitor wants to merge 1 commit intoxendit:mainfrom
prjanitor:prjanitor/26fa3b062a77cbcbf17b2ca415e172fff9729d4c
Open

Fix wrong clientset used for target cluster in CompareCronJobs#36
prjanitor wants to merge 1 commit intoxendit:mainfrom
prjanitor:prjanitor/26fa3b062a77cbcbf17b2ca415e172fff9729d4c

Conversation

@prjanitor
Copy link
Copy Markdown

Bug Description

In compare/cronjobs.go, the CompareCronJobs function incorrectly uses clientsetToSource for both source and target cluster queries. This means the comparison was comparing the source cluster against itself instead of comparing source vs target.

Fix

Changed line 18 to use clientsetToTarget when querying the target cluster's cronjobs:

- targetCronJobs, err := query.ListCronJobs(clientsetToSource, namespaceName)
+ targetCronJobs, err := query.ListCronJobs(clientsetToTarget, namespaceName)

Verification

This pattern is consistent with other comparison functions in the codebase (e.g., CompareClusterRoleBindings, CompareClusterRoles) which correctly use separate clientsets for source and target queries.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

The CompareCronJobs function was incorrectly using clientsetToSource for both
source and target cluster queries. This caused the comparison to compare the
source cluster against itself instead of comparing source vs target.

Changed line 18 to use clientsetToTarget when querying the target cluster's cronjobs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant