This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch v1.5.0
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/v1.5.0 by this push:
     new 21f39e96 fix: handle v2 ApisixPluginConfig status (#1409)
21f39e96 is described below

commit 21f39e966dedb0765a9848302f8cb713aa461cfe
Author: Jintao Zhang <[email protected]>
AuthorDate: Thu Oct 27 17:34:13 2022 +0800

    fix: handle v2 ApisixPluginConfig status (#1409)
    
    Signed-off-by: Jintao Zhang <[email protected]>
---
 pkg/ingress/status.go | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/pkg/ingress/status.go b/pkg/ingress/status.go
index a897b1f7..82a16ef5 100644
--- a/pkg/ingress/status.go
+++ b/pkg/ingress/status.go
@@ -241,6 +241,23 @@ func (c *Controller) recordStatus(at interface{}, reason 
string, err error, stat
                                )
                        }
                }
+       case *configv2.ApisixPluginConfig:
+               // set to status
+               if v.Status.Conditions == nil {
+                       conditions := make([]metav1.Condition, 0)
+                       v.Status.Conditions = conditions
+               }
+               if c.verifyGeneration(&v.Status.Conditions, condition) {
+                       meta.SetStatusCondition(&v.Status.Conditions, condition)
+                       if _, errRecord := 
client.ApisixV2().ApisixPluginConfigs(v.Namespace).
+                               UpdateStatus(context.TODO(), v, 
metav1.UpdateOptions{}); errRecord != nil {
+                               log.Errorw("failed to record status change for 
ApisixPluginConfig",
+                                       zap.Error(errRecord),
+                                       zap.String("name", v.Name),
+                                       zap.String("namespace", v.Namespace),
+                               )
+                       }
+               }
        case *configv2beta3.ApisixClusterConfig:
                // set to status
                if v.Status.Conditions == nil {

Reply via email to