Skip to content

Commit

Permalink
Simplify getMeshMode()
Browse files Browse the repository at this point in the history
  • Loading branch information
luksa committed Apr 25, 2023
1 parent ffe6d17 commit 746e91e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/controller/servicemesh/memberroll/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,12 @@ func getNamespaces(members *maistrav1.ServiceMeshMemberList) []string {
// Returns the Service Mesh ControlPlane mode
// Used for the internal custom metrics
func getMeshMode(mesh *maistrav2.ServiceMeshControlPlane) (string, error) {
isClusterWide, found, err := mesh.Status.AppliedValues.Istio.GetBool("global.clusterWide")
isClusterWide, _, err := mesh.Status.AppliedValues.Istio.GetBool("global.clusterWide")
if err != nil {
return "", err
}
if !found {
return internalmetrics.ControlPlaneModeValueMultiTenant, nil
}
if isClusterWide {
return internalmetrics.ControlPlaneModeValueClusterScoped, nil
}
return "", nil
return internalmetrics.ControlPlaneModeValueMultiTenant, nil
}

0 comments on commit 746e91e

Please sign in to comment.