Documentation ¶
Index ¶
- func AddDeliveryVersion(orgID, taskID int, productName, workflowName string, ...) error
- func CancelTask(userName, pipelineName string, taskID int64, typeString config.PipelineType, ...) error
- func CancelTaskV2(userName, pipelineName string, taskID int64, typeString config.PipelineType, ...) error
- func CreateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
- func CreateHelmRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
- func CreateRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
- func Delete(name, productName string, log *zap.SugaredLogger) error
- func DeleteClusterResourceAsync(selector labels.Selector, kubeClient client.Client, log *zap.SugaredLogger) error
- func DeleteDeliveryInfos(productName string, log *zap.SugaredLogger) error
- func DeletePipeline(pipelineName, requestID string, isDeletingProductTmpl bool, ...) error
- func DeletePipelines(productName, requestID string, log *zap.SugaredLogger) error
- func DeleteProduct(username, envName, productName, requestID string, log *zap.SugaredLogger) (err error)
- func DeleteRenderSet(productName string, log *zap.SugaredLogger) error
- func DeleteResourcesAsync(namespace string, selector labels.Selector, kubeClient client.Client, ...) error
- func DeleteServiceWebhookByName(serviceName, productName string, logger *zap.SugaredLogger)
- func DeleteTestModule(name, productName, requestID string, log *zap.SugaredLogger) error
- func DeleteWorkflow(workflowName, requestID string, isDeletingProductTmpl bool, ...) error
- func DeleteWorkflows(productName, requestID string, log *zap.SugaredLogger) error
- func DownloadServiceManifests(base, projectName, serviceName string) error
- func EnsureDefaultRegistrySecret(namespace string, kubeClient client.Client, log *zap.SugaredLogger) error
- func EnsureResp(build *commonmodels.Build)
- func EnsureSecretEnvs(existedKVs []*commonmodels.KeyVal, newKVs []*commonmodels.KeyVal)
- func FillProductTemplateValuesYamls(tmpl *templatemodels.Product, log *zap.SugaredLogger) error
- func FillProductTemplateVars(productTemplates []*template.Product, log *zap.SugaredLogger) error
- func FindDefaultRegistry(log *zap.SugaredLogger) (*models.RegistryNamespace, error)
- func GetConfigPayload(codeHostID int) *models.ConfigPayload
- func GetDefaultRegistryNamespace(log *zap.SugaredLogger) (*models.RegistryNamespace, error)
- func GetDeliveryVersion(args *mongodb.DeliveryVersionArgs, log *zap.SugaredLogger) (*commonmodels.DeliveryVersion, error)
- func GetFeatures(log *zap.SugaredLogger) (string, error)
- func GetGitlabAddress(URL string) (string, error)
- func GetLocalTestSuite(pipelineName, serviceName, testType string, taskID int64, testName string, ...) (*commonmodels.TestReport, error)
- func GetOwnerRepoBranchPath(URL string) (string, string, string, string, string, string, error)
- func GetPipelineInfo(userID int, pipelineName string, log *zap.SugaredLogger) (*commonmodels.Pipeline, error)
- func GetProductEnvNamespace(envName, productName string) string
- func GetProductTemplate(productName string, log *zap.SugaredLogger) (*template.Product, error)
- func GetRenderSet(renderName string, revision int64, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
- func GetRenderSetInfo(renderName string, revision int64) (*commonmodels.RenderSet, error)
- func GetServiceInvolvedProjects(services []*commonmodels.Service, skipProject string) (map[string][]string, error)
- func GetServiceTasks(log *zap.SugaredLogger) (map[string][]string, error)
- func GetServiceTemplate(serviceName, serviceType, productName, excludeStatus string, revision int64, ...) (*commonmodels.Service, error)
- func GetSubTaskContent(deliveryVersion *commonmodels.DeliveryVersion, pipelineTask *taskmodels.Task, ...)
- func InsertDeliveryTest(args *commonmodels.DeliveryTest, log *zap.SugaredLogger) error
- func InsertDeliveryVersion(args *commonmodels.DeliveryVersion, log *zap.SugaredLogger) error
- func IsAllKeyCovered(arg *commonmodels.RenderSet, log *zap.SugaredLogger) error
- func IsAllKeyCoveredService(productName, serviceName string, arg *commonmodels.RenderSet, ...) error
- func List(log *zap.SugaredLogger) []*models.Queue
- func ListHelmRepos(log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
- func ListRegistryNamespaces(log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
- func ListServicesRenderKeys(services []*templatemodels.ServiceInfo, log *zap.SugaredLogger) ([]*templatemodels.RenderKV, error)
- func LogProductStats(user, event, prodName, requestID string, startTime int64, ...)
- func PreLoadServiceManifests(base string, svc *commonmodels.Service) error
- func ProcessServiceWebhook(updated, current *commonmodels.Service, serviceName string, ...)
- func ProcessWebhook(updatedHooks, currentHooks interface{}, name string, logger *zap.SugaredLogger) error
- func Remove(task *models.Queue, log *zap.SugaredLogger) error
- func RenderValueForString(origin string, rs *commonmodels.RenderSet) string
- func SaveAndUploadService(projectName, serviceName string, fileTree fs.FS) error
- func SendErrorMessage(sender, title, requestID string, err error, log *zap.SugaredLogger)
- func SendFailedTaskMessage(username, productName, name, requestID string, ...)
- func SendMessage(sender, title, content, requestID string, log *zap.SugaredLogger)
- func SetRenderDataStatus(rs *commonmodels.RenderSet, log *zap.SugaredLogger) error
- func UpdateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
- func UpdatePmServiceTemplate(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
- func UpdateRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
- func UpdateSubRenderSet(name string, kvs []*templatemodels.RenderKV, log *zap.SugaredLogger) error
- func ValidateKVs(kvs []*templatemodels.RenderKV, services []*templatemodels.ServiceInfo, ...) error
- func ValidateRenderSet(productName, renderName string, serviceInfo *templatemodels.ServiceInfo, ...) (*commonmodels.RenderSet, error)
- type CronjobPayload
- type Empty
- type Features
- type HookSet
- type IngressInfo
- type PipelineResource
- type ServiceProductMap
- type ServiceResp
- type ServiceTmplBuildObject
- type ServiceTmplObject
- type ServiceTmplResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDeliveryVersion ¶
func AddDeliveryVersion(orgID, taskID int, productName, workflowName string, pipelineTask *taskmodels.Task, logger *zap.SugaredLogger) error
func CancelTask ¶
func CancelTask(userName, pipelineName string, taskID int64, typeString config.PipelineType, reqID string, log *zap.SugaredLogger) error
func CancelTaskV2 ¶
func CancelTaskV2(userName, pipelineName string, taskID int64, typeString config.PipelineType, requestID string, log *zap.SugaredLogger) error
func CreateBuild ¶
func CreateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
func CreateHelmRenderSet ¶ added in v1.2.0
func CreateHelmRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
CreateHelmRenderSet 添加renderSet
func CreateRenderSet ¶
func CreateRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
func DeleteDeliveryInfos ¶
func DeleteDeliveryInfos(productName string, log *zap.SugaredLogger) error
func DeletePipeline ¶
func DeletePipeline(pipelineName, requestID string, isDeletingProductTmpl bool, log *zap.SugaredLogger) error
func DeletePipelines ¶
func DeletePipelines(productName, requestID string, log *zap.SugaredLogger) error
func DeleteProduct ¶
func DeleteProduct(username, envName, productName, requestID string, log *zap.SugaredLogger) (err error)
func DeleteRenderSet ¶
func DeleteRenderSet(productName string, log *zap.SugaredLogger) error
func DeleteResourcesAsync ¶
func DeleteResourcesAsync(namespace string, selector labels.Selector, kubeClient client.Client, log *zap.SugaredLogger) error
根据namespace和selector删除所有资源
func DeleteServiceWebhookByName ¶ added in v1.3.0
func DeleteServiceWebhookByName(serviceName, productName string, logger *zap.SugaredLogger)
func DeleteTestModule ¶
func DeleteTestModule(name, productName, requestID string, log *zap.SugaredLogger) error
func DeleteWorkflow ¶
func DeleteWorkflow(workflowName, requestID string, isDeletingProductTmpl bool, log *zap.SugaredLogger) error
func DeleteWorkflows ¶
func DeleteWorkflows(productName, requestID string, log *zap.SugaredLogger) error
func DownloadServiceManifests ¶ added in v1.4.0
func EnsureResp ¶
func EnsureResp(build *commonmodels.Build)
func EnsureSecretEnvs ¶
func EnsureSecretEnvs(existedKVs []*commonmodels.KeyVal, newKVs []*commonmodels.KeyVal)
EnsureSecretEnvs 转换敏感信息前端传入的Mask内容为真实内容
func FillProductTemplateValuesYamls ¶
func FillProductTemplateValuesYamls(tmpl *templatemodels.Product, log *zap.SugaredLogger) error
FillProductTemplateValuesYamls 返回renderSet中的renderChart信息
func FillProductTemplateVars ¶
func FillProductTemplateVars(productTemplates []*template.Product, log *zap.SugaredLogger) error
func FindDefaultRegistry ¶
func FindDefaultRegistry(log *zap.SugaredLogger) (*models.RegistryNamespace, error)
func GetConfigPayload ¶
func GetConfigPayload(codeHostID int) *models.ConfigPayload
func GetDefaultRegistryNamespace ¶ added in v1.2.0
func GetDefaultRegistryNamespace(log *zap.SugaredLogger) (*models.RegistryNamespace, error)
func GetDeliveryVersion ¶
func GetDeliveryVersion(args *mongodb.DeliveryVersionArgs, log *zap.SugaredLogger) (*commonmodels.DeliveryVersion, error)
func GetFeatures ¶
func GetFeatures(log *zap.SugaredLogger) (string, error)
func GetGitlabAddress ¶
func GetLocalTestSuite ¶
func GetLocalTestSuite(pipelineName, serviceName, testType string, taskID int64, testName string, typeString config.PipelineType, log *zap.SugaredLogger) (*commonmodels.TestReport, error)
func GetOwnerRepoBranchPath ¶
GetOwnerRepoBranchPath 获取gitlab路径中的owner、repo、branch和path
func GetPipelineInfo ¶
func GetPipelineInfo(userID int, pipelineName string, log *zap.SugaredLogger) (*commonmodels.Pipeline, error)
func GetProductEnvNamespace ¶
func GetProductTemplate ¶
func GetRenderSet ¶
func GetRenderSet(renderName string, revision int64, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
func GetRenderSetInfo ¶
func GetRenderSetInfo(renderName string, revision int64) (*commonmodels.RenderSet, error)
func GetServiceInvolvedProjects ¶ added in v1.3.1
func GetServiceInvolvedProjects(services []*commonmodels.Service, skipProject string) (map[string][]string, error)
GetServiceInvolvedProjects returns a map, key is a service name, value is a list of all projects which are using this service. The given services must come from same project to make sure all service names are unique.
func GetServiceTasks ¶
func GetServiceTasks(log *zap.SugaredLogger) (map[string][]string, error)
func GetServiceTemplate ¶
func GetServiceTemplate(serviceName, serviceType, productName, excludeStatus string, revision int64, log *zap.SugaredLogger) (*commonmodels.Service, error)
func GetSubTaskContent ¶
func GetSubTaskContent(deliveryVersion *commonmodels.DeliveryVersion, pipelineTask *taskmodels.Task, log *zap.SugaredLogger)
TODO: LOU rewrite it
func InsertDeliveryTest ¶
func InsertDeliveryTest(args *commonmodels.DeliveryTest, log *zap.SugaredLogger) error
func InsertDeliveryVersion ¶
func InsertDeliveryVersion(args *commonmodels.DeliveryVersion, log *zap.SugaredLogger) error
func IsAllKeyCovered ¶
func IsAllKeyCovered(arg *commonmodels.RenderSet, log *zap.SugaredLogger) error
IsAllKeyCovered 检查是否覆盖所有产品key
func IsAllKeyCoveredService ¶
func IsAllKeyCoveredService(productName, serviceName string, arg *commonmodels.RenderSet, log *zap.SugaredLogger) error
IsAllKeyCoveredService 检查是否覆盖所有服务key
func ListHelmRepos ¶
func ListHelmRepos(log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
func ListRegistryNamespaces ¶
func ListRegistryNamespaces(log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
func ListServicesRenderKeys ¶
func ListServicesRenderKeys(services []*templatemodels.ServiceInfo, log *zap.SugaredLogger) ([]*templatemodels.RenderKV, error)
func LogProductStats ¶
func LogProductStats(user, event, prodName, requestID string, startTime int64, log *zap.SugaredLogger)
func PreLoadServiceManifests ¶ added in v1.4.0
func PreLoadServiceManifests(base string, svc *commonmodels.Service) error
func ProcessServiceWebhook ¶ added in v1.3.0
func ProcessServiceWebhook(updated, current *commonmodels.Service, serviceName string, logger *zap.SugaredLogger)
func ProcessWebhook ¶ added in v1.3.0
func ProcessWebhook(updatedHooks, currentHooks interface{}, name string, logger *zap.SugaredLogger) error
func RenderValueForString ¶
func RenderValueForString(origin string, rs *commonmodels.RenderSet) string
func SaveAndUploadService ¶ added in v1.4.0
func SendErrorMessage ¶
func SendErrorMessage(sender, title, requestID string, err error, log *zap.SugaredLogger)
func SendFailedTaskMessage ¶
func SendFailedTaskMessage(username, productName, name, requestID string, workflowType config.PipelineType, err error, log *zap.SugaredLogger)
func SendMessage ¶
func SendMessage(sender, title, content, requestID string, log *zap.SugaredLogger)
func SetRenderDataStatus ¶
func SetRenderDataStatus(rs *commonmodels.RenderSet, log *zap.SugaredLogger) error
func UpdateBuild ¶
func UpdateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
func UpdatePmServiceTemplate ¶ added in v1.2.0
func UpdatePmServiceTemplate(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
func UpdateRenderSet ¶
func UpdateRenderSet(args *commonmodels.RenderSet, log *zap.SugaredLogger) error
func UpdateSubRenderSet ¶
func UpdateSubRenderSet(name string, kvs []*templatemodels.RenderKV, log *zap.SugaredLogger) error
func ValidateKVs ¶
func ValidateKVs(kvs []*templatemodels.RenderKV, services []*templatemodels.ServiceInfo, log *zap.SugaredLogger) error
func ValidateRenderSet ¶
func ValidateRenderSet(productName, renderName string, serviceInfo *templatemodels.ServiceInfo, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
ValidateRenderSet 检查指定renderSet是否能覆盖产品所有需要渲染的值
Types ¶
type CronjobPayload ¶
type HookSet ¶ added in v1.3.0
type HookSet map[hookUniqueID]hookItem
func NewHookSet ¶ added in v1.3.0
func NewHookSet(items ...hookItem) HookSet
NewHookSet creates a HookSet from a list of values.
func (HookSet) Difference ¶ added in v1.3.0
Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}
type IngressInfo ¶
type PipelineResource ¶
type ServiceProductMap ¶
type ServiceProductMap struct { Service string `json:"service_name"` Source string `json:"source"` Type string `json:"type"` Product []string `json:"product"` ProductName string `json:"product_name"` Containers []*commonmodels.Container `json:"containers,omitempty"` Visibility string `json:"visibility,omitempty"` CodehostID int `json:"codehost_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` RepoUUID string `json:"repo_uuid"` BranchName string `json:"branch_name"` LoadPath string `json:"load_path"` LoadFromDir bool `json:"is_dir"` GerritRemoteName string `json:"gerrit_remote_name,omitempty"` }
type ServiceResp ¶
type ServiceResp struct { ServiceName string `json:"service_name"` Type string `json:"type"` Status string `json:"status"` Images []string `json:"images,omitempty"` ProductName string `json:"product_name"` EnvName string `json:"env_name"` Ingress *IngressInfo `json:"ingress"` Ready string `json:"ready"` EnvStatuses []*models.EnvStatus `json:"env_statuses,omitempty"` }
产品列表页服务Response
func ListGroupsBySource ¶
func ListGroupsBySource(envName, productName string, perPage, page int, log *zap.SugaredLogger) (int, []*ServiceResp, []resource.Ingress, error)
type ServiceTmplBuildObject ¶
type ServiceTmplBuildObject struct { ServiceTmplObject *ServiceTmplObject `json:"pm_service_tmpl"` Build *commonmodels.Build `json:"build"` }
type ServiceTmplObject ¶
type ServiceTmplObject struct { ProductName string `json:"product_name"` ServiceName string `json:"service_name"` Visibility string `json:"visibility"` Revision int64 `json:"revision"` Type string `json:"type"` Username string `json:"username"` EnvConfigs []*commonmodels.EnvConfig `json:"env_configs"` EnvStatuses []*commonmodels.EnvStatus `json:"env_statuses,omitempty"` From string `json:"from,omitempty"` HealthChecks []*commonmodels.PmHealthCheck `json:"health_checks"` }
type ServiceTmplResp ¶
type ServiceTmplResp struct { Data []*ServiceProductMap `json:"data"` Total int `json:"total"` }
func ListServiceTemplate ¶
func ListServiceTemplate(productName string, log *zap.SugaredLogger) (*ServiceTmplResp, error)
ListServiceTemplate 列出服务模板