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: ingress class not effect in resource sync logic #1311

Merged
merged 4 commits into from
Sep 2, 2022

Conversation

xiangtianyu
Copy link
Contributor

@xiangtianyu xiangtianyu commented Sep 1, 2022

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

fix #1310

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

thanks for your contribution!

Comment on lines 434 to 443
if valid {
log.Debugw("ingress add event arrived",
zap.Any("object", obj),
)
} else {
log.Debugw("ignore noneffective ingress add event",
zap.Any("object", obj),
)
return
}
Copy link
Member

Choose a reason for hiding this comment

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

We can simplify the code here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you means to summarize these "valid judge" logic to common codes?

Copy link
Member

Choose a reason for hiding this comment

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

yes, we don't need judge valid=true and print log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we don't need judge valid=true and print log.

Ok, i'll modify it

@tao12345666333 tao12345666333 added this to the v1.6.0 milestone Sep 1, 2022
@tao12345666333 tao12345666333 changed the title fix ingress class not effect in resource sync fix: ingress class not effect in resource sync logic Sep 1, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2022

Codecov Report

Merging #1311 (c224206) into master (0b999ec) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1311      +/-   ##
==========================================
- Coverage   39.80%   39.76%   -0.04%     
==========================================
  Files          75       75              
  Lines        6962     6969       +7     
==========================================
  Hits         2771     2771              
- Misses       3892     3899       +7     
  Partials      299      299              
Impacted Files Coverage Δ
pkg/providers/ingress/ingress.go 5.11% <0.00%> (-0.11%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

zap.Any("object", obj),
)
} else {
if !c.isIngressEffective(ing) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These places do not need to be changed, and the debug log needs to be kept.

zap.Any("old object", oldObj),
)
} else {
if !c.isIngressEffective(curr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

ing := kube.MustNewIngress(obj)
if !c.isIngressEffective(ing) {
log.Debugw("ignore noneffective ingress add event",
Copy link
Contributor

Choose a reason for hiding this comment

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

Only the log of the sync object should be printed, and the sync should not care about the ingresssclass log.

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 misunderstanding something. And i will modify it soon

@tao12345666333
Copy link
Member

I agree with @AlinsRan , in this PR you can just keep the changes in the ResourceSync function, which will help me cherry-pick it to other versions.

Co-authored-by: Xin Rong <1324266492@qq.com>
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

LGTM

@tao12345666333 tao12345666333 merged commit 848a78f into apache:master Sep 2, 2022
@xiangtianyu xiangtianyu deleted the bugfix branch September 4, 2022 13:27
AlinsRan added a commit to AlinsRan/apisix-ingress-controller that referenced this pull request Sep 13, 2022
Co-authored-by: Sarasa Kisaragi <lingsamuelgrace@gmail.com>
Co-authored-by: Xin Rong <1324266492@qq.com>
tao12345666333 pushed a commit that referenced this pull request Sep 14, 2022
Co-authored-by: Xin Rong <1324266492@qq.com>
Co-authored-by: xiangtianyu <tjjxiang@gmail.com>
Co-authored-by: Sarasa Kisaragi <lingsamuelgrace@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

bug: ingress filter is not handled in resource sync logic
5 participants