mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 12:47:28 +08:00
add PILOT_ENABLE_ALPHA_GATEWAY_API and fix gateway status update (#1421)
This commit is contained in:
@@ -69,6 +69,10 @@ spec:
|
|||||||
fieldPath: spec.serviceAccountName
|
fieldPath: spec.serviceAccountName
|
||||||
- name: DOMAIN_SUFFIX
|
- name: DOMAIN_SUFFIX
|
||||||
value: {{ .Values.global.proxy.clusterDomain }}
|
value: {{ .Values.global.proxy.clusterDomain }}
|
||||||
|
- name: PILOT_ENABLE_ALPHA_GATEWAY_API
|
||||||
|
value: "true"
|
||||||
|
- name: GATEWAY_NAME
|
||||||
|
value: {{ include "gateway.name" . }}
|
||||||
{{- if .Values.controller.env }}
|
{{- if .Values.controller.env }}
|
||||||
{{- range $key, $val := .Values.controller.env }}
|
{{- range $key, $val := .Values.controller.env }}
|
||||||
- name: {{ $key }}
|
- name: {{ $key }}
|
||||||
@@ -218,6 +222,8 @@ spec:
|
|||||||
{{- if .Values.global.enableGatewayAPI }}
|
{{- if .Values.global.enableGatewayAPI }}
|
||||||
- name: PILOT_ENABLE_GATEWAY_API
|
- name: PILOT_ENABLE_GATEWAY_API
|
||||||
value: "true"
|
value: "true"
|
||||||
|
- name: PILOT_ENABLE_ALPHA_GATEWAY_API
|
||||||
|
value: "true"
|
||||||
- name: PILOT_ENABLE_GATEWAY_API_STATUS
|
- name: PILOT_ENABLE_GATEWAY_API_STATUS
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: PILOT_ENABLE_GATEWAY_API_DEPLOYMENT_CONTROLLER
|
- name: PILOT_ENABLE_GATEWAY_API_DEPLOYMENT_CONTROLLER
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import "istio.io/pkg/env"
|
|||||||
var (
|
var (
|
||||||
PodNamespace = env.RegisterStringVar("POD_NAMESPACE", "higress-system", "").Get()
|
PodNamespace = env.RegisterStringVar("POD_NAMESPACE", "higress-system", "").Get()
|
||||||
PodName = env.RegisterStringVar("POD_NAME", "", "").Get()
|
PodName = env.RegisterStringVar("POD_NAME", "", "").Get()
|
||||||
|
GatewayName = env.RegisterStringVar("GATEWAY_NAME", "higress-gateway", "").Get()
|
||||||
// Revision is the value of the Istio control plane revision, e.g. "canary",
|
// Revision is the value of the Istio control plane revision, e.g. "canary",
|
||||||
// and is the value used by the "istio.io/rev" label.
|
// and is the value used by the "istio.io/rev" label.
|
||||||
Revision = env.Register("REVISION", "", "").Get()
|
Revision = env.Register("REVISION", "", "").Get()
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
higressconfig "github.com/alibaba/higress/pkg/config"
|
higressconfig "github.com/alibaba/higress/pkg/config"
|
||||||
|
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
||||||
istio "istio.io/api/networking/v1alpha3"
|
istio "istio.io/api/networking/v1alpha3"
|
||||||
"istio.io/istio/pilot/pkg/features"
|
"istio.io/istio/pilot/pkg/features"
|
||||||
"istio.io/istio/pilot/pkg/model"
|
"istio.io/istio/pilot/pkg/model"
|
||||||
@@ -1880,7 +1881,7 @@ func extractGatewayServices(r GatewayResources, kgw *k8s.GatewaySpec, obj config
|
|||||||
if len(name) > 0 {
|
if len(name) > 0 {
|
||||||
return []string{fmt.Sprintf("%s.%s.svc.%v", name, obj.Namespace, r.Domain)}, false, nil
|
return []string{fmt.Sprintf("%s.%s.svc.%v", name, obj.Namespace, r.Domain)}, false, nil
|
||||||
}
|
}
|
||||||
return []string{}, true, nil
|
return []string{fmt.Sprintf("%s.%s.svc.%s", higressconfig.GatewayName, higressconfig.PodNamespace, util.GetDomainSuffix())}, true, nil
|
||||||
}
|
}
|
||||||
gatewayServices := []string{}
|
gatewayServices := []string{}
|
||||||
skippedAddresses := []string{}
|
skippedAddresses := []string{}
|
||||||
|
|||||||
@@ -919,7 +919,7 @@ func TestExtractGatewayServices(t *testing.T) {
|
|||||||
Namespace: "default",
|
Namespace: "default",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
gatewayServices: []string{},
|
gatewayServices: []string{"higress-gateway.higress-system.svc.cluster.local"},
|
||||||
useDefaultService: true,
|
useDefaultService: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1039,7 +1039,7 @@ func TestExtractGatewayServices(t *testing.T) {
|
|||||||
Namespace: "default",
|
Namespace: "default",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
gatewayServices: []string{},
|
gatewayServices: []string{"higress-gateway.higress-system.svc.cluster.local"},
|
||||||
useDefaultService: true,
|
useDefaultService: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user