Skip to content

fix: update kingress status logic#3575

Open
shiyan2016 wants to merge 1 commit intoalibaba:mainfrom
shiyan2016:fix/kingress-status-update
Open

fix: update kingress status logic#3575
shiyan2016 wants to merge 1 commit intoalibaba:mainfrom
shiyan2016:fix/kingress-status-update

Conversation

@shiyan2016
Copy link

@shiyan2016 shiyan2016 commented Mar 9, 2026

Ⅰ. Describe what this PR did

In pkg/ingress/kube/kingress/status.go, the updateStatus method contained an inverted condition for determining whether to update the KIngress status.

if ingress.Status.PublicLoadBalancer == nil || len(ingress.Status.PublicLoadBalancer.Ingress) != len(KIngressStatus) || reflect.DeepEqual(ingress.Status.PublicLoadBalancer.Ingress, KIngressStatus) {

The condition incorrectly used reflect.DeepEqual without negation, meaning:

  • Status updates were triggered when the current state and desired state were identical (no-op updates)
  • Status updates were skipped when the state had actually changed, causing KIngress to report stale LoadBalancer addresses

Add the ! negation operator to reflect.DeepEqual so the update is triggered only when the current state differs from the desired state.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Ⅵ. AI Coding Tool Usage Checklist (if applicable)

Please check all applicable items:

  • For new standalone features (e.g., new wasm plugin or golang-filter plugin):

    • I have created a design/ directory in the plugin folder
    • I have added the design document to the design/ directory
    • I have included the AI Coding summary below
  • For regular updates/changes (not new plugins):

    • I have provided the prompts/instructions I gave to the AI Coding tool below
    • I have included the AI Coding summary below

AI Coding Prompts (for regular updates)

AI Coding Summary

@CLAassistant
Copy link

CLAassistant commented Mar 9, 2026

CLA assistant check
All committers have signed the CLA.

@johnlanni
Copy link
Collaborator

cc @EndlessSeeker

@johnlanni johnlanni requested a review from EndlessSeeker March 10, 2026 07:07
@EndlessSeeker
Copy link
Collaborator

LGTM

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/ingress/kube/kingress/status.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: shi_yan <shi_yan@trip.com>
@shiyan2016 shiyan2016 force-pushed the fix/kingress-status-update branch from f04791b to 13deefd Compare March 10, 2026 09:23
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.

5 participants