Documentation
¶
Index ¶
- Constants
- Variables
- func FilterProjects(whitelistEnabled bool, context []*types.Project, ...) ([]*types.Project, []*types.Project, []*types.Project)
- func GetProjectsFromGrouplist(groups []string) []*types.Project
- func MakeBlackWhitelist(blackWhiteCMData map[string]string) types.BlackWhitelist
- func NewProject(group string) (*types.Project, error)
- type ProjectLister
Constants ¶
View Source
const ( DNS1123LabelMaxLength int = 63 Dns1123LabelFmt string = "^[a-z0-9][-a-z0-9]*$" KubiResourcePrefix = "kubi" KubiEnvironmentProduction = "production" KubiEnvironmentShortProduction = "prd" KubiEnvironmentIntegration = "integration" KubiEnvironmentShortInt = "int" KubiEnvironmentUAT = "uat" KubiEnvironmentPreproduction = "preproduction" KubiEnvironmentShortPreproduction = "pprd" KubiEnvironmentDevelopment = "development" KubiEnvironmentShortDevelopment = "dev" )
Variables ¶
View Source
var AllEnvironments = []string{ KubiEnvironmentProduction, KubiEnvironmentShortProduction, KubiEnvironmentIntegration, KubiEnvironmentShortInt, KubiEnvironmentUAT, KubiEnvironmentPreproduction, KubiEnvironmentShortPreproduction, KubiEnvironmentDevelopment, KubiEnvironmentShortDevelopment, }
TODO: Sort this and use the same names!
View Source
var BlacklistedNamespaces = []string{ "kube-system", "kube-public", "ingress-nginx", "admin", "default", KubiResourcePrefix, }
TODO: Make this dynamic
View Source
var DnsParser = regexp.MustCompile("(?:.+_+)*(?P<namespace>.+)_(?P<role>.+)$")
DNSParser is a regex to parse a group name into a namespace and a role. Please note the underscore behaviour: The last one is used for parsing. What's after the last underscore becomes the role. What's before is the namespace, but only if it is a complete word (all the previous underscores content are removed).
View Source
var EnvironmentNamesMapping = map[string]string{ KubiEnvironmentShortDevelopment: KubiEnvironmentDevelopment, KubiEnvironmentShortInt: KubiEnvironmentIntegration, KubiEnvironmentUAT: KubiEnvironmentUAT, KubiEnvironmentShortPreproduction: KubiEnvironmentPreproduction, KubiEnvironmentShortProduction: KubiEnvironmentProduction, }
View Source
var WhitelistedRoles = []string{
"admin",
"service",
"user",
}
Functions ¶
func FilterProjects ¶
func FilterProjects(whitelistEnabled bool, context []*types.Project, blackWhiteList *types.BlackWhitelist) ([]*types.Project, []*types.Project, []*types.Project)
FilterProjects filters projects based on the black and whitelist
func MakeBlackWhitelist ¶
func MakeBlackWhitelist(blackWhiteCMData map[string]string) types.BlackWhitelist
Types ¶
type ProjectLister ¶
Click to show internal directories.
Click to hide internal directories.