Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command stringarr toslice #353

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions admiral/cmd/admiral/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ func GetRootCmd(args []string) *cobra.Command {

// Flags pertaining to VS based routing
rootCmd.PersistentFlags().BoolVar(&params.EnableVSRouting, "enable_vs_routing", false, "Enable/Disable VS Based Routing")
rootCmd.PersistentFlags().StringArrayVar(&params.VSRoutingEnabledClusters, "vs_routing_enabled_clusters", []string{}, "The source clusters to enable VS based routing on")
rootCmd.PersistentFlags().StringArrayVar(&params.VSRoutingGateways, "vs_routing_gateways", []string{}, "The PASSTHROUGH gateways to use for VS based routing")
rootCmd.PersistentFlags().StringArrayVar(&params.IngressVSExportToNamespaces, "ingress_vs_export_to_namespaces", []string{"istio-system"}, "List of namespaces where the ingress VS should be exported")
rootCmd.PersistentFlags().StringSliceVar(&params.VSRoutingEnabledClusters, "vs_routing_enabled_clusters", []string{}, "The source clusters to enable VS based routing on")
rootCmd.PersistentFlags().StringSliceVar(&params.VSRoutingGateways, "vs_routing_gateways", []string{}, "The PASSTHROUGH gateways to use for VS based routing")
rootCmd.PersistentFlags().StringSliceVar(&params.IngressVSExportToNamespaces, "ingress_vs_export_to_namespaces", []string{"istio-system"}, "List of namespaces where the ingress VS should be exported")
rootCmd.PersistentFlags().StringVar(&params.IngressLBPolicy, "ingress_lb_policy", "round_robin", "loadbalancer policy for ingress destination rule (round_robin/random/passthrough/least_request)")

return rootCmd
Expand Down
14 changes: 7 additions & 7 deletions admiral/pkg/clusters/serviceentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
}
}
}
Expand All @@ -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(
Expand All @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion admiral/pkg/clusters/virtualservice_routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down