ronething commented on code in PR #2460:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2460#discussion_r2188815286


##########
internal/provider/adc/store.go:
##########
@@ -244,3 +245,79 @@ func (s *Store) GetResources(name string) 
(*adctypes.Resources, error) {
                PluginMetadata: metadata,
        }, nil
 }
+
+func (s *Store) ListGlobalRules(name string) ([]*adctypes.GlobalRuleItem, 
error) {
+       s.Lock()
+       defer s.Unlock()
+       targetCache, ok := s.cacheMap[name]
+       if !ok {
+               return nil, fmt.Errorf("cache not found for name: %s", name)
+       }
+       globalRules, err := targetCache.ListGlobalRules()
+       if err != nil {
+               return nil, fmt.Errorf("failed to list global rules: %w", err)
+       }
+       return globalRules, nil
+}
+
+func (s *Store) GetResourceLabel(name, resourceType string, id string) 
(map[string]string, error) {
+       s.Lock()
+       defer s.Unlock()
+       targetCache, ok := s.cacheMap[name]
+       if !ok {
+               return nil, fmt.Errorf("cache not found for name: %s", name)
+       }
+       switch resourceType {
+       case "service":

Review Comment:
   adctypes.TypeService



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