Skip to content

feat(client): support ignore diff annotation#6631

Merged
ti-chi-bot[bot] merged 2 commits intopingcap:mainfrom
liubog2008:liubo02/filter-immutable-field
Dec 26, 2025
Merged

feat(client): support ignore diff annotation#6631
ti-chi-bot[bot] merged 2 commits intopingcap:mainfrom
liubog2008:liubo02/filter-immutable-field

Conversation

@liubog2008
Copy link
Member

@liubog2008 liubog2008 commented Dec 26, 2025

  • support pingcap.com/ignore-diff to avoid unexpected diff produced by mutating webhook.

Why

Local dns webhook of aliyun will change spec.dnsPolicy to None when pod is creating.
And the webhook doesn't handle the UPDATE operation. It breaks the apply op if we set spec.hostNetwork: true and spec.dnsPolicy: ClusterFirstWithHostNet.
And we cannot unset the spec.dnsPolicy because the webhook depends on this field to inject the dns config.

We cannot ensure that all mutating webhooks work properly and it's also hard to filter all immutable fields in client side. That's why we add this annotation to ignore diff.

How to use

# group cr
spec:
  template:
    spec:
      overlay:
        pod:
          metadata:
            annotations:
              pingcap.com/ignore-diff: "spec.dnsPolicy"

Signed-off-by: liubo02 <liubo02@pingcap.com>
@ti-chi-bot ti-chi-bot bot requested a review from howardlau1999 December 26, 2025 07:08
@github-actions github-actions bot added the v2 for operator v2 label Dec 26, 2025
@ti-chi-bot ti-chi-bot bot added the size/M label Dec 26, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 39.29%. Comparing base (40f2031) to head (eda26d9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6631      +/-   ##
==========================================
+ Coverage   39.26%   39.29%   +0.03%     
==========================================
  Files         351      351              
  Lines       20680    20692      +12     
==========================================
+ Hits         8119     8130      +11     
- Misses      12561    12562       +1     
Flag Coverage Δ
unittest 39.29% <92.30%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: liubo02 <liubo02@pingcap.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 26, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-26 07:19:24.668679723 +0000 UTC m=+2407909.482457285: ☑️ agreed by srstack.

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fgksgf, srstack, tennix

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [fgksgf,srstack,tennix]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liubog2008
Copy link
Member Author

/test pull-e2e

@ti-chi-bot ti-chi-bot bot merged commit 10d88ec into pingcap:main Dec 26, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants