teams

package
Version: v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApplications

func GetApplications(teams []Team, cluster, namespace, name string) []application.ApplicationSpec

GetApplications returns the applications for the requested team.

Types

type Cache

type Cache struct {
	LastFetch     time.Time
	CacheDuration time.Duration
	Teams         []Team
}

Cache is the structure which can be used for caching a list of loaded teams.

type Team

type Team struct {
	Cluster      string `json:"cluster"`
	Namespace    string `json:"namespace"`
	Name         string `json:"name"`
	Applications []application.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

func Get(ctx context.Context, clusters *clusters.Clusters) []Team

Get returns a list of teams. For that we are looping through all clusters and getting all the Team CRs from each of the clusters. 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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL