jobcontroller

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 98 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DindServer              = "dind"
	KoderoverAgentNamespace = "koderover-agent"
)
View Source
const (
	StatusChecking   = "checking"
	StatusNormal     = "normal"
	StatusAbnormal   = "abnormal"
	StatusUnfinished = "unfinished"
)
View Source
const (
	ZadigIstioLabelOriginal  = "original"
	ZadigIstioLabelDuplicate = "duplicate"
)
View Source
const (
	ZadigIstioIdentifierLabel                 = "zadig-istio-release-version"
	ZadigIstioOriginalVSLabel                 = "last-applied-virtual-service"
	ZadigIstioVirtualServiceLastAppliedRoutes = "last-applied-routes"
	WorkloadCreator                           = "workload-creator"
)

label definition

View Source
const (
	VirtualServiceNameTemplate     = "%s-vs-zadig"
	ServiceDestinationRuleTemplate = "%s-zadig"
)

naming conventions

View Source
const (
	BusyBoxImage               = "koderover.tencentcloudcr.com/koderover-public/busybox:latest"
	ZadigContextDir            = "/zadig/"
	ZadigLogFile               = ZadigContextDir + "zadig.log"
	ZadigLifeCycleFile         = ZadigContextDir + "lifecycle"
	ExecutorResourceVolumeName = "executor-resource"
	ExecutorVolumePath         = "/executor"
	JobExecutorFile            = ExecutorVolumePath + "/jobexecutor"

	// build job outputs key
	IMAGEKEY    = "IMAGE"
	IMAGETAGKEY = "imageTag"
)
View Source
const (
	CanaryDeploymentSuffix = "-zadig-canary"
)

Variables

This section is empty.

Functions

func BuildCleanJob

func BuildCleanJob(jobName, clusterID, workflowName string, taskID int64) (*batchv1.Job, error)

func CleanWorkflowJobs

func CleanWorkflowJobs(ctx context.Context, workflowTask *commonmodels.WorkflowTask, workflowCtx *commonmodels.WorkflowTaskCtx, logger *zap.SugaredLogger, ack func())

func GetJobContainerName

func GetJobContainerName(name string) string

func GetK8sClients

func GetK8sClients(hubServerAddr, clusterID string) (crClient.Client, kubernetes.Interface, *rest.Config, crClient.Reader, error)

func GetObjectPath

func GetObjectPath(subFolder, name string) string

func RunJobs

func RunJobs(ctx context.Context, jobs []*commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, concurrency int, logger *zap.SugaredLogger, ack func())

func UpdateProductServiceDeployInfo

func UpdateProductServiceDeployInfo(deployInfo *ProductServiceDeployInfo) error

UpdateProductServiceDeployInfo updates deploy info of service for some product Including: Deploy service / Update service / Uninstall services

func WaitPlainJobEnd

func WaitPlainJobEnd(ctx context.Context, taskTimeout int, namespace, jobName string, kubeClient crClient.Client, apiServer crClient.Reader, xl *zap.SugaredLogger) config.Status

Types

type ApolloJobCtl

type ApolloJobCtl struct {
	// contains filtered or unexported fields
}

func NewApolloJobCtl

func NewApolloJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *ApolloJobCtl

func (*ApolloJobCtl) Clean

func (c *ApolloJobCtl) Clean(ctx context.Context)

func (*ApolloJobCtl) Run

func (c *ApolloJobCtl) Run(ctx context.Context)

func (*ApolloJobCtl) SaveInfo

func (c *ApolloJobCtl) SaveInfo(ctx context.Context) error

type BlueGreenDeployJobCtl

type BlueGreenDeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewBlueGreenDeployJobCtl

func NewBlueGreenDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenDeployJobCtl

func (*BlueGreenDeployJobCtl) Clean

func (c *BlueGreenDeployJobCtl) Clean(ctx context.Context)

func (*BlueGreenDeployJobCtl) Run

func (*BlueGreenDeployJobCtl) SaveInfo

func (c *BlueGreenDeployJobCtl) SaveInfo(ctx context.Context) error

type BlueGreenDeployV2JobCtl

type BlueGreenDeployV2JobCtl struct {
	// contains filtered or unexported fields
}

func NewBlueGreenDeployV2JobCtl

func NewBlueGreenDeployV2JobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenDeployV2JobCtl

func (*BlueGreenDeployV2JobCtl) Clean

func (c *BlueGreenDeployV2JobCtl) Clean(ctx context.Context)

func (*BlueGreenDeployV2JobCtl) Run

func (*BlueGreenDeployV2JobCtl) SaveInfo

func (c *BlueGreenDeployV2JobCtl) SaveInfo(ctx context.Context) error

type BlueGreenReleaseJobCtl

type BlueGreenReleaseJobCtl struct {
	// contains filtered or unexported fields
}

func NewBlueGreenReleaseJobCtl

func NewBlueGreenReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenReleaseJobCtl

func (*BlueGreenReleaseJobCtl) Clean

func (c *BlueGreenReleaseJobCtl) Clean(ctx context.Context)

func (*BlueGreenReleaseJobCtl) Run

func (*BlueGreenReleaseJobCtl) SaveInfo

func (c *BlueGreenReleaseJobCtl) SaveInfo(ctx context.Context) error

type BlueGreenReleaseV2JobCtl

type BlueGreenReleaseV2JobCtl struct {
	// contains filtered or unexported fields
}

func NewBlueGreenReleaseV2JobCtl

func NewBlueGreenReleaseV2JobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenReleaseV2JobCtl

func (*BlueGreenReleaseV2JobCtl) Clean

func (*BlueGreenReleaseV2JobCtl) Run

func (*BlueGreenReleaseV2JobCtl) SaveInfo

func (c *BlueGreenReleaseV2JobCtl) SaveInfo(ctx context.Context) error

type CanaryDeployJobCtl

type CanaryDeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewCanaryDeployJobCtl

func NewCanaryDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CanaryDeployJobCtl

func (*CanaryDeployJobCtl) Clean

func (c *CanaryDeployJobCtl) Clean(ctx context.Context)

func (*CanaryDeployJobCtl) Run

func (c *CanaryDeployJobCtl) Run(ctx context.Context)

func (*CanaryDeployJobCtl) SaveInfo

func (c *CanaryDeployJobCtl) SaveInfo(ctx context.Context) error

type CanaryReleaseJobCtl

type CanaryReleaseJobCtl struct {
	// contains filtered or unexported fields
}

func NewCanaryReleaseJobCtl

func NewCanaryReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CanaryReleaseJobCtl

func (*CanaryReleaseJobCtl) Clean

func (c *CanaryReleaseJobCtl) Clean(ctx context.Context)

func (*CanaryReleaseJobCtl) Run

func (c *CanaryReleaseJobCtl) Run(ctx context.Context)

func (*CanaryReleaseJobCtl) SaveInfo

func (c *CanaryReleaseJobCtl) SaveInfo(ctx context.Context) error

type CustomDeployJobCtl

type CustomDeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewCustomDeployJobCtl

func NewCustomDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CustomDeployJobCtl

func (*CustomDeployJobCtl) Clean

func (c *CustomDeployJobCtl) Clean(ctx context.Context)

func (*CustomDeployJobCtl) Run

func (c *CustomDeployJobCtl) Run(ctx context.Context)

func (*CustomDeployJobCtl) SaveInfo

func (c *CustomDeployJobCtl) SaveInfo(ctx context.Context) error

type DeployJobCtl

type DeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewDeployJobCtl

func NewDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *DeployJobCtl

func (*DeployJobCtl) Clean

func (c *DeployJobCtl) Clean(ctx context.Context)

func (*DeployJobCtl) Run

func (c *DeployJobCtl) Run(ctx context.Context)

func (*DeployJobCtl) SaveInfo

func (c *DeployJobCtl) SaveInfo(ctx context.Context) error

type EnvVar

type EnvVar []string

type FreestyleJobCtl

type FreestyleJobCtl struct {
	// contains filtered or unexported fields
}

func NewFreestyleJobCtl

func NewFreestyleJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *FreestyleJobCtl

func (*FreestyleJobCtl) Clean

func (c *FreestyleJobCtl) Clean(ctx context.Context)

func (*FreestyleJobCtl) Run

func (c *FreestyleJobCtl) Run(ctx context.Context)

func (*FreestyleJobCtl) SaveInfo

func (c *FreestyleJobCtl) SaveInfo(ctx context.Context) error

type GrafanaJobCtl

type GrafanaJobCtl struct {
	// contains filtered or unexported fields
}

func NewGrafanaJobCtl

func NewGrafanaJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *GrafanaJobCtl

func (*GrafanaJobCtl) Clean

func (c *GrafanaJobCtl) Clean(ctx context.Context)

func (*GrafanaJobCtl) Run

func (c *GrafanaJobCtl) Run(ctx context.Context)

func (*GrafanaJobCtl) SaveInfo

func (c *GrafanaJobCtl) SaveInfo(ctx context.Context) error

type GrayReleaseJobCtl

type GrayReleaseJobCtl struct {
	// contains filtered or unexported fields
}

func NewGrayReleaseJobCtl

func NewGrayReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *GrayReleaseJobCtl

func (*GrayReleaseJobCtl) Clean

func (c *GrayReleaseJobCtl) Clean(ctx context.Context)

func (*GrayReleaseJobCtl) Errorf

func (c *GrayReleaseJobCtl) Errorf(format string, a ...any)

func (*GrayReleaseJobCtl) Run

func (c *GrayReleaseJobCtl) Run(ctx context.Context)

func (*GrayReleaseJobCtl) SaveInfo

func (c *GrayReleaseJobCtl) SaveInfo(ctx context.Context) error

type GrayRollbackJobCtl

type GrayRollbackJobCtl struct {
	// contains filtered or unexported fields
}

func NewGrayRollbackJobCtl

func NewGrayRollbackJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *GrayRollbackJobCtl

func (*GrayRollbackJobCtl) Clean

func (c *GrayRollbackJobCtl) Clean(ctx context.Context)

func (*GrayRollbackJobCtl) Errorf

func (c *GrayRollbackJobCtl) Errorf(format string, a ...any)

func (*GrayRollbackJobCtl) Run

func (c *GrayRollbackJobCtl) Run(ctx context.Context)

func (*GrayRollbackJobCtl) SaveInfo

func (c *GrayRollbackJobCtl) SaveInfo(ctx context.Context) error

type GuanceyunCheckJobCtl

type GuanceyunCheckJobCtl struct {
	// contains filtered or unexported fields
}

func NewGuanceyunCheckJobCtl

func NewGuanceyunCheckJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *GuanceyunCheckJobCtl

func (*GuanceyunCheckJobCtl) Clean

func (c *GuanceyunCheckJobCtl) Clean(ctx context.Context)

func (*GuanceyunCheckJobCtl) Run

func (c *GuanceyunCheckJobCtl) Run(ctx context.Context)

func (*GuanceyunCheckJobCtl) SaveInfo

func (c *GuanceyunCheckJobCtl) SaveInfo(ctx context.Context) error

type HelmChartDeployJobCtl

type HelmChartDeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewHelmChartDeployJobCtl

func NewHelmChartDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *HelmChartDeployJobCtl

func (*HelmChartDeployJobCtl) Clean

func (c *HelmChartDeployJobCtl) Clean(ctx context.Context)

func (*HelmChartDeployJobCtl) Run

func (*HelmChartDeployJobCtl) SaveInfo

func (c *HelmChartDeployJobCtl) SaveInfo(ctx context.Context) error

type HelmDeployJobCtl

type HelmDeployJobCtl struct {
	// contains filtered or unexported fields
}

func NewHelmDeployJobCtl

func NewHelmDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *HelmDeployJobCtl

func (*HelmDeployJobCtl) Clean

func (c *HelmDeployJobCtl) Clean(ctx context.Context)

func (*HelmDeployJobCtl) Run

func (c *HelmDeployJobCtl) Run(ctx context.Context)

func (*HelmDeployJobCtl) SaveInfo

func (c *HelmDeployJobCtl) SaveInfo(ctx context.Context) error

type IstioReleaseJobCtl

type IstioReleaseJobCtl struct {
	// contains filtered or unexported fields
}

func NewIstioReleaseJobCtl

func NewIstioReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *IstioReleaseJobCtl

func (*IstioReleaseJobCtl) Clean

func (c *IstioReleaseJobCtl) Clean(ctx context.Context)

func (*IstioReleaseJobCtl) Errorf

func (c *IstioReleaseJobCtl) Errorf(format string, a ...any)

func (*IstioReleaseJobCtl) Infof

func (c *IstioReleaseJobCtl) Infof(format string, a ...any)

func (*IstioReleaseJobCtl) Run

func (c *IstioReleaseJobCtl) Run(ctx context.Context)

func (*IstioReleaseJobCtl) SaveInfo

func (c *IstioReleaseJobCtl) SaveInfo(ctx context.Context) error

type IstioRollbackJobCtl

type IstioRollbackJobCtl struct {
	// contains filtered or unexported fields
}

func NewIstioRollbackJobCtl

func NewIstioRollbackJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *IstioRollbackJobCtl

func (*IstioRollbackJobCtl) Clean

func (c *IstioRollbackJobCtl) Clean(ctx context.Context)

func (*IstioRollbackJobCtl) Run

func (c *IstioRollbackJobCtl) Run(ctx context.Context)

func (*IstioRollbackJobCtl) SaveInfo

func (c *IstioRollbackJobCtl) SaveInfo(ctx context.Context) error

type JenkinsJobCtl

type JenkinsJobCtl struct {
	// contains filtered or unexported fields
}

func NewJenkinsJobCtl

func NewJenkinsJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *JenkinsJobCtl

func (*JenkinsJobCtl) Clean

func (c *JenkinsJobCtl) Clean(ctx context.Context)

func (*JenkinsJobCtl) Run

func (c *JenkinsJobCtl) Run(ctx context.Context)

func (*JenkinsJobCtl) SaveInfo

func (c *JenkinsJobCtl) SaveInfo(ctx context.Context) error

type JiraJobCtl

type JiraJobCtl struct {
	// contains filtered or unexported fields
}

func NewJiraJobCtl

func NewJiraJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *JiraJobCtl

func (*JiraJobCtl) Clean

func (c *JiraJobCtl) Clean(ctx context.Context)

func (*JiraJobCtl) Run

func (c *JiraJobCtl) Run(ctx context.Context)

func (*JiraJobCtl) SaveInfo

func (c *JiraJobCtl) SaveInfo(ctx context.Context) error

type JobCacheConfig

type JobCacheConfig struct {
	CacheEnable  bool               `json:"cache_enable"`
	CacheDirType types.CacheDirType `json:"cache_dir_type"`
	CacheUserDir string             `json:"cache_user_dir"`
}

type JobContext

type JobContext struct {
	Name string `yaml:"name"`
	// Workspace 容器工作目录 [必填]
	Workspace string `yaml:"workspace"`
	Proxy     *Proxy `yaml:"proxy"`
	// Envs 用户注入环境变量, 包括安装脚本环境变量 [optional]
	Envs EnvVar `yaml:"envs"`
	// SecretEnvs 用户注入敏感信息环境变量, value不能在stdout stderr中输出 [optional]
	SecretEnvs EnvVar `yaml:"secret_envs"`
	// WorkflowName
	WorkflowName string `yaml:"workflow_name"`
	// TaskID
	TaskID int64 `yaml:"task_id"`
	// Paths 执行脚本Path
	Paths string `yaml:"paths"`
	// ConfigMapName save the name of the configmap in which the jobContext resides
	ConfigMapName string `yaml:"config_map_name"`

	Steps   []*commonmodels.StepTask `yaml:"steps"`
	Outputs []string                 `yaml:"outputs"`
	// used to vm job
	Cache *JobCacheConfig `yaml:"cache"`
}

func BuildJobExcutorContext

func BuildJobExcutorContext(jobTaskSpec *commonmodels.JobTaskFreestyleSpec, job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, logger *zap.SugaredLogger) *JobContext

func (*JobContext) Decode

func (j *JobContext) Decode(job string) error

type JobCtl

type JobCtl interface {
	Run(ctx context.Context)
	// do some clean stuff when workflow finished, like collect reports or clean up resources.
	Clean(ctx context.Context)
	// SaveInfo is used to update the basic information of the job task to the mongoDB
	SaveInfo(ctx context.Context) error
}

type JobLabel

type JobLabel struct {
	JobName string
	JobType string
}

type K8sPatchJobCtl

type K8sPatchJobCtl struct {
	// contains filtered or unexported fields
}

func NewK8sPatchJobCtl

func NewK8sPatchJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *K8sPatchJobCtl

func (*K8sPatchJobCtl) Clean

func (c *K8sPatchJobCtl) Clean(ctx context.Context)

func (*K8sPatchJobCtl) Run

func (c *K8sPatchJobCtl) Run(ctx context.Context)

func (*K8sPatchJobCtl) SaveInfo

func (c *K8sPatchJobCtl) SaveInfo(ctx context.Context) error

type MeegoTransitionJobCtl

type MeegoTransitionJobCtl struct {
	// contains filtered or unexported fields
}

func NewMeegoTransitionJobCtl

func NewMeegoTransitionJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *MeegoTransitionJobCtl

func (*MeegoTransitionJobCtl) Clean

func (c *MeegoTransitionJobCtl) Clean(ctx context.Context)

func (*MeegoTransitionJobCtl) Run

func (*MeegoTransitionJobCtl) SaveInfo

func (c *MeegoTransitionJobCtl) SaveInfo(ctx context.Context) error

type MseGrayOfflineJobCtl

type MseGrayOfflineJobCtl struct {
	// contains filtered or unexported fields
}

func NewMseGrayOfflineJobCtl

func NewMseGrayOfflineJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *MseGrayOfflineJobCtl

func (*MseGrayOfflineJobCtl) Clean

func (c *MseGrayOfflineJobCtl) Clean(ctx context.Context)

func (*MseGrayOfflineJobCtl) Error

func (c *MseGrayOfflineJobCtl) Error(msg string)

func (*MseGrayOfflineJobCtl) Info

func (c *MseGrayOfflineJobCtl) Info(msg string)

func (*MseGrayOfflineJobCtl) Run

func (c *MseGrayOfflineJobCtl) Run(ctx context.Context)

func (*MseGrayOfflineJobCtl) SaveInfo

func (c *MseGrayOfflineJobCtl) SaveInfo(ctx context.Context) error

type MseGrayReleaseJobCtl

type MseGrayReleaseJobCtl struct {
	// contains filtered or unexported fields
}

func NewMseGrayReleaseJobCtl

func NewMseGrayReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *MseGrayReleaseJobCtl

func (*MseGrayReleaseJobCtl) Clean

func (c *MseGrayReleaseJobCtl) Clean(ctx context.Context)

func (*MseGrayReleaseJobCtl) Error

func (c *MseGrayReleaseJobCtl) Error(msg string)

func (*MseGrayReleaseJobCtl) Info

func (c *MseGrayReleaseJobCtl) Info(msg string)

func (*MseGrayReleaseJobCtl) Run

func (c *MseGrayReleaseJobCtl) Run(ctx context.Context)

func (*MseGrayReleaseJobCtl) SaveInfo

func (c *MseGrayReleaseJobCtl) SaveInfo(ctx context.Context) error

type NacosJobCtl

type NacosJobCtl struct {
	// contains filtered or unexported fields
}

func NewNacosJobCtl

func NewNacosJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *NacosJobCtl

func (*NacosJobCtl) Clean

func (c *NacosJobCtl) Clean(ctx context.Context)

func (*NacosJobCtl) Run

func (c *NacosJobCtl) Run(ctx context.Context)

func (*NacosJobCtl) SaveInfo

func (c *NacosJobCtl) SaveInfo(ctx context.Context) error

type OfflineServiceJobCtl

type OfflineServiceJobCtl struct {
	// contains filtered or unexported fields
}

func NewOfflineServiceJobCtl

func NewOfflineServiceJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *OfflineServiceJobCtl

func (*OfflineServiceJobCtl) Clean

func (c *OfflineServiceJobCtl) Clean(ctx context.Context)

func (*OfflineServiceJobCtl) Run

func (c *OfflineServiceJobCtl) Run(ctx context.Context)

func (*OfflineServiceJobCtl) SaveInfo

func (c *OfflineServiceJobCtl) SaveInfo(ctx context.Context) error

type PluginJobCtl

type PluginJobCtl struct {
	// contains filtered or unexported fields
}

func NewPluginsJobCtl

func NewPluginsJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *PluginJobCtl

func (*PluginJobCtl) Clean

func (c *PluginJobCtl) Clean(ctx context.Context)

func (*PluginJobCtl) Run

func (c *PluginJobCtl) Run(ctx context.Context)

func (*PluginJobCtl) SaveInfo

func (c *PluginJobCtl) SaveInfo(ctx context.Context) error

type Pool

type Pool struct {
	Jobs []*commonmodels.JobTask
	// contains filtered or unexported fields
}

Pool is a worker group that runs a number of tasks at a configured concurrency.

func NewPool

func NewPool(ctx context.Context, jobs []*commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, concurrency int, logger *zap.SugaredLogger, ack func()) *Pool

NewPool initializes a new pool with the given tasks and at the given concurrency.

func (*Pool) Run

func (p *Pool) Run()

Run runs all job within the pool and blocks until it's finished.

type ProductServiceDeployInfo

type ProductServiceDeployInfo struct {
	ProductName           string
	EnvName               string
	ServiceName           string
	Uninstall             bool
	ServiceRevision       int
	VariableYaml          string
	VariableKVs           []*commontypes.RenderVariableKV
	Containers            []*models.Container
	UpdateServiceRevision bool
	UserName              string
	Resources             []*unstructured.Unstructured
}

type Proxy

type Proxy struct {
	Type                   string `yaml:"type"`
	Address                string `yaml:"address"`
	Port                   int    `yaml:"port"`
	NeedPassword           bool   `yaml:"need_password"`
	Username               string `yaml:"username"`
	Password               string `yaml:"password"`
	EnableRepoProxy        bool   `yaml:"enable_repo_proxy"`
	EnableApplicationProxy bool   `yaml:"enable_application_proxy"`
}

Proxy 翻墙配置信息

type SQLJobCtl

type SQLJobCtl struct {
	// contains filtered or unexported fields
}

func NewSQLJobCtl

func NewSQLJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *SQLJobCtl

func (*SQLJobCtl) Clean

func (c *SQLJobCtl) Clean(ctx context.Context)

func (*SQLJobCtl) ExecMySQLStatement

func (c *SQLJobCtl) ExecMySQLStatement() error

func (*SQLJobCtl) Run

func (c *SQLJobCtl) Run(ctx context.Context)

func (*SQLJobCtl) SaveInfo

func (c *SQLJobCtl) SaveInfo(ctx context.Context) error

type UpdateEnvIstioConfigJobCtl added in v2.3.0

type UpdateEnvIstioConfigJobCtl struct {
	// contains filtered or unexported fields
}

func NewUpdateEnvIstioConfigJobCtl added in v2.3.0

func NewUpdateEnvIstioConfigJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *UpdateEnvIstioConfigJobCtl

func (*UpdateEnvIstioConfigJobCtl) Clean added in v2.3.0

func (*UpdateEnvIstioConfigJobCtl) Errorf added in v2.3.0

func (c *UpdateEnvIstioConfigJobCtl) Errorf(format string, a ...any)

func (*UpdateEnvIstioConfigJobCtl) Run added in v2.3.0

func (*UpdateEnvIstioConfigJobCtl) SaveInfo added in v2.3.0

type WorkflowTriggerJobCtl

type WorkflowTriggerJobCtl struct {
	// contains filtered or unexported fields
}

func NewWorkflowTriggerJobCtl

func NewWorkflowTriggerJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *WorkflowTriggerJobCtl

func (*WorkflowTriggerJobCtl) Clean

func (c *WorkflowTriggerJobCtl) Clean(ctx context.Context)

func (*WorkflowTriggerJobCtl) Run

func (*WorkflowTriggerJobCtl) SaveInfo

func (c *WorkflowTriggerJobCtl) SaveInfo(ctx context.Context) error

Jump to

Keyboard shortcuts

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