Skip to content

fix: correct instance label handling for DM Discovery component #6150

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shunki-fujita
Copy link

@shunki-fujita shunki-fujita commented Apr 11, 2025

What problem does this PR solve?

The topologySpreadConstraints for the dm-discovery pod were not applied correctly because the instance label used in the constraints did not include the -dm suffix.
This caused a mismatch between the constraint's label selector and the actual pod labels, potentially leading to unintended pod scheduling behavior.

Close #6149

What is changed and how does it work?

The logic that sets the app.kubernetes.io/instance label in topologySpreadConstraints has been updated.
For the dm-discovery component, the instance label now appends a -dm suffix to match the actual label used on the pod.
This ensures that the topology spread constraints work correctly by aligning with the pod's label.

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


Copy link
Contributor

ti-chi-bot bot commented Apr 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@sre-bot
Copy link
Contributor

sre-bot commented Apr 11, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

ti-chi-bot bot commented Apr 11, 2025

Welcome @shunki-fujita! It looks like this is your first PR to pingcap/tidb-operator 🎉

@ti-chi-bot ti-chi-bot bot added the size/S label Apr 11, 2025
@shunki-fujita shunki-fujita marked this pull request as ready for review April 11, 2025 09:29
@shunki-fujita shunki-fujita marked this pull request as draft April 14, 2025 06:19
@shunki-fujita shunki-fujita marked this pull request as ready for review April 15, 2025 05:02
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.

Bug: topologySpreadConstraints uses incorrect instance label for DM Discovery pods
2 participants