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

[GitHub] [apisix-ingress-controller] afzal442 commented on a diff in pull request #1814: Modified `onUpdate` method

afzal442 commented on code in PR #1814:
URL: https://github.com/apache/apisix-ingress-controller/pull/1814#discussion_r1179348621


##########
pkg/providers/gateway/gateway.go:
##########
@@ -206,6 +207,49 @@ func (c *gatewayController) onAdd(obj interface{}) {
 }
 
 func (c *gatewayController) onUpdate(oldObj, newObj interface{}) {
+	oldGateway, ok := oldObj.(*gatewayv1beta1.Gateway)
+	if !ok {
+		log.Errorw("failed to convert old object to gateway",
+			zap.Any("obj", oldObj),
+		)
+		return
+	}
+
+	newGateway, ok := newObj.(*gatewayv1beta1.Gateway)
+	if !ok {
+		log.Errorw("failed to convert new object to gateway",
+			zap.Any("new obj", newObj),
+		)
+		return
+	}
+
+	if reflect.DeepEqual(oldGateway.Spec, newGateway.Spec) {

Review Comment:
   ```suggestion
   	if oldHTTPRoute.ResourceVersion >= newHTTPRoute.ResourceVersion {
   ```
   I just wanted to know if we can change it to this one or previous one is okay.



-- 
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