Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetApplications ¶
func GetApplications(teams []Team, cluster, namespace, name string) []v1application.ApplicationSpec
GetApplications returns the applications for the requested team. The function takes a list of team and the cluster, namespace and name of a team as arguments.
Types ¶
type Team ¶
type Team struct { Cluster string `json:"cluster"` Namespace string `json:"namespace"` Name string `json:"name"` Applications []v1application.ApplicationSpec }
Team is the structure for a single team, like it is used by the applications plugin. It contains the cluster, namespace and name of a loaded Team CR and a list of corresponding applications.
func Get ¶
Get returns a list of teams. For that we are looping through all clusters and getting all the Team CRs from each of the cluster. After that we are transforming each Team CR into our internal Teams structure, by just keeping the cluster, namespace and name of each team. In the following we have to loop again to each cluster, to retrieve all the applications. The we are are going through each team and application to check if the application contains a reference for the team. If this is the case we are adding the application to the team.