Documentation ¶
Index ¶
- Constants
- func AddDeliveryVersion(taskID int, productName, workflowName string, pipelineTask *taskmodels.Task, ...) error
- func CancelTask(userName, pipelineName string, taskID int64, typeString config.PipelineType, ...) error
- func CancelTaskV2(userName, pipelineName string, taskID int64, typeString config.PipelineType, ...) error
- func CancelWorkflowTaskV3(userName, pipelineName string, taskID int64, typeString config.PipelineType, ...) error
- func CopyAndUploadService(projectName, serviceName, currentChartPath string, copies []string, ...) error
- func CreateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
- func CreateDBInstance(args *commonmodels.DBInstance, log *zap.SugaredLogger) error
- func CreateFavorite(favorite *models.Favorite) error
- func Delete(name, productName string, log *zap.SugaredLogger) error
- func DeleteClusterResource(selector labels.Selector, clusterID string, log *zap.SugaredLogger) error
- func DeleteDBInstance(id string) error
- func DeleteDeliveryInfos(productName string, log *zap.SugaredLogger) error
- func DeleteFavorite(args *mongodb.FavoriteArgs) error
- func DeleteManyFavorites(args *mongodb.FavoriteArgs) error
- func DeleteNamespaceIfMatch(namespace string, selector labels.Selector, clusterID string, ...) error
- func DeleteNamespacedResource(namespace string, selector labels.Selector, clusterID string, ...) error
- func DeletePipeline(pipelineName, requestID string, isDeletingProductTmpl bool, ...) error
- func DeletePipelines(productName, requestID string, log *zap.SugaredLogger) error
- func DeleteServiceWebhookByName(serviceName, productName string, production bool, logger *zap.SugaredLogger)
- func DeleteTestModule(name, productName, requestID string, log *zap.SugaredLogger) error
- func DeleteWorkflow(workflowName, requestID string, isDeletingProductTmpl bool, ...) error
- func DeleteWorkflowV3(workflowID, workflowName, requestID string, log *zap.SugaredLogger) error
- func DeleteWorkflowV3s(productName, requestID string, log *zap.SugaredLogger) error
- func DeleteWorkflowV4(name string, logger *zap.SugaredLogger) error
- func DeleteWorkflowV4sByProjectName(projectName string, log *zap.SugaredLogger) error
- func DeleteWorkflows(productName, requestID string, log *zap.SugaredLogger) error
- func DeleteZadigLabelFromNamespace(namespace string, clusterID string, log *zap.SugaredLogger) error
- func DisableCronjobForWorkflow(workflow *models.Workflow) error
- func DisableCronjobForWorkflowV4(workflow *commonmodels.WorkflowV4) error
- func EncryptKeyVals(encryptedKey string, kvs []*commonmodels.KeyVal, logger *zap.SugaredLogger) error
- func EncryptParams(encryptedKey string, params []*commonmodels.Param, logger *zap.SugaredLogger) error
- func EnsureDefaultRegistrySecret(namespace string, registryId string, kubeClient client.Client, ...) error
- func EnsureResp(build *commonmodels.Build)
- func EnsureSecretEnvs(existedKVs []*commonmodels.KeyVal, newKVs []*commonmodels.KeyVal)
- func ExtractImageRegistry(imageURI string) (string, error)
- func ExtractImageTag(imageURI string) string
- func ExtractRegistryNamespace(imageURI string) string
- func FillGitNamespace(yamlData *templatemodels.CustomYaml) error
- func FillProductTemplateValuesYamls(tmpl *templatemodels.Product, production bool, log *zap.SugaredLogger) error
- func FillServiceCreationInfo(serviceTemplate *models.Service) error
- func FillServiceModules2Jobs(args *commonmodels.WorkflowV4) (*commonmodels.WorkflowV4, bool, error)
- func FilterWorkloadsByEnv(exist []commonmodels.Workload, productName, env string) []commonmodels.Workload
- func FindDBInstance(id, name string) (*commonmodels.DBInstance, error)
- func FindDefaultRegistry(getRealCredential bool, log *zap.SugaredLogger) (reg *models.RegistryNamespace, isSystemDefault bool, err error)
- func FindRegistryById(registryId string, getRealCredential bool, log *zap.SugaredLogger) (reg *models.RegistryNamespace, isSystemDefault bool, err error)
- func FindReposByTarget(projectName, serviceName, serviceModule string, build *commonmodels.Build) []*types.Repository
- func FindServiceFromIngress(hostInfos []resource.HostInfo, currentWorkload *Workload, ...) []resource.HostInfo
- func GetConfigPayload(codeHostID int) *models.ConfigPayload
- func GetCreateFromChartTemplate(createFrom interface{}) (*models.CreateFromChartTemplate, error)
- func GetDefaultLLMClient(ctx context.Context) (llm.ILLM, error)
- func GetDeliveryVersion(args *commonrepo.DeliveryVersionArgs, log *zap.SugaredLogger) (*commonmodels.DeliveryVersion, error)
- func GetDeploymentWorkloadResource(d *appsv1.Deployment, informer informers.SharedInformerFactory, ...) *internalresource.Workload
- func GetDockerfileTemplateContent(id string) (string, error)
- func GetEstimatedMergedVariables(services []*commonmodels.Service, product *template.Product) (map[string]string, map[string][]*commontypes.ServiceVariableKV)
- func GetGitlabAddress(URL string) (string, error)
- func GetHelmServiceName(prod *models.Product, resType, resName string, kubeClient client.Client, ...) (string, error)
- func GetLLMClient(ctx context.Context, name string) (llm.ILLM, error)
- func GetLocalTestSuite(pipelineName, serviceName, testType string, taskID int64, testName string, ...) (*commonmodels.TestReport, error)
- func GetNacosClient(nacosID string) (*nacos.Client, error)
- func GetPipelineInfo(pipelineName string, log *zap.SugaredLogger) (*commonmodels.Pipeline, error)
- func GetProductEnvNamespace(envName, productName, namespace string) string
- func GetProductTargetMap(prod *commonmodels.Product) (map[string][]commonmodels.DeployEnv, map[string]string)
- func GetProductTemplate(productName string, log *zap.SugaredLogger) (*template.Product, error)
- func GetProductionServiceTemplate(serviceName, serviceType, productName, excludeStatus string, revision int64, ...) (*commonmodels.Service, error)
- func GetRSAKey() ([]byte, []byte, 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 GetWorkflowTaskCallback(taskID int64, pipelineName string) (*commonmodels.CallbackRequest, error)
- func GetWorkflowV4LocalTestSuite(workflowName, jobName string, taskID int64, log *zap.SugaredLogger) (*commonmodels.TestReport, error)
- func HandleCallback(req *commonmodels.CallbackRequest) error
- func InsertDeliveryTest(args *commonmodels.DeliveryTest, log *zap.SugaredLogger) error
- func InsertDeliveryVersion(args *commonmodels.DeliveryVersion, log *zap.SugaredLogger) error
- func List(log *zap.SugaredLogger) []*models.Queue
- func ListDBInstances(encryptedKey string, log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
- func ListDBInstancesInfo(log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
- func ListDBInstancesInfoByProject(projectName string, log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
- func ListFavorites(args *mongodb.FavoriteArgs) ([]*models.Favorite, error)
- func ListHelmRepos(encryptedKey string, log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
- func ListHelmReposByProject(projectName string, log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
- func ListHelmReposPublic() ([]*commonmodels.HelmRepo, error)
- func ListNacosConfig(nacosID, namespaceID string, log *zap.SugaredLogger) ([]*types.NacosConfig, error)
- func ListNacosNamespace(nacosID string, log *zap.SugaredLogger) ([]*types.NacosNamespace, error)
- func ListRegistryByProject(projectName string, log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
- func ListRegistryNamespaces(encryptedKey string, getRealCredential bool, log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
- func LogProductStats(user, event, prodName, requestID string, startTime int64, ...)
- func MergeBuildEnvs(templateEnvs []*commonmodels.KeyVal, customEnvs []*commonmodels.KeyVal) []*commonmodels.KeyVal
- func MergeParams(templateEnvs []*commonmodels.Param, customEnvs []*commonmodels.Param) []*commonmodels.Param
- func ProcessServiceWebhook(updated, current *commonmodels.Service, serviceName string, production bool, ...)
- func ProcessWebhook(updatedHooks, currentHooks interface{}, name string, logger *zap.SugaredLogger) error
- func ReleaseCandidate(builds []*types.Repository, taskID int64, ...) string
- func Remove(task *models.Queue, log *zap.SugaredLogger) error
- func ReplaceRuleVariable(rule string, replaceValue *Variable) string
- func SaveAndUploadService(projectName, serviceName string, copies []string, fileTree fs.FS, ...) error
- func UnMarshalSourceDetail(source interface{}) (*models.CreateFromRepo, error)
- func UpdateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
- func UpdateDBInstance(id string, args *commonmodels.DBInstance, log *zap.SugaredLogger) error
- func UpdatePmServiceTemplate(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
- func ValidateDBInstance(args *commonmodels.DBInstance) error
- type ContainerWithBuilds
- type ConvertVaraibleKVAndYamlActionType
- type ConvertVaraibleKVAndYamlArgs
- type CronjobPayload
- type Empty
- type EnvService
- type EnvServices
- type Features
- type FilterFunc
- type GetAesKeyFromEncryptedKeyResp
- type GetRSAPublicKeyRes
- type GetSvcRenderArg
- type GetSvcRenderRequest
- type HelmSvcRenderArg
- func (args *HelmSvcRenderArg) DiffValues(target *HelmSvcRenderArg) RenderChartDiffResult
- func (args *HelmSvcRenderArg) FillRenderChartModel(chart *templatemodels.ServiceRender, version string)
- func (args *HelmSvcRenderArg) GetUniqueKvMap() map[string]interface{}
- func (args *HelmSvcRenderArg) LoadFromRenderChartModel(chart *templatemodels.ServiceRender)
- func (args *HelmSvcRenderArg) ToOverrideValueString() string
- type HookSet
- type IngressInfo
- type IstioGatewayInfo
- type IstioGatewayServer
- type K8sSvcRenderArg
- type KVPair
- type PipelineResource
- type RenderChartDiffResult
- type RepoConfig
- type ServiceProductMap
- type ServiceResp
- type ServiceTmplBuildObject
- type ServiceTmplObject
- type ServiceTmplResp
- type SvcResources
- type SvcResp
- type TemplateSvcResp
- type ValuesDataArgs
- type ValuesResp
- type Variable
- type Workload
- type ZadigServiceStatusResp
Constants ¶
const (
FavoriteTypeEnv = "environment"
)
const (
InterceptCommitID = 8
)
const SplitSymbol = "&"
Variables ¶
This section is empty.
Functions ¶
func AddDeliveryVersion ¶
func AddDeliveryVersion(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 CancelWorkflowTaskV3 ¶
func CancelWorkflowTaskV3(userName, pipelineName string, taskID int64, typeString config.PipelineType, requestID string, log *zap.SugaredLogger) error
func CopyAndUploadService ¶
func CreateBuild ¶
func CreateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
func CreateDBInstance ¶
func CreateDBInstance(args *commonmodels.DBInstance, log *zap.SugaredLogger) error
func CreateFavorite ¶
func DeleteClusterResource ¶
func DeleteDBInstance ¶
func DeleteDeliveryInfos ¶
func DeleteDeliveryInfos(productName string, log *zap.SugaredLogger) error
func DeleteFavorite ¶
func DeleteFavorite(args *mongodb.FavoriteArgs) error
func DeleteManyFavorites ¶
func DeleteManyFavorites(args *mongodb.FavoriteArgs) error
func DeleteNamespaceIfMatch ¶
func DeleteNamespacedResource ¶
func DeleteNamespacedResource(namespace string, selector labels.Selector, clusterID string, log *zap.SugaredLogger) error
DeleteNamespacedResource deletes the namespaced resources by labels.
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 DeleteServiceWebhookByName ¶
func DeleteServiceWebhookByName(serviceName, productName string, production bool, 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 DeleteWorkflowV3 ¶
func DeleteWorkflowV3(workflowID, workflowName, requestID string, log *zap.SugaredLogger) error
func DeleteWorkflowV3s ¶
func DeleteWorkflowV3s(productName, requestID string, log *zap.SugaredLogger) error
func DeleteWorkflowV4 ¶
func DeleteWorkflowV4(name string, logger *zap.SugaredLogger) error
func DeleteWorkflowV4sByProjectName ¶
func DeleteWorkflowV4sByProjectName(projectName string, log *zap.SugaredLogger) error
func DeleteWorkflows ¶
func DeleteWorkflows(productName, requestID string, log *zap.SugaredLogger) error
func DeleteZadigLabelFromNamespace ¶
func DeleteZadigLabelFromNamespace(namespace string, clusterID string, log *zap.SugaredLogger) error
func DisableCronjobForWorkflowV4 ¶
func DisableCronjobForWorkflowV4(workflow *commonmodels.WorkflowV4) error
func EncryptKeyVals ¶
func EncryptKeyVals(encryptedKey string, kvs []*commonmodels.KeyVal, logger *zap.SugaredLogger) error
func EncryptParams ¶
func EncryptParams(encryptedKey string, params []*commonmodels.Param, logger *zap.SugaredLogger) error
func EnsureResp ¶
func EnsureResp(build *commonmodels.Build)
func EnsureSecretEnvs ¶
func EnsureSecretEnvs(existedKVs []*commonmodels.KeyVal, newKVs []*commonmodels.KeyVal)
EnsureSecretEnvs 转换敏感信息前端传入的Mask内容为真实内容
func ExtractImageRegistry ¶
ExtractImageRegistry extract registry url from total image uri
func ExtractImageTag ¶
ExtractImageTag extract image tag from total image uri
func ExtractRegistryNamespace ¶
ExtractRegistryNamespace extract registry namespace from image uri
func FillGitNamespace ¶
func FillGitNamespace(yamlData *templatemodels.CustomYaml) error
func FillProductTemplateValuesYamls ¶
func FillProductTemplateValuesYamls(tmpl *templatemodels.Product, production bool, log *zap.SugaredLogger) error
func FillServiceCreationInfo ¶
func FillServiceModules2Jobs ¶
func FillServiceModules2Jobs(args *commonmodels.WorkflowV4) (*commonmodels.WorkflowV4, bool, error)
func FilterWorkloadsByEnv ¶
func FilterWorkloadsByEnv(exist []commonmodels.Workload, productName, env string) []commonmodels.Workload
func FindDBInstance ¶
func FindDBInstance(id, name string) (*commonmodels.DBInstance, error)
func FindDefaultRegistry ¶
func FindDefaultRegistry(getRealCredential bool, log *zap.SugaredLogger) (reg *models.RegistryNamespace, isSystemDefault bool, err error)
func FindRegistryById ¶
func FindRegistryById(registryId string, getRealCredential bool, log *zap.SugaredLogger) (reg *models.RegistryNamespace, isSystemDefault bool, err error)
func FindReposByTarget ¶
func FindReposByTarget(projectName, serviceName, serviceModule string, build *commonmodels.Build) []*types.Repository
func FindServiceFromIngress ¶
func GetConfigPayload ¶
func GetConfigPayload(codeHostID int) *models.ConfigPayload
func GetCreateFromChartTemplate ¶
func GetCreateFromChartTemplate(createFrom interface{}) (*models.CreateFromChartTemplate, error)
func GetDeliveryVersion ¶
func GetDeliveryVersion(args *commonrepo.DeliveryVersionArgs, log *zap.SugaredLogger) (*commonmodels.DeliveryVersion, error)
func GetDeploymentWorkloadResource ¶
func GetDeploymentWorkloadResource(d *appsv1.Deployment, informer informers.SharedInformerFactory, log *zap.SugaredLogger) *internalresource.Workload
func GetEstimatedMergedVariables ¶
func GetEstimatedMergedVariables(services []*commonmodels.Service, product *template.Product) (map[string]string, map[string][]*commontypes.ServiceVariableKV)
func GetGitlabAddress ¶
func GetHelmServiceName ¶
func GetHelmServiceName(prod *models.Product, resType, resName string, kubeClient client.Client, version *version.Info) (string, error)
GetHelmServiceName get service name from annotations of resources deployed by helm resType currently only support Deployment, StatefulSet and CronJob this function needs to be optimized
func GetLocalTestSuite ¶
func GetLocalTestSuite(pipelineName, serviceName, testType string, taskID int64, testName string, typeString config.PipelineType, log *zap.SugaredLogger) (*commonmodels.TestReport, error)
func GetPipelineInfo ¶
func GetPipelineInfo(pipelineName string, log *zap.SugaredLogger) (*commonmodels.Pipeline, error)
func GetProductEnvNamespace ¶
func GetProductTargetMap ¶
func GetProductTargetMap(prod *commonmodels.Product) (map[string][]commonmodels.DeployEnv, map[string]string)
func GetProductTemplate ¶
func GetProductionServiceTemplate ¶
func GetProductionServiceTemplate(serviceName, serviceType, productName, excludeStatus string, revision int64, log *zap.SugaredLogger) (*commonmodels.Service, error)
GetProductionServiceTemplate is basically the same version of GetServiceTemplate, except that it does not support PM type service. And reads from production service coll.
func GetServiceTasks ¶
func GetServiceTasks(log *zap.SugaredLogger) (map[string][]string, error)
func GetServiceTemplate ¶
func GetServiceTemplate(serviceName, serviceType, productName, excludeStatus string, revision int64, production bool, log *zap.SugaredLogger) (*commonmodels.Service, error)
func GetSubTaskContent ¶
func GetSubTaskContent(deliveryVersion *commonmodels.DeliveryVersion, pipelineTask *taskmodels.Task, log *zap.SugaredLogger)
TODO: LOU rewrite it
func GetWorkflowTaskCallback ¶
func GetWorkflowTaskCallback(taskID int64, pipelineName string) (*commonmodels.CallbackRequest, error)
func GetWorkflowV4LocalTestSuite ¶
func GetWorkflowV4LocalTestSuite(workflowName, jobName string, taskID int64, log *zap.SugaredLogger) (*commonmodels.TestReport, error)
func HandleCallback ¶
func HandleCallback(req *commonmodels.CallbackRequest) error
func InsertDeliveryTest ¶
func InsertDeliveryTest(args *commonmodels.DeliveryTest, log *zap.SugaredLogger) error
func InsertDeliveryVersion ¶
func InsertDeliveryVersion(args *commonmodels.DeliveryVersion, log *zap.SugaredLogger) error
func ListDBInstances ¶
func ListDBInstances(encryptedKey string, log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
func ListDBInstancesInfo ¶
func ListDBInstancesInfo(log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
func ListDBInstancesInfoByProject ¶
func ListDBInstancesInfoByProject(projectName string, log *zap.SugaredLogger) ([]*commonmodels.DBInstance, error)
func ListFavorites ¶
func ListFavorites(args *mongodb.FavoriteArgs) ([]*models.Favorite, error)
func ListHelmRepos ¶
func ListHelmRepos(encryptedKey string, log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
func ListHelmReposByProject ¶
func ListHelmReposByProject(projectName string, log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)
func ListHelmReposPublic ¶
func ListHelmReposPublic() ([]*commonmodels.HelmRepo, error)
func ListNacosConfig ¶
func ListNacosConfig(nacosID, namespaceID string, log *zap.SugaredLogger) ([]*types.NacosConfig, error)
func ListNacosNamespace ¶
func ListNacosNamespace(nacosID string, log *zap.SugaredLogger) ([]*types.NacosNamespace, error)
func ListRegistryByProject ¶
func ListRegistryByProject(projectName string, log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
func ListRegistryNamespaces ¶
func ListRegistryNamespaces(encryptedKey string, getRealCredential bool, log *zap.SugaredLogger) ([]*models.RegistryNamespace, error)
func LogProductStats ¶
func LogProductStats(user, event, prodName, requestID string, startTime int64, log *zap.SugaredLogger)
func MergeBuildEnvs ¶
func MergeBuildEnvs(templateEnvs []*commonmodels.KeyVal, customEnvs []*commonmodels.KeyVal) []*commonmodels.KeyVal
func MergeParams ¶
func MergeParams(templateEnvs []*commonmodels.Param, customEnvs []*commonmodels.Param) []*commonmodels.Param
func ProcessServiceWebhook ¶
func ProcessServiceWebhook(updated, current *commonmodels.Service, serviceName string, production bool, logger *zap.SugaredLogger)
@todo add production service support
func ProcessWebhook ¶
func ProcessWebhook(updatedHooks, currentHooks interface{}, name string, logger *zap.SugaredLogger) error
func ReleaseCandidate ¶
func ReleaseCandidate(builds []*types.Repository, taskID int64, productName, serviceName, envName, imageName, deliveryType string) string
releaseCandidate 根据 TaskID 生成编译镜像Tag或者二进制包后缀 TODO: max length of a tag is 128
func ReplaceRuleVariable ¶
func SaveAndUploadService ¶
func UnMarshalSourceDetail ¶
func UnMarshalSourceDetail(source interface{}) (*models.CreateFromRepo, error)
func UpdateBuild ¶
func UpdateBuild(username string, build *commonmodels.Build, log *zap.SugaredLogger) error
func UpdateDBInstance ¶
func UpdateDBInstance(id string, args *commonmodels.DBInstance, log *zap.SugaredLogger) error
func UpdatePmServiceTemplate ¶
func UpdatePmServiceTemplate(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
func ValidateDBInstance ¶
func ValidateDBInstance(args *commonmodels.DBInstance) error
Types ¶
type ContainerWithBuilds ¶ added in v2.3.0
type ContainerWithBuilds struct { *commonmodels.Container BuildNames []string `json:"build_names"` }
func FillContainerBuilds ¶ added in v2.3.0
func FillContainerBuilds(source []*commonmodels.Container) []*ContainerWithBuilds
type ConvertVaraibleKVAndYamlActionType ¶
type ConvertVaraibleKVAndYamlActionType string
const ( ConvertVaraibleKVAndYamlActionTypeToKV ConvertVaraibleKVAndYamlActionType = "toKV" ConvertVaraibleKVAndYamlActionTypeToYaml ConvertVaraibleKVAndYamlActionType = "toYaml" )
type ConvertVaraibleKVAndYamlArgs ¶
type ConvertVaraibleKVAndYamlArgs struct { KVs []*commontypes.ServiceVariableKV `json:"kvs" binding:"required"` Yaml string `json:"yaml"` Action ConvertVaraibleKVAndYamlActionType `json:"action" binding:"required"` }
func ConvertVaraibleKVAndYaml ¶
func ConvertVaraibleKVAndYaml(args *ConvertVaraibleKVAndYamlArgs) (*ConvertVaraibleKVAndYamlArgs, error)
type CronjobPayload ¶
type EnvService ¶
type EnvService struct { ServiceName string `json:"service_name"` ServiceModules []*commonmodels.Container `json:"service_modules"` VariableYaml string `json:"variable_yaml"` VariableKVs []*commontypes.RenderVariableKV `json:"variable_kvs"` LatestVariableYaml string `json:"latest_variable_yaml"` LatestVariableKVs []*commontypes.RenderVariableKV `json:"latest_variable_kvs"` Updatable bool `json:"updatable"` Deployed bool `json:"deployed"` }
type EnvServices ¶
type EnvServices struct { ProductName string `json:"product_name"` EnvName string `json:"env_name"` Services []*EnvService `json:"services"` }
func BuildServiceInfoInEnv ¶ added in v2.3.0
func BuildServiceInfoInEnv(productInfo *commonmodels.Product, templateSvcs []*commonmodels.Service, newSvcKVsMap map[string][]*commonmodels.ServiceKeyVal, log *zap.SugaredLogger) (*EnvServices, error)
@fixme newSvcKVsMap is old struct kv map, which are the kv are from deploy job config may need to be removed, or use new kv struct helm values need to be refactored
func ListServicesInEnv ¶
func ListServicesInEnv(envName, productName string, newSvcKVsMap map[string][]*commonmodels.ServiceKeyVal, log *zap.SugaredLogger) (*EnvServices, error)
type FilterFunc ¶
func BuildWorkloadFilterFunc ¶
func BuildWorkloadFilterFunc(productInfo *models.Product, projectInfo *templatemodels.Product, filter string, log *zap.SugaredLogger) ([]FilterFunc, error)
ListWorkloadDetailsInEnv returns all workloads in the given env which meet the filter. this function is used for two scenarios: 1. calculate product status 2. list workflow details
type GetAesKeyFromEncryptedKeyResp ¶
type GetAesKeyFromEncryptedKeyResp struct {
PlainText string `json:"plain_text"`
}
func GetAesKeyFromEncryptedKey ¶
func GetAesKeyFromEncryptedKey(encryptedKey string, log *zap.SugaredLogger) (*GetAesKeyFromEncryptedKeyResp, error)
type GetRSAPublicKeyRes ¶
type GetRSAPublicKeyRes struct {
PublicKey string `json:"publicKey"`
}
func GetRSAPublicKey ¶
func GetRSAPublicKey() (*GetRSAPublicKeyRes, error)
type GetSvcRenderArg ¶
type GetSvcRenderRequest ¶
type GetSvcRenderRequest struct {
GetSvcRendersArgs []*GetSvcRenderArg `json:"get_svc_render_args"`
}
type HelmSvcRenderArg ¶
type HelmSvcRenderArg struct { EnvName string `json:"envName"` ServiceName string `json:"serviceName"` IsChartDeploy bool `json:"is_chart_deploy"` ReleaseName string `json:"release_name"` ChartRepo string `json:"chart_repo"` ChartName string `json:"chart_name"` ChartVersion string `json:"chartVersion"` OverrideValues []*KVPair `json:"overrideValues"` OverrideYaml string `json:"overrideYaml"` ValuesData *ValuesDataArgs `json:"valuesData"` YamlData *templatemodels.CustomYaml `json:"yaml_data"` VariableYaml string `json:"variable_yaml"` DeployStrategy string `json:"deploy_strategy"` // New since 1.16.0, used to determine if the service will be installed }
func GetSvcRenderArgs ¶
func GetSvcRenderArgs(productName, envName string, getSvcRendersArgs []*GetSvcRenderArg, log *zap.SugaredLogger) ([]*HelmSvcRenderArg, *models.RenderSet, error)
func (*HelmSvcRenderArg) DiffValues ¶
func (args *HelmSvcRenderArg) DiffValues(target *HelmSvcRenderArg) RenderChartDiffResult
DiffValues generate diff values to override from two chart args
func (*HelmSvcRenderArg) FillRenderChartModel ¶
func (args *HelmSvcRenderArg) FillRenderChartModel(chart *templatemodels.ServiceRender, version string)
FillRenderChartModel fill render chart model
func (*HelmSvcRenderArg) GetUniqueKvMap ¶
func (args *HelmSvcRenderArg) GetUniqueKvMap() map[string]interface{}
func (*HelmSvcRenderArg) LoadFromRenderChartModel ¶
func (args *HelmSvcRenderArg) LoadFromRenderChartModel(chart *templatemodels.ServiceRender)
LoadFromRenderChartModel load from render chart model
func (*HelmSvcRenderArg) ToOverrideValueString ¶
func (args *HelmSvcRenderArg) ToOverrideValueString() string
type HookSet ¶
type HookSet map[hookUniqueID]hookItem
func NewHookSet ¶
func NewHookSet(items ...hookItem) HookSet
NewHookSet creates a HookSet from a list of values.
func (HookSet) Difference ¶
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 IstioGatewayInfo ¶
type IstioGatewayInfo struct {
Servers []IstioGatewayServer `json:"servers"`
}
type IstioGatewayServer ¶
type IstioGatewayServer struct { Host string `json:"host"` PortProtocol string `json:"port_protocol"` PortNumber uint32 `json:"port_number"` }
func FindServiceFromIstioGateway ¶
func FindServiceFromIstioGateway(gwObjs *v1alpha3.GatewayList, serviceName string) []IstioGatewayServer
type K8sSvcRenderArg ¶
type K8sSvcRenderArg struct { EnvName string `json:"env_name,omitempty"` ServiceName string `json:"service_name,omitempty"` VariableYaml string `json:"variable_yaml"` VariableKVs []*commontypes.RenderVariableKV `json:"variable_kvs"` LatestVariableYaml string `json:"latest_variable_yaml"` LatestVariableKVs []*commontypes.RenderVariableKV `json:"latest_variable_kvs"` DeployStrategy string `json:"deploy_strategy,omitempty"` // New since 1.16.0, used to determine if the service will be installed }
func GetK8sProductionSvcRenderArgs ¶
func GetK8sProductionSvcRenderArgs(productName, envName, serviceName string, log *zap.SugaredLogger) ([]*K8sSvcRenderArg, error)
func GetK8sSvcRenderArgs ¶
func GetK8sSvcRenderArgs(productName, envName, serviceName string, production bool, log *zap.SugaredLogger) ([]*K8sSvcRenderArg, *models.RenderSet, error)
type PipelineResource ¶
type RenderChartDiffResult ¶
type RenderChartDiffResult string
const ( Different RenderChartDiffResult = "different" Same RenderChartDiffResult = "same" LogicSame RenderChartDiffResult = "logicSame" )
type RepoConfig ¶
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 []*ContainerWithBuilds `json:"containers,omitempty"` CodehostID int `json:"codehost_id"` RepoOwner string `json:"repo_owner"` RepoNamespace string `json:"repo_namespace"` 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"` CreateFrom interface{} `json:"create_from"` AutoSync bool `json:"auto_sync"` //estimated merged variable is set when the service is created from template EstimatedMergedVariable string `json:"estimated_merged_variable"` EstimatedMergedVariableKVs []*commontypes.ServiceVariableKV `json:"estimated_merged_variable_kvs"` }
type ServiceResp ¶
type ServiceResp struct { ServiceName string `json:"service_name"` ReleaseName string `json:"release_name"` IsHelmChartDeploy bool `json:"is_helm_chart_deploy"` ServiceDisplayName string `json:"service_display_name"` Type string `json:"type"` Status string `json:"status"` Error string `json:"error"` Images []string `json:"images,omitempty"` ProductName string `json:"product_name"` EnvName string `json:"env_name"` Ingress *IngressInfo `json:"ingress"` IstioGateway *IstioGatewayInfo `json:"istio_gateway"` //deprecated Ready string `json:"ready"` EnvStatuses []*models.EnvStatus `json:"env_statuses,omitempty"` WorkLoadType string `json:"workLoadType"` Revision int64 `json:"revision"` EnvConfigs []*models.EnvConfig `json:"env_configs"` Updatable bool `json:"updatable"` DeployStrategy string `json:"deploy_strategy"` // ZadigXReleaseType represents the service contain created by zadigx release workflow // frontend should limit some operations on these services ZadigXReleaseType string `json:"zadigx_release_type"` ZadigXReleaseTag string `json:"zadigx_release_tag"` }
func ListWorkloadDetails ¶
func ListWorkloadDetails(envName, clusterID, namespace, productName string, perPage, page int, log *zap.SugaredLogger, filter ...FilterFunc) (int, []*ServiceResp, error)
func ListWorkloadDetailsInEnv ¶
func ListWorkloadDetailsInEnv(envName, productName, filter string, perPage, page int, log *zap.SugaredLogger) (int, []*ServiceResp, error)
ListWorkloadDetailsInEnv returns all workload details in the given env which meet the filter. A filter is in this format: a=b,c=d, and it is a fuzzy matching. Which means it will return all records with a field called a and the value contain character b.
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"` EnvName string `json:"env_name"` VariableYaml string `json:"variable_yaml"` ServiceVariableKVs []*commontypes.ServiceVariableKV `json:"service_variable_kvs"` }
type ServiceTmplResp ¶
type ServiceTmplResp struct { Data []*ServiceProductMap `json:"data"` Total int `json:"total"` }
func ListServiceTemplate ¶
func ListServiceTemplate(productName string, production bool, log *zap.SugaredLogger) (*ServiceTmplResp, error)
ListServiceTemplate 列出服务模板
func ListWorkloadTemplate ¶
func ListWorkloadTemplate(productName, envName string, production bool, log *zap.SugaredLogger) (*ServiceTmplResp, error)
ListWorkloadTemplate 列出实例模板
type SvcResources ¶
func GeneSvcStructure ¶
func GeneSvcStructure(svcTemplate *models.Service) []*SvcResources
type SvcResp ¶
type SvcResp struct { ServiceName string `json:"service_name"` Scales []*internalresource.Workload `json:"scales"` Ingress []*internalresource.Ingress `json:"ingress"` Services []*internalresource.Service `json:"service_endpoints"` CronJobs []*internalresource.CronJob `json:"cron_jobs"` Namespace string `json:"namespace"` EnvName string `json:"env_name"` ProductName string `json:"product_name"` GroupName string `json:"group_name"` Workloads []*Workload `json:"-"` }
SvcResp struct 产品-服务详情页面Response
func GetServiceImpl ¶
func GetServiceImpl(serviceName string, serviceTmpl *commonmodels.Service, workLoadType string, env *commonmodels.Product, clientset *kubernetes.Clientset, inf informers.SharedInformerFactory, log *zap.SugaredLogger) (ret *SvcResp, err error)
type TemplateSvcResp ¶
type TemplateSvcResp struct { *commonmodels.Service Resources []*SvcResources `json:"resources"` }
func GetServiceTemplateWithStructure ¶
func GetServiceTemplateWithStructure(serviceName, serviceType, productName, excludeStatus string, revision int64, production bool, log *zap.SugaredLogger) (*TemplateSvcResp, error)
type ValuesDataArgs ¶
type ValuesDataArgs struct { YamlSource string `json:"yamlSource"` SourceID string `json:"source_id"` AutoSync bool `json:"autoSync"` GitRepoConfig *RepoConfig `json:"gitRepoConfig"` }
type ValuesResp ¶
type ValuesResp struct {
ValuesYaml string `json:"valuesYaml"`
}
func GetChartValues ¶
func GetChartValues(projectName, envName, serviceName string, isHelmChartDeploy bool, production bool) (*ValuesResp, error)
type Workload ¶
type Workload struct { EnvName string `json:"env_name"` Name string `json:"name"` Type string `json:"type"` ServiceName string `json:"-"` DeployedFromZadig bool `json:"-"` ProductName string `json:"product_name"` Replicas int32 `json:"-"` Spec corev1.PodTemplateSpec `json:"-"` Selector *metav1.LabelSelector `json:"-"` Images []string `json:"-"` Containers []*resource.ContainerImage `json:"-"` Ready bool `json:"ready"` Annotation map[string]string `json:"-"` Status string `json:"-"` ReleaseName string `json:"-"` //ReleaseName refers to the releaseName of helm services ChartName string `json:"-"` //ChartName refers to chartName of helm services }
func ListWorkloads ¶
func ListWorkloads(envName, productName string, perPage, page int, informer informers.SharedInformerFactory, version *version.Info, log *zap.SugaredLogger, filter ...FilterFunc) (int, []*Workload, error)
func ListWorkloadsInEnv ¶
func ListWorkloadsInEnv(envName, productName, filter string, perPage, page int, log *zap.SugaredLogger) (int, []*Workload, error)
ListWorkloadsInEnv returns all workloads in the given env which meet the filter with no detailed info (images or pods)
func ToDeploymentWorkload ¶
func ToDeploymentWorkload(v *appsv1.Deployment) *Workload
type ZadigServiceStatusResp ¶
type ZadigServiceStatusResp struct { ServiceName string PodStatus string Ready string Ingress []*resource.Ingress Images []string Workloads []*Workload }
func QueryPodsStatus ¶
func QueryPodsStatus(productInfo *commonmodels.Product, serviceTmpl *commonmodels.Service, serviceName string, clientset *kubernetes.Clientset, informer informers.SharedInformerFactory, log *zap.SugaredLogger) *ZadigServiceStatusResp
Source Files ¶
- build.go
- callback.go
- config_payload.go
- cronjob.go
- dbinstance.go
- delivery.go
- environment.go
- favorite.go
- helm.go
- it_report.go
- llm.go
- nacos.go
- pipeline.go
- product.go
- queue.go
- registry.go
- render.go
- rsa_key.go
- service.go
- sets.go
- stats.go
- task.go
- template_product.go
- template_store.go
- testing.go
- utils.go
- workflow.go
- workflow_v3.go
- workflow_v4.go
Directories ¶
Path | Synopsis |
---|---|
* Copyright 2023 The KodeRover Authors.
|
* Copyright 2023 The KodeRover Authors. |