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 42faf91
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/controller/servicemesh/memberroll/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,13 @@ 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
} else {
return internalmetrics.ControlPlaneModeValueMultiTenant, nil
}
return "", nil
}

0 comments on commit 42faf91

Please sign in to comment.