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

ronething pushed a commit to branch fix/ssl_id
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git

commit 8eedc472acacba31918bb2c530680aefb3f9e7f3
Author: Ashing Zheng <[email protected]>
AuthorDate: Thu Oct 9 16:54:45 2025 +0800

    fix: r
    
    Signed-off-by: Ashing Zheng <[email protected]>
---
 internal/adc/translator/gateway.go | 46 --------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/internal/adc/translator/gateway.go 
b/internal/adc/translator/gateway.go
index 2d83da7e..bc3f6142 100644
--- a/internal/adc/translator/gateway.go
+++ b/internal/adc/translator/gateway.go
@@ -22,7 +22,6 @@ import (
        "encoding/json"
        "encoding/pem"
        "fmt"
-       "slices"
 
        "github.com/api7/gopkg/pkg/log"
        "github.com/pkg/errors"
@@ -52,7 +51,6 @@ func (t *Translator) TranslateGateway(tctx 
*provider.TranslateContext, obj *gate
                        result.SSL = append(result.SSL, ssl...)
                }
        }
-       result.SSL = mergeSSLWithSameID(result.SSL)
 
        rk := utils.NamespacedNameKind(obj)
        gatewayProxy, ok := tctx.GatewayProxies[rk]
@@ -241,47 +239,3 @@ func (t *Translator) 
fillPluginMetadataFromGatewayProxy(pluginMetadata adctypes.
                pluginMetadata[pluginName] = pluginConfig
        }
 }
-
-// mergeSSLWithSameID merge ssl with same id
-func mergeSSLWithSameID(sslList []*adctypes.SSL) []*adctypes.SSL {
-       if len(sslList) <= 1 {
-               return sslList
-       }
-
-       // create a map to store ssl with same id
-       sslMap := make(map[string]*adctypes.SSL)
-       for _, ssl := range sslList {
-               if existing, exists := sslMap[ssl.ID]; exists {
-                       // if ssl with same id exists, merge their snis
-                       // use map to deduplicate
-                       sniMap := make(map[string]struct{})
-                       // add existing snis
-                       for _, sni := range existing.Snis {
-                               sniMap[sni] = struct{}{}
-                       }
-                       // add new snis
-                       for _, sni := range ssl.Snis {
-                               sniMap[sni] = struct{}{}
-                       }
-                       // rebuild deduplicated snis list
-                       newSnis := make([]string, 0, len(sniMap))
-                       for sni := range sniMap {
-                               newSnis = append(newSnis, sni)
-                       }
-
-                       slices.Sort(newSnis)
-                       // update existing ssl object
-                       existing.Snis = newSnis
-               } else {
-                       slices.Sort(ssl.Snis)
-                       // if new ssl id, add to map
-                       sslMap[ssl.ID] = ssl
-               }
-       }
-
-       mergedSSL := make([]*adctypes.SSL, 0, len(sslMap))
-       for _, ssl := range sslMap {
-               mergedSSL = append(mergedSSL, ssl)
-       }
-       return mergedSSL
-}

Reply via email to