Documentation ¶
Index ¶
- Constants
- Variables
- type ActionRule
- type Attribute
- type AuthType
- type BranchFilterInfo
- type Cache
- type CacheDirType
- type CronTag
- type DindPod
- type EnvType
- type FileInfo
- type HTTPGetAction
- type HTTPHeader
- type JenkinsBuildParam
- type JenkinsParamType
- type JobStatus
- type MatchAttribute
- type MediumType
- type NFSProperties
- type ObjectProperties
- type ObjectStorageInfo
- type ObjectStoragePathDetail
- type Policy
- type PolicyMeta
- type PolicyMetaScope
- type PolicyRule
- type Probe
- type ProvisionType
- type ReaperType
- type Repository
- type RoleBinding
- type Rule
- type RuleMeta
- type ScanningAdvancedSetting
- type ScanningHook
- type ScanningHookCtl
- type SonarInfo
- type StartDevmodeInfo
- type StorageClassType
- type UserCountByType
- type UserInfo
- type UsersResp
- type WorkloadInfo
- type WorkloadType
Constants ¶
const ( // ProviderGithub ... ProviderGithub = "github" // ProviderGitlab ... ProviderGitlab = "gitlab" // ProviderGerrit ProviderGerrit = "gerrit" // ProviderCodehub ProviderCodehub = "codehub" // ProviderGitee ProviderGitee = "gitee" // ProviderOther ProviderOther = "other" )
const DebugImage = "ccr.ccs.tencentyun.com/koderover-rc/zadig-debug:v0.1.0"
const DevmodeWorkDir = "/home/zadig/"
const DindContainerName = "dind"
const DindMountName = "zadig-docker"
const DindMountPath = "/var/lib/docker"
const DindStatefulSetName = "dind"
const IDEContainerNameDev = "dev"
const IDEContainerNameSidecar = "sidecar"
const IDESidecarImage = "ccr.ccs.tencentyun.com/koderover-rc/zgctl-sidecar:20220526172433-amd64"
const IstioLabelKeyInjection = "istio-injection"
const IstioLabelValueInjection = "enabled"
const (
ScanningTypeSonar = "sonarQube"
)
const Zadig = "zadig"
const ZadigDomain = "zadig.koderover.com"
Variables ¶
var OriginSpec = fmt.Sprintf("%s/origin", ZadigDomain)
var ZadigLabelKeyGlobalOwner = fmt.Sprintf("%s/owner", ZadigDomain)
Functions ¶
This section is empty.
Types ¶
type ActionRule ¶ added in v1.9.9
type BranchFilterInfo ¶ added in v1.9.9
type BranchFilterInfo struct { // repository identifier CodehostID int `bson:"codehost_id" json:"codehost_id"` RepoOwner string `bson:"repo_owner" json:"repo_owner"` RepoName string `bson:"repo_name" json:"repo_name"` RepoNamespace string `bson:"repo_namespace" json:"repo_namespace"` // actual regular expression filter FilterRegExp string `bson:"filter_regexp" json:"filter_regexp"` }
func (*BranchFilterInfo) GetNamespace ¶ added in v1.9.9
func (bf *BranchFilterInfo) GetNamespace() string
type Cache ¶ added in v1.9.9
type Cache struct { MediumType MediumType `json:"medium_type" bson:"medium_type"` ObjectProperties ObjectProperties `json:"object_properties" bson:"object_properties"` NFSProperties NFSProperties `json:"nfs_properties" bson:"nfs_properties"` }
type CacheDirType ¶ added in v1.9.9
type CacheDirType string
const ( WorkspaceCacheDir CacheDirType = "workspace" UserDefinedCacheDir CacheDirType = "user_defined" )
type CronTag ¶ added in v1.9.9
type CronTag string
const (
CleanDockerTag CronTag = "CleanDockerTag"
)
type FileInfo ¶
type FileInfo struct { // parent path of the file Parent string `json:"parent"` // base name of the file Name string `json:"name"` // length in bytes for regular files; system-dependent for others Size int64 `json:"size"` // file mode bits Mode os.FileMode `json:"mode"` // modification time ModTime int64 `json:"mod_time"` // abbreviation for Mode().IsDir() IsDir bool `json:"is_dir"` }
FileInfo ...
type HTTPGetAction ¶ added in v1.9.9
type HTTPGetAction struct { Path string `bson:"path" json:"path"` Port int `bson:"port" json:"port"` Host string `bson:"-" json:"host,omitempty"` HTTPHeaders []*HTTPHeader `bson:"http_headers" json:"http_headers"` TimeOutSecond int `bson:"timeout_second" json:"timeout_second"` ResponseSuccessFlag string `bson:"response_success_flag" json:"response_success_flag"` }
type HTTPHeader ¶ added in v1.9.9
type JenkinsBuildParam ¶ added in v1.9.9
type JenkinsBuildParam struct { Name string `bson:"name,omitempty" json:"name,omitempty"` Value interface{} `bson:"value,omitempty" json:"value,omitempty"` Type JenkinsParamType `bson:"type,omitempty" json:"type,omitempty"` AutoGenerate bool `bson:"auto_generate,omitempty" json:"auto_generate,omitempty"` ChoiceOption []string `bson:"choice_option,omitempty" json:"choice_option,omitempty"` }
type JenkinsParamType ¶ added in v1.9.9
type JenkinsParamType string
const ( Str JenkinsParamType = "string" Choice JenkinsParamType = "choice" )
type MatchAttribute ¶ added in v1.9.9
type MediumType ¶ added in v1.9.9
type MediumType string
const ( ObjectMedium MediumType = "object" NFSMedium MediumType = "nfs" )
type NFSProperties ¶ added in v1.9.9
type NFSProperties struct { ProvisionType ProvisionType `json:"provision_type" bson:"provision_type"` StorageClass string `json:"storage_class" bson:"storage_class"` StorageSizeInGiB int64 `json:"storage_size_in_gib" bson:"storage_size_in_gib"` PVC string `json:"pvc" bson:"pvc"` Subpath string `json:"subpath" bson:"subpath"` }
type ObjectProperties ¶ added in v1.9.9
type ObjectProperties struct {
ID string `json:"id" bson:"id"`
}
Note: In the current design, when the object storage is used as the cache medium, the default object storage will be used as the cache medium, but in the near future users may be allowed to select different object storage as the cache medium according to the cluster. So it is temporarily reserved in `v1.10.0`, but do not use.
type ObjectStorageInfo ¶ added in v1.9.9
type ObjectStorageInfo struct { Endpoint string `bson:"endpoint" json:"endpoint" yaml:"endpoint"` AK string `bson:"AK" json:"AK" yaml:"AK"` SK string `bson:"SK" json:"SK" yaml:"SK"` Bucket string `bson:"bucket" json:"bucket" yaml:"bucket"` Insecure bool `bson:"insecure" json:"insecure" yaml:"insecure"` Provider int8 `bson:"provider" json:"provider" yaml:"provider"` }
type ObjectStoragePathDetail ¶ added in v1.9.9
type PolicyMeta ¶ added in v1.9.9
type PolicyMetaScope ¶ added in v1.9.9
type PolicyMetaScope string
PolicyMetaScope resource scope for permission
const ( SystemScope PolicyMetaScope = "system" ProjectScope PolicyMetaScope = "project" )
type PolicyRule ¶ added in v1.9.9
type Probe ¶ added in v1.9.9
type Probe struct { ProbeScheme string `bson:"probe_type" json:"probe_type"` HttpProbe *HTTPGetAction `bson:"http_probe" json:"http_probe"` }
type ProvisionType ¶ added in v1.9.9
type ProvisionType string
const ( DynamicProvision ProvisionType = "dynamic" StaticProvision ProvisionType = "static" )
type ReaperType ¶ added in v1.9.9
type ReaperType string
const ( BuildReaperType ReaperType = "Build" TestReaperType ReaperType = "Test" ScanningReaperType ReaperType = "Scanning" )
type Repository ¶
type Repository struct { Source string `bson:"source,omitempty" json:"source,omitempty" yaml:"source,omitempty"` RepoOwner string `bson:"repo_owner" json:"repo_owner" yaml:"repo_owner"` RepoNamespace string `bson:"repo_namespace" json:"repo_namespace" yaml:"repo_namespace"` RepoName string `bson:"repo_name" json:"repo_name" yaml:"repo_name"` RemoteName string `bson:"remote_name,omitempty" json:"remote_name,omitempty" yaml:"remote_name,omitempty"` Branch string `bson:"branch" json:"branch" yaml:"branch"` PR int `bson:"pr,omitempty" json:"pr,omitempty" yaml:"pr,omitempty"` Tag string `bson:"tag,omitempty" json:"tag,omitempty" yaml:"tag,omitempty"` CommitID string `bson:"commit_id,omitempty" json:"commit_id,omitempty" yaml:"commit_id,omitempty"` CommitMessage string `bson:"commit_message,omitempty" json:"commit_message,omitempty" yaml:"commit_message,omitempty"` CheckoutPath string `bson:"checkout_path,omitempty" json:"checkout_path,omitempty" yaml:"checkout_path,omitempty"` SubModules bool `bson:"submodules,omitempty" json:"submodules,omitempty" yaml:"submodules,omitempty"` // UseDefault defines if the repo can be configured in start pipeline task page UseDefault bool `bson:"use_default,omitempty" json:"use_default,omitempty" yaml:"use_default,omitempty"` // IsPrimary used to generated image and package name, each build has one primary repo IsPrimary bool `bson:"is_primary" json:"is_primary" yaml:"is_primary"` CodehostID int `bson:"codehost_id" json:"codehost_id" yaml:"codehost_id"` // add OauthToken string `bson:"oauth_token" json:"oauth_token" yaml:"oauth_token"` Address string `bson:"address" json:"address" yaml:"address"` AuthorName string `bson:"author_name,omitempty" json:"author_name,omitempty" yaml:"author_name,omitempty"` CheckoutRef string `bson:"checkout_ref,omitempty" json:"checkout_ref,omitempty" yaml:"checkout_ref,omitempty"` // codehub ProjectUUID string `bson:"project_uuid,omitempty" json:"project_uuid,omitempty" yaml:"project_uuid,omitempty"` RepoUUID string `bson:"repo_uuid,omitempty" json:"repo_uuid,omitempty" yaml:"repo_uuid,omitempty"` RepoID string `bson:"repo_id,omitempty" json:"repo_id,omitempty" yaml:"repo_id,omitempty"` Username string `bson:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"` Password string `bson:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"` // Now EnableProxy is not something we store. We decide this on runtime EnableProxy bool `bson:"-" json:"enable_proxy,omitempty" yaml:"enable_proxy,omitempty"` // FilterRegexp is the regular expression filter for the branches and tags FilterRegexp string `bson:"-" json:"filter_regexp,omitempty" yaml:"filter_regexp,omitempty"` // The address of the code base input of the other type AuthType AuthType `bson:"auth_type,omitempty" json:"auth_type,omitempty" yaml:"auth_type,omitempty"` SSHKey string `bson:"ssh_key,omitempty" json:"ssh_key,omitempty" yaml:"ssh_key,omitempty"` PrivateAccessToken string `bson:"private_access_token,omitempty" json:"private_access_token,omitempty" yaml:"private_access_token,omitempty"` }
Repository struct
func (*Repository) BranchRef ¶ added in v1.9.9
func (r *Repository) BranchRef() string
BranchRef returns branch refs format e.g. refs/heads/master
func (*Repository) GetReleaseCandidateTag ¶
func (repo *Repository) GetReleaseCandidateTag(taskID int64) string
GetReleaseCandidateTag 返回待发布对象Tag Branch: 20060102150405-{TaskID}-master PR: 20060102150405-{TaskID}-pr-1765 Branch + PR: 20060102150405-{TaskID}-master-pr-1276 Tag: 20060102150405-{TaskID}-v0.9.1
func (*Repository) GetRepoNamespace ¶ added in v1.9.9
func (repo *Repository) GetRepoNamespace() string
func (*Repository) PRRef ¶ added in v1.9.9
func (r *Repository) PRRef() string
PRRef returns refs format It will check repo provider type, by default returns github refs format.
e.g. github returns refs/pull/1/head e.g. gitlab returns merge-requests/1/head
func (*Repository) Ref ¶ added in v1.9.9
func (r *Repository) Ref() string
Ref returns the changes ref of current repo in the following order: 1. tag ref 2. branch ref 3. pr ref
func (*Repository) TagRef ¶ added in v1.9.9
func (r *Repository) TagRef() string
TagRef returns the tag ref of current repo e.g. refs/tags/v1.0.0
type RoleBinding ¶ added in v1.9.9
type Rule ¶ added in v1.9.9
type Rule struct { Verbs []string `json:"verbs"` Resources []string `json:"resources"` Kind string `json:"kind"` MatchAttributes []MatchAttribute `json:"match_attributes"` }
type RuleMeta ¶ added in v1.9.9
type RuleMeta struct { Action string `json:"action"` Alias string `json:"alias"` Description string `json:"description"` Rules []*ActionRule `json:"rules"` }
type ScanningAdvancedSetting ¶ added in v1.12.0
type ScanningAdvancedSetting struct { ClusterID string `bson:"cluster_id" json:"cluster_id"` Timeout int64 `bson:"timeout" json:"timeout"` ResReq setting.Request `bson:"res_req" json:"res_req"` ResReqSpec setting.RequestSpec `bson:"res_req_spec" json:"res_req_spec"` HookCtl *ScanningHookCtl `bson:"hook_ctl" json:"hook_ctl"` }
type ScanningHook ¶ added in v1.12.0
type ScanningHook struct { CodehostID int `bson:"codehost_id" json:"codehost_id"` Source string `bson:"source" json:"source"` RepoOwner string `bson:"repo_owner" json:"repo_owner"` RepoName string `bson:"repo_name" json:"repo_name"` Branch string `bson:"branch" json:"branch"` Events []config.HookEventType `bson:"events" json:"events"` MatchFolders []string `bson:"match_folders" json:"match_folders"` }
type ScanningHookCtl ¶ added in v1.12.0
type ScanningHookCtl struct { Enabled bool `bson:"enabled" json:"enabled"` Items []*ScanningHook `bson:"items" json:"items"` }
type StartDevmodeInfo ¶ added in v1.9.9
type StartDevmodeInfo struct {
DevImage string `json:"dev_image"`
}
type StorageClassType ¶ added in v1.9.9
type StorageClassType string
const (
StorageClassAll StorageClassType = "all"
)
type UserCountByType ¶ added in v1.9.9
type UserInfo ¶ added in v1.9.9
type UserInfo struct { LastLoginTime int64 `json:"last_login_time"` Uid string `json:"uid"` Name string `json:"name"` IdentityType string `gorm:"default:'unknown'" json:"identity_type"` Email string `json:"email"` Phone string `json:"phone"` Account string `json:"account"` APIToken string `json:"token"` SystemRoleBindings []*RoleBinding `json:"system_role_bindings"` Admin bool `json:"admin"` }
type WorkloadInfo ¶ added in v1.9.9
type WorkloadType ¶ added in v1.9.9
type WorkloadType string
const ( DeploymentWorkload WorkloadType = "deployment" StatefulSetWorkload WorkloadType = "statefulset" )