diff --git a/admiral/cmd/admiral/cmd/root.go b/admiral/cmd/admiral/cmd/root.go index a4536e2b..dd59de1f 100644 --- a/admiral/cmd/admiral/cmd/root.go +++ b/admiral/cmd/admiral/cmd/root.go @@ -254,9 +254,9 @@ func GetRootCmd(args []string) *cobra.Command { // Flags pertaining to VS based routing rootCmd.PersistentFlags().BoolVar(¶ms.EnableVSRouting, "enable_vs_routing", false, "Enable/Disable VS Based Routing") - rootCmd.PersistentFlags().StringArrayVar(¶ms.VSRoutingEnabledClusters, "vs_routing_enabled_clusters", []string{}, "The source clusters to enable VS based routing on") - rootCmd.PersistentFlags().StringArrayVar(¶ms.VSRoutingGateways, "vs_routing_gateways", []string{}, "The PASSTHROUGH gateways to use for VS based routing") - rootCmd.PersistentFlags().StringArrayVar(¶ms.IngressVSExportToNamespaces, "ingress_vs_export_to_namespaces", []string{"istio-system"}, "List of namespaces where the ingress VS should be exported") + rootCmd.PersistentFlags().StringSliceVar(¶ms.VSRoutingEnabledClusters, "vs_routing_enabled_clusters", []string{}, "The source clusters to enable VS based routing on") + rootCmd.PersistentFlags().StringSliceVar(¶ms.VSRoutingGateways, "vs_routing_gateways", []string{}, "The PASSTHROUGH gateways to use for VS based routing") + rootCmd.PersistentFlags().StringSliceVar(¶ms.IngressVSExportToNamespaces, "ingress_vs_export_to_namespaces", []string{"istio-system"}, "List of namespaces where the ingress VS should be exported") rootCmd.PersistentFlags().StringVar(¶ms.IngressLBPolicy, "ingress_lb_policy", "round_robin", "loadbalancer policy for ingress destination rule (round_robin/random/passthrough/least_request)") return rootCmd diff --git a/admiral/pkg/clusters/serviceentry.go b/admiral/pkg/clusters/serviceentry.go index c3cb2cfc..9bde36b9 100644 --- a/admiral/pkg/clusters/serviceentry.go +++ b/admiral/pkg/clusters/serviceentry.go @@ -761,7 +761,7 @@ func modifyServiceEntryForNewServiceOrPod( if common.DoVSRoutingForCluster(sourceCluster) { ctxLogger.Infof(common.CtxLogFormat, "VSBasedRouting", - deploymentOrRolloutName, deploymentOrRolloutNS, sourceCluster, + deploymentOrRolloutName, namespace, sourceCluster, "Discovery phase: VS based routing enabled for cluster") // Discovery phase: This is where we build a map of all the svc.cluster.local destinations // for the identity's source cluster. This map will contain the RouteDestination of all svc.cluster.local @@ -778,17 +778,17 @@ func modifyServiceEntryForNewServiceOrPod( env) if err != nil { ctxLogger.Errorf(common.CtxLogFormat, "getAllVSRouteDestinationsByCluster", - deploymentOrRolloutName, deploymentOrRolloutNS, sourceCluster, err) + deploymentOrRolloutName, namespace, sourceCluster, err) modifySEerr = common.AppendError(modifySEerr, err) } else if len(destinations) == 0 { ctxLogger.Warnf(common.CtxLogFormat, "getAllVSRouteDestinationsByCluster", - deploymentOrRolloutName, deploymentOrRolloutNS, sourceCluster, + deploymentOrRolloutName, namespace, sourceCluster, "No RouteDestinations generated for VS based routing ") } else { sourceClusterToDestinations[sourceCluster] = destinations - drHost := fmt.Sprintf("*.%s%s", deploymentOrRolloutNS, common.DotLocalDomainSuffix) + drHost := fmt.Sprintf("*.%s%s", namespace, common.DotLocalDomainSuffix) sourceClusterToDRHosts[sourceCluster] = map[string]string{ - deploymentOrRolloutNS + common.DotLocalDomainSuffix: drHost, + namespace + common.DotLocalDomainSuffix: drHost, } } } @@ -815,7 +815,7 @@ func modifyServiceEntryForNewServiceOrPod( err = addUpdateVirtualServicesForIngress(ctx, ctxLogger, remoteRegistry, sourceClusterToDestinations) if err != nil { ctxLogger.Errorf(common.CtxLogFormat, "addUpdateVirtualServicesForIngress", - deploymentOrRolloutName, deploymentOrRolloutNS, "", err) + deploymentOrRolloutName, namespace, "", err) modifySEerr = common.AppendError(modifySEerr, err) } else { err := addUpdateDestinationRuleForSourceIngress( @@ -826,7 +826,7 @@ func modifyServiceEntryForNewServiceOrPod( sourceIdentity) if err != nil { ctxLogger.Errorf(common.CtxLogFormat, "addUpdateDestinationRuleForSourceIngress", - deploymentOrRolloutName, deploymentOrRolloutNS, "", err) + deploymentOrRolloutName, namespace, "", err) modifySEerr = common.AppendError(modifySEerr, err) } } diff --git a/admiral/pkg/clusters/virtualservice_routing.go b/admiral/pkg/clusters/virtualservice_routing.go index f26524bc..431cf947 100644 --- a/admiral/pkg/clusters/virtualservice_routing.go +++ b/admiral/pkg/clusters/virtualservice_routing.go @@ -754,7 +754,7 @@ func addUpdateDestinationRuleForSourceIngress( continue } - ctxLogger.Warnf(common.CtxLogFormat, "VSBasedRouting", + ctxLogger.Info(common.CtxLogFormat, "VSBasedRouting", "", "", sourceCluster, "Writing phase: addUpdateDestinationRuleForSourceIngress VS based routing enabled for cluster")