You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "lingsamuel (via GitHub)" <gi...@apache.org> on 2023/04/11 04:32:44 UTC

[GitHub] [apisix-ingress-controller] lingsamuel opened a new pull request, #1780: fix: secret reference update

lingsamuel opened a new pull request, #1780:
URL: https://github.com/apache/apisix-ingress-controller/pull/1780

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   <!-- Select all the options from below that matches the type your PR best -->
   
   - [x] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   - [ ] Documentation
   - [ ] Refactor
   - [ ] Chore
   - [ ] CI/CD or Tests
   
   Fixes #1777
   
   ### What this PR does / why we need it:
   
   Fix a bug that causes nil reference and secret change won't trigger Ingress resource sync.
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   - [x] Did you explain what problem does this PR solve? Or what new features have been added?
   - [x] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1780: fix: secret reference update Ingress

Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on code in PR #1780:
URL: https://github.com/apache/apisix-ingress-controller/pull/1780#discussion_r1166357757


##########
pkg/providers/ingress/ingress.go:
##########
@@ -152,6 +152,36 @@ func (c *ingressController) sync(ctx context.Context, ev *types.Event) error {
 		}
 		ing = ev.Tombstone.(kube.Ingress)
 	}
+	if ing == nil {

Review Comment:
   Same reason as above.
   ```golang
   return nil
   ```



##########
pkg/providers/ingress/ingress.go:
##########
@@ -131,7 +130,7 @@ func (c *ingressController) sync(ctx context.Context, ev *types.Event) error {
 	}
 
 	if err != nil {
-		if !k8serrors.IsNotFound(err) {
+		if !k8serrors.IsNotFound(err) || (k8serrors.IsNotFound(err) && ev.Type != types.EventDelete) {

Review Comment:
   There are two questions here
   1. Events are not always up-to-date. We always retrieve the latest object, which may have been deleted. This logic can lead to infinite retries.
   2. Redundant logic, same as line 138.
   
   ![image](https://user-images.githubusercontent.com/79972061/231963858-9486017a-acec-4b9c-afc5-06b3ee747a1e.png)
   
   ```go
   if !k8serrors.IsNotFound(err) || (k8serrors.IsNotFound(err) && ev.Type != types.EventDelete) { return }
   if ev.Type != types.EventDelete { return } # Redundant 
   
   <==>
   
   if !k8serrors.IsNotFound(err) { return }
   if ev.Type != types.EventDelete { return }
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #1780: fix: secret reference update Ingress

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1780:
URL: https://github.com/apache/apisix-ingress-controller/pull/1780#issuecomment-1502676281

   ## [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1780?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1780](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1780?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b495458) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/aad3ef6fdd7866c096b96eaa3d19fed9f8fc3335?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aad3ef6) will **increase** coverage by `0.18%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head b495458 differs from pull request most recent head 00fa65b. Consider uploading reports for the commit 00fa65b to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1780      +/-   ##
   ==========================================
   + Coverage   39.71%   39.90%   +0.18%     
   ==========================================
     Files          91       91              
     Lines        7989     7951      -38     
   ==========================================
     Hits         3173     3173              
   + Misses       4410     4372      -38     
     Partials      406      406              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1780?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/providers/ingress/ingress.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1780?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9pbmdyZXNzL2luZ3Jlc3MuZ28=) | `5.07% <0.00%> (+0.42%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on pull request #1780: fix: secret reference update Ingress

Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on PR #1780:
URL: https://github.com/apache/apisix-ingress-controller/pull/1780#issuecomment-1508016798

   When deleting a secret, does the SSL object of APISIX exist?
   Missing e2e case for delete-secret?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #1780: fix: secret reference update Ingress

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 merged PR #1780:
URL: https://github.com/apache/apisix-ingress-controller/pull/1780


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org