mirror of
https://github.com/alibaba/higress.git
synced 2026-06-26 02:35:02 +08:00
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -202,6 +202,8 @@ spec:
|
|||||||
fieldRef:
|
fieldRef:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
fieldPath: spec.serviceAccountName
|
fieldPath: spec.serviceAccountName
|
||||||
|
- name: DOMAIN_SUFFIX
|
||||||
|
value: {{ .Values.global.proxy.clusterDomain }}
|
||||||
{{- if .Values.controller.env }}
|
{{- if .Values.controller.env }}
|
||||||
{{- range $key, $val := .Values.controller.env }}
|
{{- range $key, $val := .Values.controller.env }}
|
||||||
- name: {{ $key }}
|
- name: {{ $key }}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/types"
|
"github.com/gogo/protobuf/types"
|
||||||
"github.com/golang/protobuf/jsonpb"
|
"github.com/golang/protobuf/jsonpb"
|
||||||
@@ -30,6 +31,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const DefaultDomainSuffix = "cluster.local"
|
const DefaultDomainSuffix = "cluster.local"
|
||||||
|
var domainSuffix = os.Getenv("DOMAIN_SUFFIX")
|
||||||
|
|
||||||
type ClusterNamespacedName struct {
|
type ClusterNamespacedName struct {
|
||||||
model.NamespacedName
|
model.NamespacedName
|
||||||
@@ -80,7 +82,10 @@ func MessageToGoGoStruct(msg proto.Message) (*types.Struct, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CreateServiceFQDN(namespace, name string) string {
|
func CreateServiceFQDN(namespace, name string) string {
|
||||||
return fmt.Sprintf("%s.%s.svc.%s", name, namespace, DefaultDomainSuffix)
|
if domainSuffix == "" {
|
||||||
|
domainSuffix = DefaultDomainSuffix
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s.%s.svc.%s", name, namespace, domainSuffix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildPatchStruct(config string) *types.Struct {
|
func BuildPatchStruct(config string) *types.Struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user