public static boolean hasRoleInCluster(String containerName,String clusterId,String role){
  String expectedStart=String.format("minimesos-%s-%s-",role,clusterId);
  return containerName.startsWith(expectedStart);
}

public static boolean hasRoleInCluster ( String containerName , String clusterId , String role ) { String expectedStart = String . format ( "minimesos-%s-%s-" , role , clusterId ) ; return containerName . startsWith ( expectedStart ) ; }
based on container name check if it has the given role in the cluster
