for route in sys ns, no tenant is needed
@@ -195,11 +195,15 @@ func (r *HttpRouteReconcilerTask) buildIstioHttpRoute(route *corev1alpha1.HttpRo
// Kalm route level http to https redirect is achieved by adding envoy filter for istio ingress gateway
//
func (r *HttpRouteReconcilerTask) buildHttpsRedirectEnvoyFilter(route *corev1alpha1.HttpRoute) (*v1alpha32.EnvoyFilter, error) {
- tenantName, err := corev1alpha1.GetTenantNameFromObj(route)
+ var tenantName string
+ if !corev1alpha1.IsKalmSystemNamespace(route.Namespace) {
+ var err error
+ tenantName, err = corev1alpha1.GetTenantNameFromObj(route)
if err != nil {
return nil, err
}
+ }
filter := &v1alpha32.EnvoyFilter{
ObjectMeta: metaV1.ObjectMeta{
@@ -207,7 +211,6 @@ func (r *HttpRouteReconcilerTask) buildHttpsRedirectEnvoyFilter(route *corev1alp
Name: getHttpsRedirectEnvoyFilterName(route),
Labels: map[string]string{
KALM_ROUTE_LABEL: "true",
- corev1alpha1.TenantNameLabelKey: tenantName,
},
},
Spec: v1alpha3.EnvoyFilter{
@@ -245,6 +248,10 @@ func (r *HttpRouteReconcilerTask) buildHttpsRedirectEnvoyFilter(route *corev1alp
},
}
+ if tenantName != "" {
+ filter.Labels[corev1alpha1.TenantNameLabelKey] = tenantName
+ }
+
// TODO route and filter are in different namespace. Can't set owner relationship for them.
// This part will be removed or uncomment after we have a decision of http route scope.
