setting

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// common
	ENVSystemAddress           = "ADDRESS"
	ENVEnterprise              = "ENTERPRISE"
	ENVMode                    = "MODE"
	ENVMongoDBConnectionString = "MONGODB_CONNECTION_STRING"
	ENVAslanDBName             = "ASLAN_DB"
	ENVHubAgentImage           = "HUB_AGENT_IMAGE"
	ENVExecutorImage           = "EXECUTOR_IMAGE"
	ENVMysqlUser               = "MYSQL_USER"
	ENVMysqlPassword           = "MYSQL_PASSWORD"
	ENVMysqlHost               = "MYSQL_HOST"
	ENVMysqlUserDb             = "MYSQL_USER_DB"

	// Aslan
	ENVPodName              = "BE_POD_NAME"
	ENVNamespace            = "BE_POD_NAMESPACE"
	ENVLogLevel             = "LOG_LEVEL"
	ENVServiceStartTimeout  = "SERVICE_START_TIMEOUT"
	ENVDefaultEnvRecycleDay = "DEFAULT_ENV_RECYCLE_DAY"
	ENVDefaultIngressClass  = "DEFAULT_INGRESS_CLASS"
	ENVAslanRegAddress      = "DEFAULT_REGISTRY"
	ENVAslanRegAccessKey    = "DEFAULT_REGISTRY_AK"
	ENVAslanRegSecretKey    = "DEFAULT_REGISTRY_SK"
	ENVAslanRegNamespace    = "DEFAULT_REGISTRY_NAMESPACE"

	ENVGithubSSHKey    = "GITHUB_SSH_KEY"
	ENVGithubKnownHost = "GITHUB_KNOWN_HOST"

	ENVReaperImage      = "REAPER_IMAGE"
	ENVReaperBinaryFile = "REAPER_BINARY_FILE"
	ENVPredatorImage    = "PREDATOR_IMAGE"
	EnvPackagerImage    = "PACKAGER_IMAGE"

	ENVDockerHosts = "DOCKER_HOSTS"

	ENVUseClassicBuild       = "USE_CLASSIC_BUILD"
	ENVCustomDNSNotSupported = "CUSTOM_DNS_NOT_SUPPORTED"

	ENVOldEnvSupported = "OLD_ENV_SUPPORTED"

	ENVS3StorageAK       = "S3STORAGE_AK"
	ENVS3StorageSK       = "S3STORAGE_SK"
	ENVS3StorageEndpoint = "S3STORAGE_ENDPOINT"
	ENVS3StorageBucket   = "S3STORAGE_BUCKET"
	ENVS3StorageProtocol = "S3STORAGE_PROTOCOL"
	ENVS3StoragePath     = "S3STORAGE_PATH"
	ENVKubeServerAddr    = "KUBE_SERVER_ADDR"

	// cron
	ENVRootToken = "ROOT_TOKEN"

	ENVKodespaceVersion = "KODESPACE_VERSION"

	// hubagent
	HubAgentToken         = "HUB_AGENT_TOKEN"
	HubServerBaseAddr     = "HUB_SERVER_BASE_ADDR"
	KubernetesServiceHost = "KUBERNETES_SERVICE_HOST"
	KubernetesServicePort = "KUBERNETES_SERVICE_PORT"
	Token                 = "X-API-Tunnel-Token"
	Params                = "X-API-Tunnel-Params"
	AslanBaseAddr         = "ASLAN_BASE_ADDR"

	// warpdrive
	WarpDrivePodName    = "WD_POD_NAME"
	WarpDriveNamespace  = "BE_POD_NAMESPACE"
	ReleaseImageTimeout = "RELEASE_IMAGE_TIMEOUT"

	// reaper
	Home            = "HOME"
	PkgFile         = "PKG_FILE"
	JobConfigFile   = "JOB_CONFIG_FILE"
	DockerAuthDir   = "DOCKER_AUTH_DIR"
	Path            = "PATH"
	DockerHost      = "DOCKER_HOST"
	BuildURL        = "BUILD_URL"
	DefaultDockSock = "/var/run/docker.sock"

	// jenkins
	JenkinsBuildImage = "JENKINS_BUILD_IMAGE"

	// dind
	DindImage = "DIND_IMAGE"

	DebugMode   = "debug"
	ReleaseMode = "release"
	TestMode    = "test"

	// user
	ENVIssuerURL      = "ISSUER_URL"
	ENVClientID       = "CLIENT_ID"
	ENVClientSecret   = "CLIENT_SECRET"
	ENVRedirectURI    = "REDIRECT_URI"
	ENVSecretKey      = "SECRET_KEY"
	ENVMysqlUserDB    = "MYSQL_USER_DB"
	ENVScopes         = "SCOPES"
	ENVTokenExpiresAt = "TOKEN_EXPIRES_AT"
	ENVUserPort       = "USER_PORT"

	// config
	ENVMysqlDexDB = "MYSQL_DEX_DB"
	FeatureFlag   = "feature-gates"

	// initconfig
	ENVAdminEmail    = "ADMIN_EMAIL"
	ENVAdminPassword = "ADMIN_PASSWORD"
	PresetAccount    = "admin"
)

envs

View Source
const (
	Secret                = "Secret"
	ConfigMap             = "ConfigMap"
	Ingress               = "Ingress"
	PersistentVolumeClaim = "PersistentVolumeClaim"
	Service               = "Service"
	Deployment            = "Deployment"
	StatefulSet           = "StatefulSet"
	Pod                   = "Pod"
	ReplicaSet            = "ReplicaSet"
	Job                   = "Job"
	CronJob               = "CronJob"
	ClusterRoleBinding    = "ClusterRoleBinding"
	ServiceAccount        = "ServiceAccount"
	ClusterRole           = "ClusterRole"
	Role                  = "Role"
	RoleBinding           = "RoleBinding"

	// labels
	TaskLabel                       = "s-task"
	TypeLabel                       = "s-type"
	PipelineTypeLable               = "p-type"
	ProductLabel                    = "s-product"
	GroupLabel                      = "s-group"
	ServiceLabel                    = "s-service"
	LabelHashKey                    = "hash"
	ConfigBackupLabel               = "config-backup"
	EnvNameLabel                    = "s-env"
	UpdateBy                        = "update-by"
	UpdateByID                      = "update-by-id"
	UpdateTime                      = "update-time"
	UpdatedByLabel                  = "updated-by-koderover"
	IngressClassLabel               = "kubernetes.io/ingress.class"
	IngressProxyConnectTimeoutLabel = "nginx.ingress.kubernetes.io/proxy-connect-timeout"
	IngressProxySendTimeoutLabel    = "nginx.ingress.kubernetes.io/proxy-send-timeout"
	IngressProxyReadTimeoutLabel    = "nginx.ingress.kubernetes.io/proxy-read-timeout"
	ComponentLabel                  = "app.kubernetes.io/component"

	DirtyLabel               = companyLabel + "/" + "modified-since-last-update"
	OwnerLabel               = companyLabel + "/" + "owner"
	InactiveConfigLabel      = companyLabel + "/" + "inactive"
	ModifiedByAnnotation     = companyLabel + "/" + "last-modified-by"
	EditorIDAnnotation       = companyLabel + "/" + "editor-id"
	LastUpdateTimeAnnotation = companyLabel + "/" + "last-update-time"

	JobLabelTaskKey  = "s-task"
	JobLabelNameKey  = "s-name"
	JobLabelSTypeKey = "s-type"

	LabelValueTrue = "true"

	// Pod status
	PodRunning                 = "Running"
	PodError                   = "Error"
	PodUnstable                = "Unstable"
	PodCreating                = "Creating"
	PodCreated                 = "created"
	PodUpdating                = "Updating"
	PodDeleting                = "Deleting"
	PodSucceeded               = "Succeeded"
	PodFailed                  = "Failed"
	PodPending                 = "Pending"
	PodNonStarted              = "Unstart"
	PodCompleted               = "Completed"
	ServiceStatusAllSuspended  = "AllSuspend"
	ServiceStatusPartSuspended = "PartSuspend"
	ServiceStatusNoSuspended   = "NoSuspend"

	// cluster status
	ClusterUnknown      = "Unknown"
	ClusterNotFound     = "NotFound"
	ClusterDisconnected = "Disconnected"

	// annotations
	HelmReleaseNameAnnotation = "meta.helm.sh/release-name"

	EnvCreatedBy = "createdBy"
	EnvCreator   = "koderover"
	PodReady     = "ready"
	JobReady     = "Completed"
	PodNotReady  = "not ready"

	APIVersionAppsV1 = "apps/v1"

	RSASecretName = "zadig-rsa-key"

	DefaultImagePullSecret = "default-registry-secret"

	PolicyMetaConfigMapName = "zadig-policy-meta"
	PolicyURLConfigMapName  = "zadig-policy-url"
	PolicyRoleConfigMapName = "zadig-policy-role"
)

k8s concepts

View Source
const (
	ProductName = "zadig"
	RequestID   = "requestID"

	ProtocolHTTP  string = "http"
	ProtocolHTTPS string = "https"
	ProtocolTCP   string = "tcp"

	DefaultIngressClass = "koderover-nginx"

	// K8SDeployType Containerized Deployment
	K8SDeployType = "k8s"
	// helm deployment
	HelmDeployType      = "helm"
	HelmChartDeployType = "helm_chart"
	// PMDeployType physical machine deploy method
	PMDeployType          = "pm"
	TrusteeshipDeployType = "trusteeship"

	// Infrastructure k8s type
	BasicFacilityK8S = "kubernetes"
	// Infrastructure Cloud Hosting
	BasicFacilityCVM = "cloud_host"

	// SourceFromZadig Configuration sources are managed by the platform
	SourceFromZadig = "spock"
	// SourceFromGitlab The configuration source is gitlab
	SourceFromGitlab = "gitlab"
	// SourceFromGithub The configuration source is github
	SourceFromGithub = "github"
	// SourceFromGerrit The configuration source is gerrit
	SourceFromGerrit = "gerrit"
	// SourceFromCodeHub The configuration source is codehub
	SourceFromCodeHub = "codehub"
	// SourceFromGitee Configure the source as gitee
	SourceFromGitee = "gitee"
	// SourceFromGiteeEE Configure the source as gitee-enterprise
	SourceFromGiteeEE = "gitee-enterprise"
	// SourceFromOther Configure the source as other
	SourceFromOther = "other"
	// SourceFromChartTemplate The configuration source is helmTemplate
	SourceFromChartTemplate = "chartTemplate"
	// SourceFromPublicRepo The configuration source is publicRepo
	SourceFromPublicRepo  = "publicRepo"
	SourceFromChartRepo   = "chartRepo"
	SourceFromCustomEdit  = "customEdit"
	SourceFromVariableSet = "variableSet"

	// SourceFromGUI The configuration source is gui
	SourceFromGUI = "gui"
	//SourceFromHelm
	SourceFromHelm = "helm"
	//SourceFromExternal
	SourceFromExternal = "external"
	// service from yaml template
	ServiceSourceTemplate = "template"
	SourceFromPM          = "pm"
	SourceFromGitRepo     = "repo"
	// SourceFromApollo is the configuration_management type of apollo
	SourceFromApollo = "apollo"
	// SourceFromNacos is the configuration_management type of nacos
	SourceFromNacos = "nacos"

	ProdENV = "prod"
	TestENV = "test"
	AllENV  = "all"

	// action type
	TypeEnableCronjob  = "enable"
	TypeDisableCronjob = "disable"

	PublicService = "public"

	// The second step of the onboarding process
	OnboardingStatusSecond = 2

	Unset            = "UNSET"
	CleanSkippedList = "CLEAN_WHITE_LIST"
	PerPage          = 20

	BuildType   = "build"
	DeployType  = "deploy"
	TestType    = "test"
	PublishType = "publish"

	FunctionTestType = "function"
)
View Source
const (
	DeliveryVersionTypeChart       = "HelmChart"
	DeliveryVersionTypeK8SWorkflow = "K8SWorkflow"
)
View Source
const (
	DeliveryDeployTypeImage = "image"
	DeliveryDeployTypeChart = "chart"
)
View Source
const (
	StandardScriptName   = "install.sh"
	AllInOneScriptName   = "install_with_k8s.sh"
	UninstallScriptName  = "uninstall.sh"
	StandardInstallType  = "standard"
	AllInOneInstallType  = "all-in-one"
	UninstallInstallType = "uninstall"
)

install script constants

View Source
const (
	StatusRunning   = "Running"
	StatusSucceeded = "Succeeded"
)

Pod Status

View Source
const (
	// BuildImageJob ...
	BuildImageJob = "docker-build"
	// ReleaseImageJob ...
	ReleaseImageJob = "docker-release"
)

build image consts

View Source
const (
	PipelineTaskFmt   = "PipelineTask:%s"
	WorkflowTaskFmt   = "WorkflowTask:%s"
	WorkflowTaskV3Fmt = "WorkflowTaskV3:%s"
	WorkflowTaskV4Fmt = "WorkflowTaskV4:%s"
	TestTaskFmt       = "TestTask:%s"
	ServiceTaskFmt    = "ServiceTask:%s"
	ScanningTaskFmt   = "ScanningTask:%s"
)

counter prefix

View Source
const (
	ProductStatusSuccess  = "success"
	ProductStatusFailed   = "failed"
	ProductStatusCreating = "creating"
	ProductStatusUpdating = "updating"
	ProductStatusDeleting = "deleting"
	ProductStatusUnknown  = "unknown"
	ProductStatusUnstable = "Unstable"
)

Product Status

View Source
const (
	DeliveryVersionStatusSuccess  = "success"
	DeliveryVersionStatusFailed   = "failed"
	DeliveryVersionStatusCreating = "creating"
	DeliveryVersionStatusRetrying = "retrying"
)

DeliveryVersion status

View Source
const (
	DeliveryVersionPackageStatusSuccess   = "success"
	DeliveryVersionPackageStatusFailed    = "failed"
	DeliveryVersionPackageStatusWaiting   = "waiting"
	DeliveryVersionPackageStatusUploading = "uploading"
)
View Source
const (
	CreateProductEvent        = "CreateProduct"
	UpdateProductEvent        = "UpdateProduct"
	DeleteProductEvent        = "DeleteProduct"
	UpdateContainerImageEvent = "UpdateContainerImage"
)

events

View Source
const (
	OperationSceneProject  = "project"
	OperationSceneBuild    = "build"
	OperationSceneWorkflow = "workflow"
	OperationSceneEnv      = "environment"
	OperationSceneService  = "service"
	OperationSceneTest     = "test"
	OperationSceneScanning = "scanning"
	OperationSceneVersion  = "version"
	OperationSceneSystem   = "system"
)

operation scenes

View Source
const (
	// PrivateVisibility ...
	PrivateVisibility = "private"
	// PublicAccess ...
	PublicAccess = "public"
	// ChartYaml
	ChartYaml = "Chart.yaml"
	// ValuesYaml
	ValuesYaml = "values.yaml"
	// TemplatesDir
	TemplatesDir = "templates"
	// ServiceTemplateCounterName use aslan/core/common/util.GenerateServiceNextRevision() to generate service revision
	ServiceTemplateCounterName = "service:%s&project:%s"
	// ProductionServiceTemplateCounterName use aslan/core/common/util.GenerateServiceNextRevision() to generate service revision
	ProductionServiceTemplateCounterName = "productionservice:%s&project:%s"
	// GerritDefaultOwner
	GerritDefaultOwner = "dafault"
	// YamlFileSeperator ...
	YamlFileSeperator             = "\n---\n"
	HelmChartDeployStrategySuffix = "<+helm_chart>"
)

Service Related

View Source
const (
	ProxyAPIAddr    = "PROXY_API_ADDR"
	ProxyHTTPSAddr  = "PROXY_HTTPS_ADDR"
	ProxyHTTPAddr   = "PROXY_HTTP_ADDR"
	ProxySocks5Addr = "PROXY_SOCKS_ADDR"
)

proxy

View Source
const (
	// WorkflowTriggerTaskCreator ...
	WorkflowTriggerTaskCreator = "workflow_trigger"
	// WebhookTaskCreator ...
	WebhookTaskCreator = "webhook"
	// JiraHookTaskCreator ...
	JiraHookTaskCreator = "jira_hook"
	// MeegoHookTaskCreator ...
	MeegoHookTaskCreator = "meego_hook"
	// GeneralHookTaskCreator ...
	GeneralHookTaskCreator = "general_hook"
	// CronTaskCreator ...
	CronTaskCreator = "timer"
	// DefaultTaskRevoker ...
	DefaultTaskRevoker = "system" // default task revoker
)
View Source
const (
	// DefaultMaxFailures ...
	DefaultMaxFailures = 10

	// FrequencySeconds ...
	FrequencySeconds = "seconds"
	// FrequencyMinutes ...
	FrequencyMinutes = "minutes"
	// FrequencyHour ...
	FrequencyHour = "hour"
	// FrequencyHours ...
	FrequencyHours = "hours"
	// FrequencyDay ...
	FrequencyDay = "day"
	// FrequencyDays ...
	FrequencyDays = "days"
	// FrequencyMondy ...
	FrequencyMondy = "monday"
	// FrequencyTuesday ...
	FrequencyTuesday = "tuesday"
	// FrequencyWednesday ...
	FrequencyWednesday = "wednesday"
	// FrequencyThursday ...
	FrequencyThursday = "thursday"
	// FrequencyFriday ...
	FrequencyFriday = "friday"
	// FrequencySaturday ...
	FrequencySaturday = "saturday"
	// FrequencySunday ...
	FrequencySunday = "sunday"
)
View Source
const (
	// FunctionTest 功能测试
	FunctionTest = "function"
	// PerformanceTest 性能测试
	PerformanceTest = "performance"
)
View Source
const (
	// UbuntuPrecis ...
	UbuntuPrecis = "precise"
	// UbuntuTrusty ...
	UbuntuTrusty = "trusty"
	// UbuntuXenial ...
	UbuntuXenial = "xenial"
	// UbuntuBionic ...
	UbuntuBionic = "bionic"
	// TestOnly ...
	TestOnly = "test"
)
View Source
const (
	Version = "stable"

	EnvRecyclePolicyAlways     = "always"
	EnvRecyclePolicyTaskStatus = "success"
	EnvRecyclePolicyNever      = "never"
)
View Source
const (
	ImageFromCustom     = "custom"
	FixedDayTimeCronjob = "timing"
	FixedGapCronjob     = "gap"
	CrontabCronjob      = "crontab"

	WorkflowCronjob    = "workflow"
	WorkflowV4Cronjob  = "workflow_v4"
	TestingCronjob     = "test"
	EnvAnalysisCronjob = "env_analysis"

	TopicProcess      = "task.process"
	TopicCancel       = "task.cancel"
	TopicAck          = "task.ack"
	TopicItReport     = "task.it.report"
	TopicNotification = "task.notification"
	TopicCronjob      = "cronjob"
)
View Source
const (
	ProviderSourceETC = iota
	ProviderSourceAli
	ProviderSourceTencent
	ProviderSourceQiniu
	ProviderSourceHuawei
	ProviderSourceSystemDefault
)

ALL provider mapping

View Source
const (
	// components used to search image paths from yaml
	PathSearchComponentRepo  = "repo"
	PathSearchComponentImage = "image"
	PathSearchComponentTag   = "tag"
)

helm related

View Source
const (
	AliyunHost = ".aliyuncs.com"
	AWSHost    = ".amazonaws.com"
)

host for multiple cloud provider

View Source
const (
	DockerfileSourceLocal    = "local"
	DockerfileSourceTemplate = "template"

	ZadigDockerfilePath = "zadig-dockerfile"
)

Dockerfile template constant

View Source
const (
	TemplateVariableProduct            = "$T-Project$"
	TemplateVariableProductDescription = "项目名称"
	TemplateVariableService            = "$T-Service$"
	TemplateVariableServiceDescription = "服务名称"
)

template common constant

View Source
const (
	ResponseError = "error"
	ResponseData  = "response"
)
View Source
const (
	Subresource        = "subresource"
	StatusSubresource  = "status"
	IngressSubresource = "ingress"
	ResourcesHeader    = "Resources"
)
View Source
const (
	AgentClusterType      = "agent"
	KubeConfigClusterType = "kubeconfig"

	LocalClusterID = "0123456789abcdef12345678"
)

Cluster Management constants

View Source
const (
	ListNamespaceTypeCreate = "create"
	ListNamespaceTypeALL    = "all"
)

list namespace type

View Source
const (
	InformerNamingConvention      = "%s-%s"
	IstioInformerNamingConvention = "%s-%s-istio"
)
View Source
const (
	DefaultReleaseNaming     = "$Service$"
	ReleaseNamingPlaceholder = "$Namespace$-$Service$"
)
View Source
const (
	FixedValueMark            = "<+fixed>"
	RenderValueTemplate       = "{{.%s}}"
	RenderPluginValueTemplate = "$(%s)"
)

custom workflow constants for variables

View Source
const (
	ProductWorkflowType = "product_workflow"
	CustomWorkflowType  = "common_workflow"
)
View Source
const (
	NormalSchedule    = "normal"
	RequiredSchedule  = "required"
	PreferredSchedule = "preferred"
)

cluster dodeAffinity schedule type

View Source
const (
	JobNameRegx  = "^[a-z][a-z0-9-]{0,31}$"
	WorkflowRegx = "^[a-z0-9-]+$"
)
View Source
const (
	ServiceDeployStrategyImport = "import"
	ServiceDeployStrategyDeploy = "deploy"
)
View Source
const (
	IMLark     = "lark"
	IMDingTalk = "dingtalk"
)

Instant Message System types

View Source
const (
	LarkUserOpenID       = "open_id"
	LarkDepartmentOpenID = "open_department_id"
)

lark app

View Source
const (
	PMJira  = "jira"
	PMLark  = "lark"
	PMMeego = "meego"
)

Project Management types

View Source
const (
	VariableSourceRuntime = "runtime"
	VariableSourceOther   = "other"
)

Workflow variable source type

View Source
const (
	// AI analyze env result status
	AIEnvAnalysisStatusSuccess = "success"
	AIEnvAnalysisStatusFailed  = "failed"
)
View Source
const (
	CpuUintM     string = "m"
	MemoryUintMi string = "Mi"
	MemoryUintGi string = "Gi"
)
View Source
const (
	Aslan     = iota + 1 // 1
	Aslanx               // 2
	Clair                // 3
	Collie               // 4
	Cron                 // 5
	HubServer            // 6
	SonarQube            // 7
	WarpDrive            // 8
	Minio                // 9
	OPA                  // 10
	Policy               // 11
	Vendor
	User
	TimeNlp
)
View Source
const ArtifactResultOut = "artifactResultOut.tar.gz"
View Source
const AttachedClusterNamespace = "koderover-agent"

AttachedClusterNamespace is the namespace Zadig uses in attached cluster. Note: **Restricted because of product design since v1.9.0**.

View Source
const (
	AuthorizationHeader = "Authorization"
)
View Source
const (
	BuildChartPackage = "chart-package"
)
View Source
const ChartTemplatesPath = "charts"
View Source
const DefaultLoginLocal = "local"
View Source
const DeployTimeout = 60 * 10 // 10 minutes
View Source
const (
	DockerfileCmdArg = "ARG"
)

Dockerfile parsing consts

View Source
const DogFood = "/var/run/koderover-dog-food"
View Source
const (
	// normal project names are not allowed to contain special characters, so we have a special project name to distinguish the enterprise workflow
	EnterpriseProject = "DEPLOY_CENTER"
)
View Source
const (
	JenkinsBuildJob = "jenkins-build"
)
View Source
const LocalConfig = "local.env"
View Source
const MaskValue = "********"
View Source
const MaxTries = 1
View Source
const ModernWorkflowType = "ModernWorkflow"

ModernWorkflowType 自由编排工作流

View Source
const (
	NormalModeProduct = "normal"
)
View Source
const PMHostDefaultPort int64 = 22
View Source
const ProgressFile = "/var/log/job-progress"
View Source
const ProjectKeyRegEx = `^[a-z-\d]+$`
View Source
const (
	RegExpParameter = `{{.(\w)+}}`
)

Yaml template constant

View Source
const RequestModeOpenAPI = "openAPI"
View Source
const (
	S3DefaultRegion = "ap-shanghai"
)

S3 related constants

View Source
const (
	SystemUser = "system"
)
View Source
const UpdateEnvTimeout = 60 * 5 * time.Second

Variables

View Source
var (
	// HighRequestSpec 16 CPU 32 G
	HighRequestSpec = RequestSpec{
		CpuLimit:    16000,
		MemoryLimit: 32768,
		CpuReq:      4000,
		MemoryReq:   4096,
	}
	// MediumRequestSpec 8 CPU 16 G
	MediumRequestSpec = RequestSpec{
		CpuLimit:    8000,
		MemoryLimit: 16384,
		CpuReq:      2000,
		MemoryReq:   2048,
	}
	// LowRequestSpec 4 CPU 8 G
	LowRequestSpec = RequestSpec{
		CpuLimit:    4000,
		MemoryLimit: 8192,
		CpuReq:      1000,
		MemoryReq:   1024,
	}
	// MinRequestSpec 2 CPU 2 G
	MinRequestSpec = RequestSpec{
		CpuLimit:    2000,
		MemoryLimit: 2048,
		CpuReq:      500,
		MemoryReq:   512,
	}
	// DefineRequest X CPU X G
	DefineRequestSpec  = RequestSpec{}
	DefaultRequestSpec = RequestSpec{
		CpuLimit:    4000,
		MemoryLimit: 8192,
		CpuReq:      1000,
		MemoryReq:   1024,
	}
)
View Source
var ServiceVarWildCard = []string{"*"}
View Source
var Services = map[int]*ServiceInfo{
	Aslan: {
		Name: "aslan",
		Port: 25000,
	},
	Aslanx: {
		Name: "aslanx",
		Port: 25002,
	},
	Clair: {
		Name: "clair",
		Port: 34002,
	},
	Collie: {
		Name: "collie-server",
		Port: 28080,
	},
	Cron: {
		Name: "cron",
		Port: 80,
	},
	HubServer: {
		Name: "hub-server",
		Port: 26000,
	},
	SonarQube: {
		Name: "sonarqube",
		Port: 80,
	},
	WarpDrive: {
		Name: "warpdrive",
		Port: 80,
	},
	Minio: {
		Name: "zadig-minio",
		Port: 9000,
	},
	OPA: {
		Name: "opa",
		Port: 8181,
	},
	Policy: {
		Name: "policy",
		Port: 80,
	},
	Vendor: {
		Name: "plutus-vendor",
		Port: 29000,
	},
	User: {
		Name: "user",
		Port: 80,
	},
	TimeNlp: {
		Name: "time-nlp",
		Port: 8000,
	},
}
View Source
var ValidName = regexp.MustCompile(`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$`)
View Source
var ValidNameHint = "a valid name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"

Functions

This section is empty.

Types

type K8SClusterStatus added in v1.7.1

type K8SClusterStatus string
const (
	Disconnected K8SClusterStatus = "disconnected"
	Pending      K8SClusterStatus = "pending"
	Normal       K8SClusterStatus = "normal"
	Abnormal     K8SClusterStatus = "abnormal"
)

type PMHostStatus added in v1.9.9

type PMHostStatus string
const (
	PMHostStatusNormal   PMHostStatus = "normal"
	PMHostStatusAbnormal PMHostStatus = "abnormal"
)

type Request

type Request string
const (
	// HighRequest 16 CPU 32 G
	HighRequest Request = "high"
	// MediumRequest 8 CPU 16 G
	MediumRequest Request = "medium"
	// LowRequest 4 CPU 8 G
	LowRequest Request = "low"
	// MinRequest 2 CPU 2 G
	MinRequest Request = "min"
	// DefaultRequest 4 CPU 8 G
	DefaultRequest Request = "default"
	// DefineRequest x CPU x G
	DefineRequest Request = "define"
)

type RequestSpec added in v1.7.1

type RequestSpec struct {
	CpuLimit    int `bson:"cpu_limit"                     json:"cpu_limit"               yaml:"cpu_limit"`
	MemoryLimit int `bson:"memory_limit"                  json:"memory_limit"            yaml:"memory_limit"`
	CpuReq      int `bson:"cpu_req,omitempty"             json:"cpu_req,omitempty"       yaml:"cpu_req,omitempty"`
	MemoryReq   int `bson:"memory_req,omitempty"          json:"memory_req,omitempty"    yaml:"memory_req,omitempty"`
	// gpu request, eg: "nvidia.com/gpu: 1"
	GpuLimit string `bson:"gpu_limit"                     json:"gpu_limit"               yaml:"gpu_limit"`
}

func (RequestSpec) Equal added in v1.9.9

func (spec RequestSpec) Equal(target RequestSpec) bool

func (RequestSpec) FindResourceRequestType added in v1.9.9

func (spec RequestSpec) FindResourceRequestType() Request

type ResetImagePolicyType added in v1.9.0

type ResetImagePolicyType string
const (
	ResetImagePolicyTaskCompleted      ResetImagePolicyType = "taskCompleted"
	ResetImagePolicyTaskCompletedOrder ResetImagePolicyType = ""
	ResetImagePolicyDeployFailed       ResetImagePolicyType = "deployFailed"
	ResetImagePolicyTestFailed         ResetImagePolicyType = "testFailed"
)

type ResourceType added in v1.9.9

type ResourceType string
const (
	ResourceTypeSystem ResourceType = "system"
	ResourceTypeCustom ResourceType = "custom"
)

type RoleType added in v1.7.0

type RoleType string
const (
	Contributor     RoleType = "contributor"
	ReadOnly        RoleType = "read-only"
	ProjectAdmin    RoleType = "project-admin"
	SystemAdmin     RoleType = "admin"
	ReadProjectOnly RoleType = "read-project-only"
)

type ServiceInfo added in v1.3.0

type ServiceInfo struct {
	Name string
	Port int32
}

type WorkflowCategory added in v1.9.9

type WorkflowCategory string
const (
	CustomWorkflow  WorkflowCategory = ""
	ReleaseWorkflow WorkflowCategory = "release"
)

Jump to

Keyboard shortcuts

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