Documentation ¶
Overview ¶
Package deployment 部署相关操作
Index ¶
- func BuildVolumeRootDir(runtime *dbclient.Runtime) string
- func Render(template string) string
- type DeployFSMContext
- func (fsm *DeployFSMContext) ExportLogInfoDetail(level apistructs.ErrorLogLevel, id string, humanlog, detaillog string)
- func (fsm *DeployFSMContext) FetchDeploymentConfig(namespace string) (map[string]string, map[string]string, error)
- func (fsm *DeployFSMContext) FetchDeploymentConfigDetail(namespace string) ([]apistructs.EnvConfig, []apistructs.EnvConfig, error)
- func (fsm *DeployFSMContext) GetProjectNamespace(workspace string) string
- func (fsm *DeployFSMContext) IsEnabledProjectNamespace() bool
- func (fsm *DeployFSMContext) Load() error
- func (fsm *DeployFSMContext) PrepareCheckProjectResource(app *apistructs.ApplicationDTO, projectID uint64, legacyDice *diceyml.Object, ...) (float64, float64, error)
- func (fsm *DeployFSMContext) PutHepaService() error
- func (fsm *DeployFSMContext) UpdateDeploymentStatusToRuntimeAndOrder() error
- func (fsm *DeployFSMContext) UpdateServiceGroupWithLoop(group apistructs.ServiceGroupCreateV2Request) error
- type Deployment
- func (d *Deployment) Approve(userID user.ID, orgID uint64, deploymentID uint64, reject bool, reason string, ...) error
- func (d *Deployment) CancelLastDeploy(runtimeID uint64, operator string, force bool) error
- func (d *Deployment) ContinueDeploy(deploymentID uint64) error
- func (d *Deployment) DeployStageAddons(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
- func (d *Deployment) DeployStageDomains(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
- func (d *Deployment) DeployStageServices(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
- func (d *Deployment) GetStatus(deploymentID uint64) (*apistructs.DeploymentStatusDTO, error)
- func (d *Deployment) List(userID user.ID, orgID uint64, runtimeID uint64, statuses []string, ...) (*apistructs.DeploymentListData, error)
- func (d *Deployment) ListAllDeployments(userID user.ID, orgID uint64, runtimeID uint64, statuses []string) (*apistructs.DeploymentListData, error)
- func (d *Deployment) ListOrg(ctx context.Context, userID user.ID, orgID uint64, needFilterProjectRole bool, ...) (*apistructs.DeploymentDetailListData, error)
- type Option
- func WithAddon(a *addon.Addon) Option
- func WithBundle(bdl *bundle.Bundle) Option
- func WithClusterSvc(clusterSvc clusterpb.ClusterServiceServer) Option
- func WithDBClient(db *dbclient.DBClient) Option
- func WithEncrypt(encrypt *encryption.EnvEncrypt) Option
- func WithEnvConfig(envConfig *environment.EnvConfig) Option
- func WithEventManager(evMgr *events.EventManager) Option
- func WithMigration(m *migration.Migration) Option
- func WithReleaseSvc(releaseSvc pb.ReleaseServiceServer) Option
- func WithResource(resource *resource.Resource) Option
- func WithScheduler(scheduler *scheduler.Scheduler) Option
- func WithServiceGroup(serviceGroupImpl servicegroup.ServiceGroup) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVolumeRootDir ¶
Types ¶
type DeployFSMContext ¶
type DeployFSMContext struct { Deployment *dbclient.Deployment Runtime *dbclient.Runtime Cluster *clusterpb.ClusterInfo App *apistructs.ApplicationDTO Spec *diceyml.Object ProjectNamespaces map[string]string // contains filtered or unexported fields }
func NewFSMContext ¶
func NewFSMContext(deploymentID uint64, db *dbclient.DBClient, evMgr *events.EventManager, bdl *bundle.Bundle, a *addon.Addon, m *migration.Migration, encrypt *encryption.EnvEncrypt, resource *resource.Resource, releaseSvc pb.ReleaseServiceServer, serviceGroupImpl servicegroup.ServiceGroup, scheduler *scheduler.Scheduler, envConfig *environment.EnvConfig, clusterSvc clusterpb.ClusterServiceServer) *DeployFSMContext
TODO: context should base on deployment service
func (*DeployFSMContext) ExportLogInfoDetail ¶
func (fsm *DeployFSMContext) ExportLogInfoDetail(level apistructs.ErrorLogLevel, id string, humanlog, detaillog string)
func (*DeployFSMContext) FetchDeploymentConfig ¶
func (*DeployFSMContext) FetchDeploymentConfigDetail ¶
func (fsm *DeployFSMContext) FetchDeploymentConfigDetail(namespace string) ([]apistructs.EnvConfig, []apistructs.EnvConfig, error)
func (*DeployFSMContext) GetProjectNamespace ¶
func (fsm *DeployFSMContext) GetProjectNamespace(workspace string) string
GetProjectNamespace 获取项目命名空间
func (*DeployFSMContext) IsEnabledProjectNamespace ¶
func (fsm *DeployFSMContext) IsEnabledProjectNamespace() bool
IsEnabledProjectNamespace 是否开启了项目命名空间
func (*DeployFSMContext) Load ¶
func (fsm *DeployFSMContext) Load() error
func (*DeployFSMContext) PrepareCheckProjectResource ¶
func (fsm *DeployFSMContext) PrepareCheckProjectResource(app *apistructs.ApplicationDTO, projectID uint64, legacyDice *diceyml.Object, runtime *dbclient.Runtime) (float64, float64, error)
prepareCheckProjectResource 计算项目预留资源,是否满足发布徐局
func (*DeployFSMContext) PutHepaService ¶
func (fsm *DeployFSMContext) PutHepaService() error
putHepaService 发送给hepa的数据信息
func (*DeployFSMContext) UpdateDeploymentStatusToRuntimeAndOrder ¶
func (fsm *DeployFSMContext) UpdateDeploymentStatusToRuntimeAndOrder() error
func (*DeployFSMContext) UpdateServiceGroupWithLoop ¶
func (fsm *DeployFSMContext) UpdateServiceGroupWithLoop(group apistructs.ServiceGroupCreateV2Request) error
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment 部署对象封装
func (*Deployment) CancelLastDeploy ¶
func (d *Deployment) CancelLastDeploy(runtimeID uint64, operator string, force bool) error
func (*Deployment) ContinueDeploy ¶
func (d *Deployment) ContinueDeploy(deploymentID uint64) error
func (*Deployment) DeployStageAddons ¶
func (d *Deployment) DeployStageAddons(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
func (*Deployment) DeployStageDomains ¶
func (d *Deployment) DeployStageDomains(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
func (*Deployment) DeployStageServices ¶
func (d *Deployment) DeployStageServices(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)
func (*Deployment) GetStatus ¶
func (d *Deployment) GetStatus(deploymentID uint64) (*apistructs.DeploymentStatusDTO, error)
GetStatus 查询部署状态
func (*Deployment) List ¶
func (d *Deployment) List(userID user.ID, orgID uint64, runtimeID uint64, statuses []string, page apistructs.PageInfo) ( *apistructs.DeploymentListData, error)
List 查询部署记录列表
func (*Deployment) ListAllDeployments ¶
func (d *Deployment) ListAllDeployments(userID user.ID, orgID uint64, runtimeID uint64, statuses []string) ( *apistructs.DeploymentListData, error)
ListAllDeployments 查询所有部署记录列表
func (*Deployment) ListOrg ¶
func (d *Deployment) ListOrg(ctx context.Context, userID user.ID, orgID uint64, needFilterProjectRole bool, needApproval *bool, approvedBy *user.ID, operateUsers []string, approved *bool, approvalStatus *string, types []string, ids []uint64, page apistructs.PageInfo) ( *apistructs.DeploymentDetailListData, error)
ListOrg 查询部署记录(列出orgid下所有有权限的deployments)
type Option ¶
type Option func(*Deployment)
Option 部署对象配置选项
func WithClusterSvc ¶
func WithClusterSvc(clusterSvc clusterpb.ClusterServiceServer) Option
func WithEncrypt ¶
func WithEncrypt(encrypt *encryption.EnvEncrypt) Option
WithEncrypt 配置 encrypt service
func WithEnvConfig ¶
func WithEnvConfig(envConfig *environment.EnvConfig) Option
func WithEventManager ¶
func WithEventManager(evMgr *events.EventManager) Option
WithEventManager 配置 EventManager
func WithMigration ¶
WithMigration 配置 Migration service
func WithReleaseSvc ¶
func WithReleaseSvc(releaseSvc pb.ReleaseServiceServer) Option
WithReleaseSvc 配置 dicehub release service
func WithResource ¶
WithResource 配置 Runtime service
func WithScheduler ¶
func WithServiceGroup ¶
func WithServiceGroup(serviceGroupImpl servicegroup.ServiceGroup) Option
Click to show internal directories.
Click to hide internal directories.