Revolyssup commented on code in PR #12413:
URL: https://github.com/apache/apisix/pull/12413#discussion_r2194348765


##########
apisix/consumer.lua:
##########
@@ -159,17 +120,49 @@ function plugin_consumer()
                         conf_version = consumers.conf_version
                     }
                 end
-
-                local consumer = consumers_id_lrucache(val.value.id .. name,
-                        val.modifiedIndex, construct_consumer_data, val, 
config)
-                if consumer == nil then
-                    goto CONTINUE
+                -- if the val is a Consumer, clone it to the local consumer;
+                -- if the val is a Credential, to get the Consumer by 
consumer_name and then clone
+                -- it to the local consumer.
+                local consumer
+                if is_credential_etcd_key(val.key) then
+                    local consumer_name = 
get_consumer_name_from_credential_etcd_key(val.key)
+                    local the_consumer = consumers:get(consumer_name)
+                    if the_consumer and the_consumer.value then
+                        consumer = consumers_id_lrucache(val.value.id .. name, 
val.modifiedIndex..the_consumer.modifiedIndex,

Review Comment:
   fixed



-- 
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-unsubscr...@apisix.apache.org

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

Reply via email to