project

package
v0.0.4-portal Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

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 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 GetProjectsFromGrouplist

func GetProjectsFromGrouplist(groups []string) []*types.Project

func MakeBlackWhitelist

func MakeBlackWhitelist(blackWhiteCMData map[string]string) types.BlackWhitelist

func NewProject

func NewProject(group string) (*types.Project, error)

Constructor to create a project structure based on the groupname

Types

type ProjectLister

type ProjectLister interface {
	ListProjects() ([]*types.Project, error)
}

Jump to

Keyboard shortcuts

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