Skip to content

Commit

Permalink
fix: handle v2 ApisixPluginConfig status (#1409)
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <[email protected]>
  • Loading branch information
tao12345666333 authored Oct 27, 2022
1 parent 4219c47 commit 21f39e9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/ingress/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 21f39e9

Please sign in to comment.