common

package
v0.9.5-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultTenant is the name of the cyclone default tenant, it's a default tenant created
	// when Cyclone start.
	DefaultTenant = "system"

	// TenantNamespacePrefix is the prefix of namespace which related to a specific tenant
	TenantNamespacePrefix = "cyclone-"

	// TenantPVCPrefix is the prefix of pvc which related to a specific tenant
	TenantPVCPrefix = "cyclone-pvc-"

	// DefaultPVCSize is the default size of pvc
	DefaultPVCSize = "5Gi"

	// SceneCICD is the label value used to indicate cyclone CI/CD scenario
	SceneCICD = "cicd"

	// SceneAI is the label value used to indicate cyclone AI scenario
	SceneAI = "ai"

	// CronTimerTrigger represents the trigger of workflowruns triggered by cron timer.
	CronTimerTrigger = "cron-timer"

	// QuotaCPULimit represents default value of 'limits.cpu'
	QuotaCPULimit = "2"
	// QuotaCPURequest represents default value of 'requests.cpu'
	QuotaCPURequest = "1"
	// QuotaMemoryLimit represents default value of 'limits.memory'
	QuotaMemoryLimit = "4Gi"
	// QuotaMemoryRequest represents default value of 'requests.memory'
	QuotaMemoryRequest = "2Gi"

	// SecretKeyIntegration is the key of the secret dada to indicate its value is about integration information.
	SecretKeyIntegration = "integration"
	// SecretKeyRepos is the key of the secret dada to records webhooks created for workflowtriggers.
	// Only for SCM integration secrets.
	SecretKeyRepos = "repos"

	// CachePrefixPath is the prefix path of acceleration caches
	CachePrefixPath = "caches"

	// EnvSystemNamespace is the evn key to indicate which namespace the cyclone system components installed in.
	EnvSystemNamespace = "SYSTEM_NAMESPACE"
)

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(tenant string, client *kubernetes.Clientset) error

CreateNamespace creates a namespace

func CreateResourceQuota

func CreateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error

CreateResourceQuota creates resource quota for tenant

func IntegrationSecret

func IntegrationSecret(i string) string

IntegrationSecret returns secret name related to the integration

func NamespaceTenant

func NamespaceTenant(n string) string

NamespaceTenant retrieves tenant from given namespace name.

func ParseResourceList

func ParseResourceList(resources map[core_v1.ResourceName]string) (map[core_v1.ResourceName]resource.Quantity, error)

ParseResourceList parse resouces from 'map[string]string' to 'ResourceList'

func SecretIntegration

func SecretIntegration(s string) string

SecretIntegration returns integration name related to the secret

func TenantNamespace

func TenantNamespace(tenant string) string

TenantNamespace gets namespace from given tenant name.

func TenantPVC

func TenantPVC(tenant string) string

TenantPVC returns pvc name related to the tenant

func TenantResourceQuota

func TenantResourceQuota(tenant string) string

TenantResourceQuota returns resource quota name related the tenant

func UpdateResourceQuota

func UpdateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error

UpdateResourceQuota updates resource quota for tenant

Types

This section is empty.

Jump to

Keyboard shortcuts

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