service

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 112 Imported by: 0

Documentation

Index

Constants

View Source
const K8sBetaVersionForEphemeralContainer = "v1.23"
View Source
const (
	Timeout = 60
)
View Source
const ZadigDebugContainerName = "zadig-debug"

Variables

View Source
var ClusterInformersMap sync.Map
View Source
var ClusterStopChanMap sync.Map
View Source
var DefaultCleanWhiteList = []string{"spockadmin"}
View Source
var ErrUnsupportedService = errors.New("unsupported workload type (only support Deployment/StatefulSet) or workload number is not 1")

Functions

func AutoDeployHelmServiceToEnvs added in v1.9.9

func AutoDeployHelmServiceToEnvs(userName, requestID, projectName string, serviceTemplates []*commonmodels.Service, log *zap.SugaredLogger) error

func AutoDeployYamlServiceToEnvs added in v1.9.9

func AutoDeployYamlServiceToEnvs(userName, requestID string, serviceTemplate *commonmodels.Service, log *zap.SugaredLogger) error

func BulkCopyHelmProduct added in v1.9.9

func BulkCopyHelmProduct(projectName, user, requestID string, arg CopyHelmProductArg, log *zap.SugaredLogger) error

func BulkCopyYamlProduct added in v1.9.9

func BulkCopyYamlProduct(projectName, user, requestID string, arg CopyYamlProductArg, log *zap.SugaredLogger) error

func CalculateK8sProductStatus added in v1.9.9

func CalculateK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)

func CalculateNonK8sProductStatus added in v1.9.9

func CalculateNonK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)

CalculateNonK8sProductStatus calculate product status for non k8s product: Helm + Host

func CheckServicesDeployedInSubEnvs added in v1.9.9

func CheckServicesDeployedInSubEnvs(ctx context.Context, productName, envName string, services []string) (map[string][]string, error)

Map of map[ServiceName][]string{EnvName} is returned.

func CheckWorkloadsK8sServices added in v1.9.9

func CheckWorkloadsK8sServices(ctx context.Context, envName, productName string) ([]string, error)

Slice of `<workload name>.<workload type>` and error are returned.

func CleanProductCronJob

func CleanProductCronJob(requestID string, log *zap.SugaredLogger)

func CleanProducts

func CleanProducts()

func ConnectSshPmExec added in v1.9.9

func ConnectSshPmExec(c *gin.Context, username, envName, productName, ip, hostId string, cols, rows int, log *zap.SugaredLogger) error

func CopyHelmProduct added in v1.8.0

func CopyHelmProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error

CopyHelmProduct copy product from source product, only works in test product

func CopyYamlProduct added in v1.9.9

func CopyYamlProduct(user, requestID, projectName string, args []*CreateSingleProductArg, log *zap.SugaredLogger) (err error)

CopyYamlProduct copy product from source product

func CreateCommonEnvCfg added in v1.9.9

func CreateCommonEnvCfg(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error

func CreateHelmProduct added in v1.5.0

func CreateHelmProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error

create helm product, only works in test product

func CreateHostProductionProduct added in v1.9.9

func CreateHostProductionProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error

CreateHostProductionProduct creates environment for host project, this function only creates production environment

func CreateProduct

func CreateProduct(user, requestID string, args *commonmodels.Product, log *zap.SugaredLogger) (err error)

CreateProduct create a new product with its dependent stacks

func CreateYamlProduct added in v1.9.9

func CreateYamlProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error

func DeleteClusterInformer added in v1.9.9

func DeleteClusterInformer(clusterID string)

func DeleteCommonEnvCfg added in v1.9.9

func DeleteCommonEnvCfg(envName, productName, objectName string, commonEnvCfgType config.CommonEnvCfgType, log *zap.SugaredLogger) error

func DeletePod

func DeletePod(envName, productName, podName string, log *zap.SugaredLogger) error

func DeleteProduct added in v1.9.9

func DeleteProduct(username, envName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) (err error)

func DeleteProductHelmReleases added in v1.9.9

func DeleteProductHelmReleases(userName, requestID, envName, productName string, releases []string, production bool, log *zap.SugaredLogger) (err error)

func DeleteProductServices added in v1.9.9

func DeleteProductServices(userName, requestID, envName, productName string, serviceNames []string, production bool, log *zap.SugaredLogger) (err error)

func DeleteProductionProduct added in v1.9.9

func DeleteProductionProduct(username, envName, productName, requestID string, log *zap.SugaredLogger) (err error)

func DisableBaseEnv added in v1.9.9

func DisableBaseEnv(ctx context.Context, envName, productName string) error

func DownloadFile added in v1.9.9

func DownloadFile(envName, productName, podName, container, path string, log *zap.SugaredLogger) ([]byte, string, error)

func EnableBaseEnv added in v1.9.9

func EnableBaseEnv(ctx context.Context, envName, productName string) error

func EnsureDeleteShareEnvConfig added in v1.9.9

func EnsureDeleteShareEnvConfig(ctx context.Context, env *commonmodels.Product, istioClient versionedclient.Interface) error

func EnsureDeleteZadigService added in v1.9.9

func EnsureDeleteZadigService(ctx context.Context, env *commonmodels.Product, svcSelector labels.Selector, kclient client.Client, istioClient versionedclient.Interface) error

func EnsureGrayEnvConfig added in v1.9.9

func EnsureGrayEnvConfig(ctx context.Context, env *commonmodels.Product, kclient client.Client, istioClient versionedclient.Interface) error

func EnsureProductionNamespace added in v1.9.9

func EnsureProductionNamespace(createArgs []*CreateSingleProductArg) error

func EnsureUpdateZadigService added in v1.9.9

func EnsureUpdateZadigService(ctx context.Context, env *commonmodels.Product, svcName string, kclient client.Client, istioClient versionedclient.Interface) error

func EnvAnalysisNotification added in v1.9.9

func EnvAnalysisNotification(projectName, envName, result string, configs []*commonmodels.NotificationConfig) error

func ExportProductionYaml added in v1.9.9

func ExportProductionYaml(envName, productName, serviceName string, log *zap.SugaredLogger) ([]string, error)

func ExportYaml

func ExportYaml(envName, productName, serviceName, source string, log *zap.SugaredLogger) []string

ExportYaml 查询使用到服务模板的服务组模板 source determines where the request comes from, can be "wd" or "nil"

func FindProductRenderSet added in v1.16.0

func FindProductRenderSet(productName, renderName, envName string, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)

func GeneEstimatedValues added in v1.6.0

func GeneEstimatedValues(productName, envName, serviceOrReleaseName, scene, format string, arg *EstimateValuesArg, isHelmChartDeploy bool, log *zap.SugaredLogger) (interface{}, error)

func GetAffectedServices added in v1.9.9

func GetAffectedServices(productName, envName string, arg *K8sRendersetArg, log *zap.SugaredLogger) (map[string][]string, error)

func GetBundleResources added in v1.7.1

func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)

func GetEnvAnalysisHistory added in v1.9.9

func GetEnvAnalysisHistory(projectName string, production bool, envName string, pageNum, pageSize int, log *zap.SugaredLogger) ([]*ai.EnvAIAnalysis, int64, error)

GetEnvAnalysisHistory get env AI analysis history

func GetEnvServiceList added in v1.9.9

func GetEnvServiceList(ctx context.Context, productName, baseEnvName string) ([][]string, error)

func GetEstimatedRenderCharts added in v1.5.0

func GetEstimatedRenderCharts(productName, envName string, getSvcRenderArgs []*commonservice.GetSvcRenderArg, production bool, log *zap.SugaredLogger) ([]*commonservice.HelmSvcRenderArg, error)

func GetGlobalVariableCandidate added in v1.9.9

func GetGlobalVariableCandidate(productName, envName string, log *zap.SugaredLogger) ([]*commontypes.ServiceVariableKV, error)

func GetGlobalVariables added in v1.9.9

func GetGlobalVariables(productName, envName string, log *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, int64, error)

func GetHelmChartVersions added in v1.2.0

func GetHelmChartVersions(productName, envName string, log *zap.SugaredLogger) ([]*commonmodels.HelmVersions, error)

func GetInitProduct

func GetInitProduct(productTmplName string, envType types.EnvType, isBaseEnv bool, baseEnvName string, production bool, log *zap.SugaredLogger) (*commonmodels.Product, error)

func GetK8sResourceYaml added in v1.9.9

func GetK8sResourceYaml(args *FetchResourceArgs, log *zap.SugaredLogger) (string, error)

func GetMergedYamlContent added in v1.6.0

func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)

func GetProductAndFilterNs added in v1.9.9

func GetProductAndFilterNs(namespace, workloadName, svcName string) (*models.Product, bool)

func GetProductDeployType added in v1.9.9

func GetProductDeployType(projectName string) (string, error)

func GetProductInfo

func GetProductInfo(username, envName, productName string, log *zap.SugaredLogger) (*commonmodels.Product, error)

func GetServiceContainer

func GetServiceContainer(envName, productName, serviceName, container string, log *zap.SugaredLogger) error

func GetServiceWorkloads added in v1.9.9

func InstallService added in v1.9.9

func InstallService(helmClient *helmtool.HelmClient, param *kube.ReleaseInstallParam) error

func ListAvailableNamespaces

func ListAvailableNamespaces(clusterID, listType string, log *zap.SugaredLogger) ([]*resource.Namespace, error)

ListAvailableNamespaces lists available namespaces created by non-koderover

func ListDeploymentNames added in v1.9.9

func ListDeploymentNames(clusterID, namespace string, log *zap.SugaredLogger) ([]string, error)

func ListGroups

func ListGroups(serviceName, envName, productName string, perPage, page int, production bool, log *zap.SugaredLogger) ([]*commonservice.ServiceResp, int, error)

func ListKubeEvents

func ListKubeEvents(env string, productName string, name string, rtype string, log *zap.SugaredLogger) ([]*resource.Event, error)

func ListNamespace added in v1.9.9

func ListNamespace(clusterID string, log *zap.SugaredLogger) ([]string, error)

func ListNamespaceFromCluster added in v1.9.9

func ListNamespaceFromCluster(clusterID string) ([]*corev1.Namespace, error)

func ListPodEvents

func ListPodEvents(envName, productName, podName string, log *zap.SugaredLogger) ([]*resource.Event, error)

func ListProductionGroups added in v1.9.9

func ListProductionGroups(serviceName, envName, productName string, perPage, page int, log *zap.SugaredLogger) ([]*commonservice.ServiceResp, int, error)

func ListServicePods

func ListServicePods(productName, envName string, serviceName string, log *zap.SugaredLogger) ([]*resource.Pod, error)

func MigrateHistoryConfigMaps added in v1.9.9

func MigrateHistoryConfigMaps(envName, productName string, log *zap.SugaredLogger) ([]*models.EnvResource, error)

func NewClusterInformerFactory added in v1.9.9

func NewClusterInformerFactory(clusterID string, cls *kubernetes.Clientset) (informers.SharedInformerFactory, error)

func OpenAPICreateCommonEnvCfg added in v1.9.9

func OpenAPICreateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, logger *zap.SugaredLogger) error

func OpenAPICreateK8sEnv added in v1.9.9

func OpenAPICreateK8sEnv(args *OpenAPICreateEnvArgs, userName, requestID string, logger *zap.SugaredLogger) error

func OpenAPICreateProductionEnv added in v1.9.9

func OpenAPICreateProductionEnv(args *OpenAPICreateEnvArgs, userName, requestID string, logger *zap.SugaredLogger) error

func OpenAPIDeleteCommonEnvCfg added in v1.9.9

func OpenAPIDeleteCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error

func OpenAPIDeleteProductionEnvCommonEnvCfg added in v1.9.9

func OpenAPIDeleteProductionEnvCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error

func OpenAPIGetGlobalVariables added in v1.9.9

func OpenAPIGetGlobalVariables(projectName, envName string, production bool, logger *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, error)

func OpenAPIRestartService added in v1.9.9

func OpenAPIRestartService(projectName, envName, serviceName string, logger *zap.SugaredLogger) error

func OpenAPIScale added in v1.9.9

func OpenAPIScale(req *OpenAPIScaleServiceReq, logger *zap.SugaredLogger) error

func OpenAPIUpdateCommonEnvCfg added in v1.9.9

func OpenAPIUpdateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, logger *zap.SugaredLogger) error

func OpenAPIUpdateEnvBasicInfo added in v1.9.9

func OpenAPIUpdateEnvBasicInfo(args *EnvBasicInfoArgs, userName, projectName, envName string, production bool, logger *zap.SugaredLogger) error

func OpenAPIUpdateGlobalVariables added in v1.9.9

func OpenAPIUpdateGlobalVariables(args *OpenAPIEnvGlobalVariables, userName, requestID, projectName, envName string, logger *zap.SugaredLogger) error

func OpenAPIUpdateYamlService added in v1.9.9

func OpenAPIUpdateYamlService(req *OpenAPIServiceVariablesReq, userName, requestID, projectName, envName string, production bool, logger *zap.SugaredLogger) error

func PatchDebugContainer added in v1.9.9

func PatchDebugContainer(ctx context.Context, projectName, envName, podName, debugImage string) error

func PatchWorkload added in v1.9.9

func PatchWorkload(ctx context.Context, projectName, envName, serviceName, devImage string) (*types.WorkloadInfo, error)

func ReInstallHelmProductionSvcInAllEnvs added in v1.9.9

func ReInstallHelmProductionSvcInAllEnvs(productName string, templateSvc *commonmodels.Service) error

func ReInstallHelmSvcInAllEnvs added in v1.9.9

func ReInstallHelmSvcInAllEnvs(productName string, templateSvc *commonmodels.Service) error

ReInstallHelmSvcInAllEnvs reinstall svc in all envs in which the svc is already installed

func RecoverWorkload added in v1.9.9

func RecoverWorkload(ctx context.Context, projectName, envName, serviceName string) error

func ResetProductsStatus

func ResetProductsStatus()

func RestartScale

func RestartScale(args *RestartScaleArgs, _ *zap.SugaredLogger) error

func RestartService

func RestartService(envName string, args *SvcOptArgs, log *zap.SugaredLogger) (err error)

RestartService 在kube中, 如果资源存在就更新不存在就创建

func RollBackConfigMap

func RollBackConfigMap(envName string, args *RollBackConfigMapArgs, userName, userID string, log *zap.SugaredLogger) error

func Scale

func Scale(args *ScaleArgs, logger *zap.SugaredLogger) error

func StartClusterInformer added in v1.9.9

func StartClusterInformer()

func SyncEnvResource added in v1.9.9

func SyncEnvResource(args *SyncEnvResourceArg, log *zap.SugaredLogger) error

func SyncHelmProductEnvironment added in v1.9.9

func SyncHelmProductEnvironment(productName, envName, requestID string, log *zap.SugaredLogger) error

func SyncYamlFromSource added in v1.9.9

func SyncYamlFromSource(yamlData *templatemodels.CustomYaml, curValue string) (bool, string, error)

SyncYamlFromSource sync values.yaml from source NOTE for git source currently only support gitHub and gitlab

func UpdateCVMProduct added in v1.9.9

func UpdateCVMProduct(envName, productName, user, requestID string, log *zap.SugaredLogger) error

func UpdateCommonEnvCfg added in v1.9.9

func UpdateCommonEnvCfg(args *models.CreateUpdateCommonEnvCfgArgs, userName string, updateContentOnly bool, log *zap.SugaredLogger) error

func UpdateConfigMap

func UpdateConfigMap(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error

func UpdateContainerImage

func UpdateContainerImage(requestID string, args *UpdateContainerImageArgs, log *zap.SugaredLogger) error

func UpdateEnvConfigs added in v1.9.9

func UpdateEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, production *bool, logger *zap.SugaredLogger) error

func UpdateHelmProductCharts added in v1.9.9

func UpdateHelmProductCharts(productName, envName, userName, requestID string, args *EnvRendersetArg, log *zap.SugaredLogger) error

func UpdateHelmProductRenderset added in v1.6.0

func UpdateHelmProductRenderset(productName, envName, userName, requestID string, args *EnvRendersetArg, log *zap.SugaredLogger) error

func UpdateOrCreateIngress added in v1.9.9

func UpdateOrCreateIngress(args *models.CreateUpdateCommonEnvCfgArgs, userName string, isCreate bool, log *zap.SugaredLogger) error

func UpdateProductAlias added in v1.9.9

func UpdateProductAlias(envName, productName, alias string) error

func UpdateProductDefaultValues added in v1.9.9

func UpdateProductDefaultValues(productName, envName, userName, requestID string, args *EnvRendersetArg, log *zap.SugaredLogger) error

func UpdateProductDefaultValuesWithRender added in v1.9.9

func UpdateProductDefaultValuesWithRender(productRenderset *models.RenderSet, userName, requestID string, args *EnvRendersetArg, log *zap.SugaredLogger) error

func UpdateProductGlobalVariables added in v1.9.9

func UpdateProductGlobalVariables(productName, envName, userName, requestID string, currentRevision int64, arg []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) error

func UpdateProductGlobalVariablesWithRender added in v1.9.9

func UpdateProductGlobalVariablesWithRender(product *commonmodels.Product, productRenderset *models.RenderSet, userName, requestID string, args []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) error

func UpdateProductRecycleDay added in v1.2.0

func UpdateProductRecycleDay(envName, productName string, recycleDay int) error

func UpdateProductRegistry added in v1.8.0

func UpdateProductRegistry(envName, productName, registryID string, log *zap.SugaredLogger) (err error)

func UpdateProductVariable added in v1.9.9

func UpdateProductVariable(productName, envName, username, requestID string, updatedSvcs []*templatemodels.ServiceRender, renderset *commonmodels.RenderSet, deployType string, log *zap.SugaredLogger) error

func UpdateProductionEnvConfigs added in v1.9.9

func UpdateProductionEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, logger *zap.SugaredLogger) error

func UpdatePvc added in v1.9.9

func UpdatePvc(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error

func UpdateSecret added in v1.9.9

func UpdateSecret(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error

func UpdateService

func UpdateService(args *SvcOptArgs, log *zap.SugaredLogger) error

func UpsertEnvAnalysisCron added in v1.9.9

func UpsertEnvAnalysisCron(projectName, envName string, production *bool, req *EnvAnalysisCronArg, logger *zap.SugaredLogger) error

func VersionLessThan121 added in v1.9.9

func VersionLessThan121(ver *k8sversion.Info) bool

func VisitDeployment added in v1.9.9

func VisitDeployment(deployment *appsv1.Deployment) (sets.String, sets.String, sets.String)

func VisitStatefulSet added in v1.9.9

func VisitStatefulSet(sts *appsv1.StatefulSet) (sets.String, sets.String, sets.String)

Types

type AutoCreator added in v1.5.0

type AutoCreator struct {
	Param *CreateProductParam
}

func (*AutoCreator) Create added in v1.5.0

func (autoCreator *AutoCreator) Create(envName string) (string, error)

type CfgRepoInfo added in v1.9.9

type CfgRepoInfo struct {
	GitRepoConfig *GitRepoConfig `bson:"git_repo_config,omitempty"      json:"git_repo_config,omitempty"`
	LoadPath      string         `bson:"load_path,omitempty"            json:"load_path,omitempty"`
}

type ChartImagesResp added in v1.9.9

type ChartImagesResp struct {
	ServiceImages []*ServiceImages `json:"serviceImages"`
}

func GetImageInfos added in v1.9.9

func GetImageInfos(productName, envName, serviceNames string, log *zap.SugaredLogger) (*ChartImagesResp, error)

type ChartInfo added in v1.8.0

type ChartInfo struct {
	ServiceName string `json:"serviceName"`
	Revision    int64  `json:"revision"`
}

type ConfigTmplData

type ConfigTmplData struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ContainerNotFound

type ContainerNotFound struct {
	ServiceName string
	Container   string
	EnvName     string
	ProductName string
}

func (*ContainerNotFound) Error

func (c *ContainerNotFound) Error() string

type CopyHelmProductArg added in v1.9.9

type CopyHelmProductArg struct {
	Items []HelmProductItem
}

type CopyYamlProductArg added in v1.9.9

type CopyYamlProductArg struct {
	Items []YamlProductItem `json:"items"`
}

type CreateEnvRequest added in v1.9.9

type CreateEnvRequest struct {
	Scene       string `form:"scene"`
	Type        string `form:"type"`
	ProjectName string `form:"projectName"`
	Auto        bool   `form:"auto"`
	EnvType     string `form:"envType"`
}

type CreateProductParam added in v1.5.0

type CreateProductParam struct {
	UserName    string
	RequestId   string
	ProductName string
	EnvType     string

	RegistryID string
	// contains filtered or unexported fields
}

type CreateSingleProductArg added in v1.9.9

type CreateSingleProductArg struct {
	ProductName string `json:"product_name"`
	EnvName     string `json:"env_name"`
	Namespace   string `json:"namespace"`
	ClusterID   string `json:"cluster_id"`
	RegistryID  string `json:"registry_id"`
	Production  bool   `json:"production"`
	Alias       string `json:"alias"`
	BaseEnvName string `json:"base_env_name"`
	BaseName    string `json:"base_name,omitempty"` // for collaboration mode

	DefaultValues string `json:"default_values"`
	// TODO fix me
	HelmDefaultValues string `json:"defaultValues"`
	// for helm products
	ValuesData  *commonservice.ValuesDataArgs     `json:"valuesData"`
	ChartValues []*ProductHelmServiceCreationInfo `json:"chartValues"`

	// for k8s products
	GlobalVariables []*commontypes.GlobalVariableKV    `json:"global_variables"`
	Services        [][]*ProductK8sServiceCreationInfo `json:"services"`

	IsExisted bool `json:"is_existed"`

	// New Since v1.12.0
	ShareEnv commonmodels.ProductShareEnv `json:"share_env"`
	// New Since v1.13.0
	EnvConfigs []*commonmodels.CreateUpdateCommonEnvCfgArgs `json:"env_configs"`
}

type DefaultValuesResp added in v1.6.0

type DefaultValuesResp struct {
	DefaultVariable string                     `json:"default_variable"`
	YamlData        *templatemodels.CustomYaml `json:"yaml_data,omitempty"`
}

func GetDefaultValues added in v1.6.0

func GetDefaultValues(productName, envName string, log *zap.SugaredLogger) (*DefaultValuesResp, error)

type DeployStatus added in v1.9.9

type DeployStatus string
const (
	StatusDeployed   DeployStatus = "deployed"
	StatusUnDeployed DeployStatus = "undeployed"
)

type EnvAnalysisCronArg added in v1.9.9

type EnvAnalysisCronArg struct {
	Enable bool   `json:"enable"`
	Cron   string `json:"cron"`
}

func GetEnvAnalysisCron added in v1.9.9

func GetEnvAnalysisCron(projectName, envName string, production *bool, logger *zap.SugaredLogger) (*EnvAnalysisCronArg, error)

type EnvAnalysisRespone added in v1.9.9

type EnvAnalysisRespone struct {
	Result string `json:"result"`
}

func EnvAnalysis added in v1.9.9

func EnvAnalysis(projectName, envName string, production *bool, triggerName string, userName string, logger *zap.SugaredLogger) (*EnvAnalysisRespone, error)

type EnvBasicInfoArgs added in v1.9.9

type EnvBasicInfoArgs struct {
	RegistryID string `json:"registry_id"`
	Alias      string `json:"env_name"`
}

type EnvCfgArgs added in v1.9.9

type EnvCfgArgs struct {
	Name             string                  `json:"name"`
	AutoSync         bool                    `json:"auto_sync"`
	CommonEnvCfgType string                  `json:"common_env_cfg_type"`
	YamlData         string                  `json:"yaml_data"`
	GitRepoConfig    *template.GitRepoConfig `json:"git_repo_config"`
}

type EnvConfigsArgs added in v1.9.9

type EnvConfigsArgs struct {
	AnalysisConfig      *models.AnalysisConfig       `json:"analysis_config"`
	NotificationConfigs []*models.NotificationConfig `json:"notification_configs"`
}

func GetEnvConfigs added in v1.9.9

func GetEnvConfigs(projectName, envName string, production *bool, logger *zap.SugaredLogger) (*EnvConfigsArgs, error)

func GetProductionEnvConfigs added in v1.9.9

func GetProductionEnvConfigs(projectName, envName string, logger *zap.SugaredLogger) (*EnvConfigsArgs, error)

type EnvGroupRequest added in v1.9.9

type EnvGroupRequest struct {
	ProjectName string `form:"projectName"`
	Page        int    `form:"page"`
	PerPage     int    `form:"perPage"`
	ServiceName string `form:"serviceName"`
}

type EnvRenderChartArg added in v1.5.0

type EnvRenderChartArg struct {
	ChartValues []*commonservice.HelmSvcRenderArg `json:"chartValues"`
}

type EnvRendersetArg added in v1.6.0

type EnvRendersetArg struct {
	DeployType        string                            `json:"deployType"`
	DefaultValues     string                            `json:"defaultValues"`
	ValuesData        *commonservice.ValuesDataArgs     `json:"valuesData"`
	ChartValues       []*commonservice.HelmSvcRenderArg `json:"chartValues"`
	UpdateServiceTmpl bool                              `json:"updateServiceTmpl"`
}

type EnvResp added in v1.7.1

type EnvResp struct {
	ProjectName string   `json:"projectName"`
	Status      string   `json:"status"`
	Error       string   `json:"error"`
	Name        string   `json:"name"`
	UpdateBy    string   `json:"updateBy"`
	UpdateTime  int64    `json:"updateTime"`
	IsPublic    bool     `json:"isPublic"`
	ClusterName string   `json:"clusterName"`
	ClusterID   string   `json:"cluster_id"`
	Namespace   string   `json:"namespace"`
	Alias       string   `json:"alias"`
	Production  bool     `json:"production"`
	Source      string   `json:"source"`
	RegistryID  string   `json:"registry_id"`
	BaseRefs    []string `json:"base_refs"`
	BaseName    string   `json:"base_name"`
	IsExisted   bool     `json:"is_existed"`
	IsFavorite  bool     `json:"is_favorite"`

	// New Since v1.11.0
	ShareEnvEnable  bool   `json:"share_env_enable"`
	ShareEnvIsBase  bool   `json:"share_env_is_base"`
	ShareEnvBaseEnv string `json:"share_env_base_env"`
}

func ListProductionEnvs added in v1.9.9

func ListProductionEnvs(userId string, projectName string, envNames []string, log *zap.SugaredLogger) ([]*EnvResp, error)

func ListProducts

func ListProducts(userID, projectName string, envNames []string, production bool, log *zap.SugaredLogger) ([]*EnvResp, error)

type EnvStatus

type EnvStatus struct {
	EnvName    string `json:"env_name,omitempty"`
	Status     string `json:"status"`
	ErrMessage string `json:"err_message"`
}

func AutoCreateProduct

func AutoCreateProduct(productName, envType, requestID string, log *zap.SugaredLogger) []*EnvStatus

func OpenAPIApplyYamlService added in v1.9.9

func OpenAPIApplyYamlService(projectKey string, req *OpenAPIApplyYamlServiceReq, production bool, requestID string, logger *zap.SugaredLogger) ([]*EnvStatus, error)

func UpdateMultiCVMProducts added in v1.9.9

func UpdateMultiCVMProducts(envNames []string, productName, user, requestID string, log *zap.SugaredLogger) ([]*EnvStatus, error)

func UpdateMultipleHelmChartEnv added in v1.9.9

func UpdateMultipleHelmChartEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, log *zap.SugaredLogger) ([]*EnvStatus, error)

func UpdateMultipleHelmEnv added in v1.5.0

func UpdateMultipleHelmEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, log *zap.SugaredLogger) ([]*EnvStatus, error)

func UpdateMultipleK8sEnv added in v1.9.9

func UpdateMultipleK8sEnv(args []*UpdateEnv, envNames []string, productName, requestID string, force, production bool, log *zap.SugaredLogger) ([]*EnvStatus, error)

type EnvoyAddress added in v1.9.9

type EnvoyAddress struct {
	SocketAddress EnvoySocketAddress `json:"socket_address"`
}

type EnvoyClusterConfigLoadAssignment added in v1.9.9

type EnvoyClusterConfigLoadAssignment struct {
	ClusterName string             `json:"cluster_name"`
	Endpoints   []EnvoyLBEndpoints `json:"endpoints"`
}

type EnvoyEndpoint added in v1.9.9

type EnvoyEndpoint struct {
	Address EnvoyAddress `json:"address"`
}

type EnvoyEndpoints added in v1.9.9

type EnvoyEndpoints struct {
	Endpoint EnvoyEndpoint `json:"endpoint"`
}

type EnvoyLBEndpoints added in v1.9.9

type EnvoyLBEndpoints struct {
	LBEndpoints []EnvoyEndpoints `json:"lb_endpoints"`
}

type EnvoySocketAddress added in v1.9.9

type EnvoySocketAddress struct {
	Protocol  string `json:"protocol"`
	Address   string `json:"address"`
	PortValue int    `json:"port_value"`
}

type EstimateValuesArg added in v1.6.0

type EstimateValuesArg struct {
	ChartRepo      string                  `json:"chartRepo,omitempty"`
	ChartName      string                  `json:"chartName,omitempty"`
	ChartVersion   string                  `json:"chartVersion,omitempty"`
	DefaultValues  string                  `json:"defaultValues"`
	OverrideYaml   string                  `json:"overrideYaml"`
	OverrideValues []*commonservice.KVPair `json:"overrideValues,omitempty"`
	Production     bool                    `json:"-"`
}

type ExternalProductCreator added in v1.5.0

type ExternalProductCreator struct {
}

func (*ExternalProductCreator) Create added in v1.5.0

func (creator *ExternalProductCreator) Create(user, requestID string, args *models.Product, log *zap.SugaredLogger) error

type FetchResourceArgs added in v1.9.9

type FetchResourceArgs struct {
	EnvName       string `form:"envName"`
	Page          int    `form:"page"`
	PageSize      int    `form:"pageSize"`
	ProjectName   string `form:"projectName"`
	ResourceTypes string `form:"-"`
	Type          string `form:"type"`
	Name          string `form:"name"`
}

type GetReleaseInstanceDeployStatusResponse added in v1.9.9

type GetReleaseInstanceDeployStatusResponse struct {
	ReleaseName  string `json:"release_name"`
	ChartName    string `json:"chart_name"`
	ChartVersion string `json:"chart_version"`
	Status       string `json:"status"`
	Values       string `json:"values"`
}

func GetReleaseInstanceDeployStatus added in v1.9.9

func GetReleaseInstanceDeployStatus(productName string, request *HelmDeployStatusCheckRequest) ([]*GetReleaseInstanceDeployStatusResponse, error)

type GitRepoConfig added in v1.9.9

type GitRepoConfig struct {
	CodehostKey string   `json:"codehost_key"`
	Owner       string   `json:"owner"`
	Repo        string   `json:"repo"`
	Branch      string   `json:"branch"`
	ValuesPaths []string `json:"values_paths,omitempty"`
}

type GlobalVariables added in v1.9.9

type GlobalVariables struct {
	Variables           []*commontypes.ServiceVariableKV `json:"variables"`
	ProductionVariables []*commontypes.ServiceVariableKV `json:"production_variables"`
}

type HelmChartsResp added in v1.8.0

type HelmChartsResp struct {
	ChartInfos []*ChartInfo      `json:"chartInfos"`
	FileInfos  []*types.FileInfo `json:"fileInfos"`
}

func GetChartInfos added in v1.8.0

func GetChartInfos(productName, envName, serviceName string, log *zap.SugaredLogger) (*HelmChartsResp, error)

type HelmDeployStatusCheckRequest added in v1.9.9

type HelmDeployStatusCheckRequest struct {
	EnvName   string   `json:"env_name"`
	Services  []string `json:"services"`
	ClusterID string   `json:"cluster_id"`
	Namespace string   `json:"namespace"`
}

type HelmProductCreator added in v1.5.0

type HelmProductCreator struct{}

func (*HelmProductCreator) Create added in v1.5.0

func (creator *HelmProductCreator) Create(user, requestID string, args *models.Product, log *zap.SugaredLogger) error

type HelmProductItem added in v1.9.9

type HelmProductItem struct {
	OldName       string                            `json:"old_name"`
	NewName       string                            `json:"new_name"`
	BaseName      string                            `json:"base_name"`
	DefaultValues string                            `json:"default_values"`
	ChartValues   []*commonservice.HelmSvcRenderArg `json:"chart_values"`
	ValuesData    *commonservice.ValuesDataArgs     `json:"values_data"`
}

type HelmReleaseQueryArgs added in v1.9.9

type HelmReleaseQueryArgs struct {
	ProjectName string `json:"projectName"     form:"projectName"`
	Filter      string `json:"filter"          form:"filter"`
}

type HelmReleaseResp added in v1.8.0

type HelmReleaseResp struct {
	ReleaseName       string        `json:"releaseName"`
	ServiceName       string        `json:"serviceName"`
	Revision          int           `json:"revision"`
	ChartRepo         string        `json:"chartRepo"`
	Chart             string        `json:"chart"`
	AppVersion        string        `json:"appVersion"`
	OverrideValues    string        `json:"overrideValues"`
	OverrideYaml      string        `json:"overrideYaml"`
	Status            ReleaseStatus `json:"status"`
	Updatable         bool          `json:"updatable"`
	IsHelmChartDeploy bool          `json:"isHelmChartDeploy"`
	DeployStrategy    string        `json:"deployStrategy"`
	Error             string        `json:"error"`
}

func ListReleases added in v1.8.0

func ListReleases(args *HelmReleaseQueryArgs, envName string, production bool, log *zap.SugaredLogger) ([]*HelmReleaseResp, error)

type IProductCreator added in v1.5.0

type IProductCreator interface {
	Create(string, string, *models.Product, *zap.SugaredLogger) error
}

type ImageData added in v1.9.9

type ImageData struct {
	ImageName string `json:"imageName"`
	ImageTag  string `json:"imageTag"`
	Selected  bool   `json:"selected"`
}

type K8sDeployStatusCheckRequest added in v1.9.9

type K8sDeployStatusCheckRequest struct {
	EnvName   string                           `json:"env_name"`
	Services  []*commonservice.K8sSvcRenderArg `json:"services"`
	ClusterID string                           `json:"cluster_id"`
	Namespace string                           `json:"namespace"`
}

type K8sRendersetArg added in v1.9.9

type K8sRendersetArg struct {
	VariableYaml string `json:"variable_yaml"`
}

type K8sResource added in v1.9.9

type K8sResource struct {
	ResourceName    string `json:"resource_name"`
	ResourceKind    string `json:"resource_kind"`
	ResourceGroup   string `json:"resource_group"`
	ResourceVersion string `json:"resource_version"`
}

func ListAllK8sResourcesInNamespace added in v1.9.9

func ListAllK8sResourcesInNamespace(clusterID, namespace string, log *zap.SugaredLogger) ([]*K8sResource, error)

type K8sResourceResp added in v1.9.9

type K8sResourceResp struct {
	Count     int                      `json:"count"`
	Workloads []interface{}            `json:"workloads,omitempty"`
	Resources []SortableByCreationTime `json:"resources,omitempty"`
}

func ListConfigMapOverview added in v1.9.9

func ListConfigMapOverview(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)

func ListCronJobs added in v1.9.9

func ListCronJobs(page, pageSize int, clusterID, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)

func ListDaemonSets added in v1.9.9

func ListDaemonSets(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)

func ListDeployments added in v1.9.9

func ListDeployments(page, pageSize int, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)

func ListIngressOverview added in v1.9.9

func ListIngressOverview(page, pageSize int, clusterID, namespace string, kc client.Client, log *zap.SugaredLogger) (*K8sResourceResp, error)

func ListJobs added in v1.9.9

func ListJobs(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)

func ListK8sResOverview added in v1.9.9

func ListK8sResOverview(args *FetchResourceArgs, log *zap.SugaredLogger) (*K8sResourceResp, error)

func ListK8sSecretOverview added in v1.9.9

func ListK8sSecretOverview(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)

func ListPVCs added in v1.9.9

func ListPVCs(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)

func ListServices added in v1.9.9

func ListServices(page, pageSize int, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)

func ListStatefulSets added in v1.9.9

func ListStatefulSets(page, pageSize int, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)

type K8sService

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

type K8sYamlProductCreator added in v1.9.9

type K8sYamlProductCreator struct {
}

func (*K8sYamlProductCreator) Create added in v1.9.9

func (creator *K8sYamlProductCreator) Create(user, requestID string, args *models.Product, log *zap.SugaredLogger) error

type ListCommonEnvCfgHistoryArgs added in v1.9.9

type ListCommonEnvCfgHistoryArgs struct {
	EnvName          string                  `json:"env_name"            form:"envName"`
	ProjectName      string                  `json:"project_name"        form:"projectName"`
	Name             string                  `json:"name"                form:"name"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type" form:"commonEnvCfgType"`
	AutoSync         bool                    `json:"auto_sync"           form:"autoSync"`
}

type ListCommonEnvCfgHistoryRes added in v1.9.9

type ListCommonEnvCfgHistoryRes struct {
	ID             primitive.ObjectID     `json:"id,omitempty"`
	ProductName    string                 `json:"product_name"`
	CreateTime     int64                  `json:"create_time"`
	UpdateUserName string                 `json:"update_user_name"`
	Namespace      string                 `json:"namespace,omitempty"`
	EnvName        string                 `json:"env_name"`
	Name           string                 `json:"name"`
	Type           string                 `json:"type"`
	YamlData       string                 `json:"yaml_data"`
	SourceDetail   *models.CreateFromRepo `json:"source_detail"`
}

func ListEnvResourceHistory added in v1.9.9

func ListEnvResourceHistory(args *ListCommonEnvCfgHistoryArgs, log *zap.SugaredLogger) ([]*ListCommonEnvCfgHistoryRes, error)

func ListLatestEnvResources added in v1.9.9

func ListLatestEnvResources(args *ListCommonEnvCfgHistoryArgs, log *zap.SugaredLogger) ([]*ListCommonEnvCfgHistoryRes, error)

type ListConfigMapArgs

type ListConfigMapArgs struct {
	EnvName     string `json:"env_name"`
	ProductName string `json:"product_name"`
	ServiceName string `json:"service_name"`
}

type ListConfigMapRes added in v1.9.9

type ListConfigMapRes struct {
	*ResourceResponseBase
	CmName    string            `json:"cm_name"`
	Immutable bool              `json:"immutable"`
	CmData    map[string]string `json:"cm_data"`
}

func ListConfigMaps

func ListConfigMaps(args *ListConfigMapArgs, log *zap.SugaredLogger) ([]*ListConfigMapRes, error)

type ListIngressesResponse added in v1.9.9

type ListIngressesResponse struct {
	*ResourceResponseBase
	IngressName string `json:"ingress_name"`
	HostInfo    string `json:"host_info"`
	Address     string `json:"address"`
	Ports       string `json:"ports"`
	ErrorReason string `json:"error_reason"`
}

func ListIngresses added in v1.9.9

func ListIngresses(envName, productName string, log *zap.SugaredLogger) ([]*ListIngressesResponse, error)

type ListPvcsResponse added in v1.9.9

type ListPvcsResponse struct {
	*ResourceResponseBase
	PvcName      string `json:"pvc_name"`
	Status       string `json:"status"`
	Volume       string `json:"volume"`
	AccessModes  string `json:"access_modes"`
	StorageClass string `json:"storageclass"`
	Capacity     string `json:"capacity"`
}

func ListPvcs added in v1.9.9

func ListPvcs(envName, productName string, log *zap.SugaredLogger) ([]*ListPvcsResponse, error)

type ListSecretsResponse added in v1.9.9

type ListSecretsResponse struct {
	*ResourceResponseBase
	SecretName string `json:"secret_name"`
	SecretType string `json:"secret_type"`
}

func ListSecrets added in v1.9.9

func ListSecrets(envName, productName string, log *zap.SugaredLogger) ([]*ListSecretsResponse, error)

type MatchedEnv added in v1.9.9

type MatchedEnv struct {
	EnvName   string
	Namespace string
}

type MigrateHistoryConfigMapsRes added in v1.9.9

type MigrateHistoryConfigMapsRes struct {
}

type NodeResp added in v1.8.0

type NodeResp struct {
	Nodes  []*internalresource.Node `json:"data"`
	Labels []string                 `json:"labels"`
}

func ListAvailableNodes added in v1.8.0

func ListAvailableNodes(clusterID string, log *zap.SugaredLogger) (*NodeResp, error)

type OpenAPIApplyYamlServiceReq added in v1.9.9

type OpenAPIApplyYamlServiceReq struct {
	EnvName     string               `json:"env_key"`
	ServiceList []*YamlServiceWithKV `json:"service_list"`
}

func (*OpenAPIApplyYamlServiceReq) Validate added in v1.9.9

func (req *OpenAPIApplyYamlServiceReq) Validate() error

type OpenAPICreateEnvArgs added in v1.9.9

type OpenAPICreateEnvArgs struct {
	Production      bool                              `json:"production"`
	ProjectName     string                            `json:"project_key"`
	EnvName         string                            `json:"env_key"`
	ClusterID       string                            `json:"cluster_id"`
	Namespace       string                            `json:"namespace"`
	RegistryID      string                            `json:"registry_id"`
	Alias           string                            `json:"env_name"`
	GlobalVariables []*commontypes.GlobalVariableKV   `json:"global_variables"`
	ChartValues     []*ProductHelmServiceCreationInfo `json:"chart_values"`
	Services        []*OpenAPICreateServiceArgs       `json:"services"`
	EnvConfigs      []*EnvCfgArgs                     `json:"env_configs"`
}

func (*OpenAPICreateEnvArgs) Validate added in v1.9.9

func (env *OpenAPICreateEnvArgs) Validate() error

type OpenAPICreateServiceArgs added in v1.9.9

type OpenAPICreateServiceArgs struct {
	ServiceName    string                          `json:"service_name"`
	DeployStrategy string                          `json:"deploy_strategy"`
	Containers     []*commonmodels.Container       `json:"containers"`
	VariableKVs    []*commontypes.RenderVariableKV `json:"variable_kvs"`
	Status         string                          `json:"status"`
	Type           string                          `json:"type"`
}

type OpenAPIDeleteYamlServiceFromEnvReq added in v1.9.9

type OpenAPIDeleteYamlServiceFromEnvReq struct {
	EnvName      string   `json:"env_key"`
	ServiceNames []string `json:"service_names"`
}

func (*OpenAPIDeleteYamlServiceFromEnvReq) Validate added in v1.9.9

func (req *OpenAPIDeleteYamlServiceFromEnvReq) Validate() error

type OpenAPIEnvCfgArgs added in v1.9.9

type OpenAPIEnvCfgArgs struct {
	Name                 string                       `json:"name"`
	CommonEnvCfgType     config.CommonEnvCfgType      `json:"common_env_cfg_type"`
	CreatedBy            string                       `json:"created_by,omitempty"`
	CreatedTime          int64                        `json:"created_time,omitempty"`
	UpdateBy             string                       `json:"update_by,omitempty"`
	UpdateTime           int64                        `json:"update_time,omitempty"`
	EnvName              string                       `json:"env_key"`
	ProductName          string                       `json:"product_name"`
	ServiceName          string                       `json:"service_name,omitempty"`
	Services             []string                     `json:"services,omitempty"`
	YamlData             string                       `json:"yaml_data,omitempty"`
	SourceDetail         *commonmodels.CreateFromRepo `json:"source_detail"`
	RestartAssociatedSvc bool                         `json:"restart_associated_svc,omitempty"`
	AutoSync             bool                         `json:"auto_sync"`
}

func (*OpenAPIEnvCfgArgs) Validate added in v1.9.9

func (req *OpenAPIEnvCfgArgs) Validate() error

type OpenAPIEnvCfgBrief added in v1.9.9

type OpenAPIEnvCfgBrief struct {
	Name             string                  `json:"name"`
	EnvName          string                  `json:"env_name"`
	ProjectName      string                  `json:"project_name"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"`
	UpdateBy         string                  `json:"update_by,omitempty"`
	UpdateTime       int64                   `json:"update_time,omitempty"`
}

func OpenAPIListCommonEnvCfg added in v1.9.9

func OpenAPIListCommonEnvCfg(projectName, envName string, cfgType string, logger *zap.SugaredLogger) ([]*OpenAPIEnvCfgBrief, error)

type OpenAPIEnvCfgConfigMapDetail added in v1.9.9

type OpenAPIEnvCfgConfigMapDetail struct {
	Name             string                  `json:"name"`
	ProjectName      string                  `json:"project_key"`
	EnvName          string                  `json:"env_key"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"`
	CreatedBy        string                  `json:"created_by,omitempty"`
	CreatedTime      int64                   `json:"created_time,omitempty"`
	UpdateBy         string                  `json:"update_by,omitempty"`
	UpdateTime       int64                   `json:"update_time,omitempty"`
	YamlData         string                  `json:"yaml_data,omitempty"`
	Services         []string                `json:"services,omitempty"`
	SourceDetail     *CfgRepoInfo            `json:"source_detail"`
	Immutable        bool                    `json:"immutable,omitempty"`
	CmData           map[string]string       `json:"cm_data,omitempty"`
}

type OpenAPIEnvCfgDetail added in v1.9.9

type OpenAPIEnvCfgDetail struct {
	IngressDetail   *OpenAPIEnvCfgIngressDetail   `json:"ingress_detail,omitempty"`
	SecretDetail    *OpenAPIEnvCfgSecretDetail    `json:"secret_detail,omitempty"`
	PvcDetail       *OpenAPIEnvCfgPvcDetail       `json:"pvc_detail,omitempty"`
	ConfigMapDetail *OpenAPIEnvCfgConfigMapDetail `json:"configMap_detail,omitempty"`
}

func OpenAPIGetCommonEnvCfg added in v1.9.9

func OpenAPIGetCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) (*OpenAPIEnvCfgDetail, error)

type OpenAPIEnvCfgIngressDetail added in v1.9.9

type OpenAPIEnvCfgIngressDetail struct {
	Name             string                  `json:"name"`
	ProjectName      string                  `json:"project_key"`
	EnvName          string                  `json:"env_key"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"`
	CreatedBy        string                  `json:"created_by,omitempty"`
	CreatedTime      int64                   `json:"created_time,omitempty"`
	UpdateBy         string                  `json:"update_by,omitempty"`
	UpdateTime       int64                   `json:"update_time,omitempty"`
	YamlData         string                  `json:"yaml_data,omitempty"`
	Services         []string                `json:"services,omitempty"`
	SourceDetail     *CfgRepoInfo            `json:"source_detail"`
	HostInfo         string                  `json:"host_info,omitempty"`
	Address          string                  `json:"address,omitempty"`
	Ports            string                  `json:"ports,omitempty"`
	ErrorReason      string                  `json:"error_reason,omitempty"`
}

type OpenAPIEnvCfgPvcDetail added in v1.9.9

type OpenAPIEnvCfgPvcDetail struct {
	Name             string                  `json:"name"`
	ProjectName      string                  `json:"project_key"`
	EnvName          string                  `json:"env_key"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"`
	CreatedBy        string                  `json:"created_by,omitempty"`
	CreatedTime      int64                   `json:"created_time,omitempty"`
	UpdateBy         string                  `json:"update_by,omitempty"`
	UpdateTime       int64                   `json:"update_time,omitempty"`
	YamlData         string                  `json:"yaml_data,omitempty"`
	Services         []string                `json:"services,omitempty"`
	SourceDetail     *CfgRepoInfo            `json:"source_detail"`
	Status           string                  `json:"status,omitempty"`
	Volume           string                  `json:"volume,omitempty"`
	AccessModes      string                  `json:"access_modes,omitempty"`
	StorageClass     string                  `json:"storage_class,omitempty"`
	Capacity         string                  `json:"capacity,omitempty"`
}

type OpenAPIEnvCfgSecretDetail added in v1.9.9

type OpenAPIEnvCfgSecretDetail struct {
	Name             string                  `json:"name"`
	ProjectName      string                  `json:"project_key"`
	EnvName          string                  `json:"env_key"`
	CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"`
	CreatedBy        string                  `json:"created_by,omitempty"`
	CreatedTime      int64                   `json:"created_time,omitempty"`
	UpdateBy         string                  `json:"update_by,omitempty"`
	UpdateTime       int64                   `json:"update_time,omitempty"`
	YamlData         string                  `json:"yaml_data,omitempty"`
	Services         []string                `json:"services,omitempty"`
	SourceDetail     *CfgRepoInfo            `json:"source_detail"`
	SecretType       string                  `json:"secret_type,omitempty"`
}

type OpenAPIEnvDetail added in v1.9.9

type OpenAPIEnvDetail struct {
	ProjectName     string                            `json:"project_key"`
	EnvName         string                            `json:"env_key"`
	UpdateBy        string                            `json:"update_by"`
	UpdateTime      int64                             `json:"update_time"`
	ClusterID       string                            `json:"cluster_id"`
	Namespace       string                            `json:"namespace"`
	RegistryID      string                            `json:"registry_id"`
	Alias           string                            `json:"env_name,omitempty"`
	GlobalVariables []*commontypes.GlobalVariableKV   `json:"global_variables"`
	ChartValues     []*ProductHelmServiceCreationInfo `json:"chart_values,omitempty"`
	Services        []*OpenAPIServiceDetail           `json:"services"`
	Status          string                            `json:"status"`
}

func GetEnvDetail added in v1.9.9

func GetEnvDetail(projectName, envName string, logger *zap.SugaredLogger) (*OpenAPIEnvDetail, error)

type OpenAPIEnvGlobalVariables added in v1.9.9

type OpenAPIEnvGlobalVariables struct {
	GlobalVariables []*commontypes.GlobalVariableKV `json:"global_variables"`
}

type OpenAPIEnvServiceDetail added in v1.9.9

type OpenAPIEnvServiceDetail struct {
	ServiceName    string                           `json:"service_name"`
	Variables      []*commontypes.ServiceVariableKV `json:"variables"`
	Images         []string                         `json:"images"`
	Status         string                           `json:"status"`
	Type           string                           `json:"type"`
	Error          string                           `json:"error"`
	DeployStrategy string                           `json:"deploy_strategy"`
}

type OpenAPIListEnvBrief added in v1.9.9

type OpenAPIListEnvBrief struct {
	Alias      string `json:"envName,omitempty"`
	EnvName    string `json:"env_key"`
	ClusterID  string `json:"cluster_id"`
	Namespace  string `json:"namespace"`
	Production bool   `json:"production"`
	RegistryID string `json:"registry_id"`
	Status     string `json:"status"`
	UpdateBy   string `json:"update_by"`
	UpdateTime int64  `json:"update_time"`
}

func OpenAPIListEnvs added in v1.9.9

func OpenAPIListEnvs(projectName string, logger *zap.SugaredLogger) ([]*OpenAPIListEnvBrief, error)

func OpenAPIListProductionEnvs added in v1.9.9

func OpenAPIListProductionEnvs(projectName string, logger *zap.SugaredLogger) ([]*OpenAPIListEnvBrief, error)

type OpenAPIScaleServiceReq added in v1.9.9

type OpenAPIScaleServiceReq struct {
	ProjectKey     string `json:"project_key"`
	EnvName        string `json:"env_key"`
	WorkloadName   string `json:"workload_name"`
	WorkloadType   string `json:"workload_type"`
	TargetReplicas int    `json:"target_replicas"`
}

func (*OpenAPIScaleServiceReq) Validate added in v1.9.9

func (req *OpenAPIScaleServiceReq) Validate() error

type OpenAPIServiceDetail added in v1.9.9

type OpenAPIServiceDetail struct {
	ServiceName string                           `json:"service_name"`
	Containers  []*commonmodels.Container        `json:"containers"`
	VariableKVs []*commontypes.ServiceVariableKV `json:"variable_kvs"`
	Status      string                           `json:"status"`
	Type        string                           `json:"type"`
}

type OpenAPIServiceVariablesReq added in v1.9.9

type OpenAPIServiceVariablesReq struct {
	ServiceList []*ServiceVariable `json:"service_list"`
}

type PMProductCreator added in v1.5.0

type PMProductCreator struct {
}

func (*PMProductCreator) Create added in v1.5.0

func (creator *PMProductCreator) Create(user, requestID string, args *models.Product, log *zap.SugaredLogger) error

type PMService added in v1.2.0

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

type PreviewServiceArgs added in v1.9.9

type PreviewServiceArgs struct {
	ProductName           string                          `json:"product_name"`
	EnvName               string                          `json:"env_name"`
	ServiceName           string                          `json:"service_name"`
	UpdateServiceRevision bool                            `json:"update_service_revision"`
	ServiceModules        []*commonmodels.Container       `json:"service_modules"`
	VariableKVs           []*commontypes.RenderVariableKV `json:"variable_kvs"`
}

type ProductHelmServiceCreationInfo added in v1.9.9

type ProductHelmServiceCreationInfo struct {
	*commonservice.HelmSvcRenderArg
	DeployStrategy string `json:"deploy_strategy"`
}

type ProductIngressInfo

type ProductIngressInfo struct {
	IngressInfos []*commonservice.IngressInfo `json:"ingress_infos"`
	EnvName      string                       `json:"env_name"`
}

type ProductK8sServiceCreationInfo added in v1.9.9

type ProductK8sServiceCreationInfo struct {
	*commonmodels.ProductService
	DeployStrategy string `json:"deploy_strategy"`
}

type ProductParams

type ProductParams struct {
	IsPublic        bool     `json:"isPublic"`
	EnvName         string   `json:"envName"`
	RoleID          int      `json:"roleId"`
	PermissionUUIDs []string `json:"permissionUUIDs"`
}

type ProductResp

type ProductResp struct {
	ID          string                           `json:"id"`
	ProductName string                           `json:"product_name"`
	Namespace   string                           `json:"namespace"`
	Status      string                           `json:"status"`
	Error       string                           `json:"error"`
	EnvName     string                           `json:"env_name"`
	UpdateBy    string                           `json:"update_by"`
	UpdateTime  int64                            `json:"update_time"`
	Services    [][]*commonmodels.ProductService `json:"services"`
	Render      *commonmodels.RenderInfo         `json:"render"`
	Vars        []*templatemodels.RenderKV       `json:"vars"`
	IsPublic    bool                             `json:"isPublic"`
	ClusterID   string                           `json:"cluster_id,omitempty"`
	ClusterName string                           `json:"cluster_name,omitempty"`
	RecycleDay  int                              `json:"recycle_day"`
	IsProd      bool                             `json:"is_prod"`
	IsLocal     bool                             `json:"is_local"`
	IsExisted   bool                             `json:"is_existed"`
	Source      string                           `json:"source"`
	RegisterID  string                           `json:"registry_id"`

	// New Since v1.11.0
	ShareEnvEnable  bool   `json:"share_env_enable"`
	ShareEnvIsBase  bool   `json:"share_env_is_base"`
	ShareEnvBaseEnv string `json:"share_env_base_env"`
}

func GetProduct

func GetProduct(username, envName, productName string, log *zap.SugaredLogger) (*ProductResp, error)

type ProductRevision

type ProductRevision struct {
	ID          string `json:"id,omitempty"`
	EnvName     string `json:"env_name"`
	ProductName string `json:"product_name"`
	// 表示该产品更新前版本
	CurrentRevision int64 `json:"current_revision"`
	// 表示该产品更新后版本
	NextRevision int64 `json:"next_revision"`
	// true: 表示该产品的服务发生变化, 需要更新
	// false: 表示该产品的服务未发生变化, 无需更新
	Updatable bool `json:"updatable"`
	// 可以自动更新产品, 展示用户更新前和更新后的服务组以及服务详细对比
	ServiceRevisions []*SvcRevision `json:"services"`
	IsPublic         bool           `json:"isPublic"`
}

func GetProductRevision

func GetProductRevision(product *commonmodels.Product, allServiceTmpls []*commonmodels.Service, log *zap.SugaredLogger) (*ProductRevision, error)

FixMe do we need this funciton?

func ListProductSnapsByOption added in v1.9.9

func ListProductSnapsByOption(deployType string, log *zap.SugaredLogger) ([]*ProductRevision, error)

ListProductSnapsByOption called by service cron

func ListProductsRevision

func ListProductsRevision(productName, envName string, production bool, log *zap.SugaredLogger) (prodRevs []*ProductRevision, err error)

func (*ProductRevision) GroupsUpdated

func (pr *ProductRevision) GroupsUpdated() bool

type RawYamlResp added in v1.6.0

type RawYamlResp struct {
	YamlContent string `json:"yamlContent"`
}

type ReleaseFilter added in v1.9.9

type ReleaseFilter struct {
	Name   string        `json:"name"`
	Status ReleaseStatus `json:"status"`
}

type ReleaseStatus added in v1.9.9

type ReleaseStatus string
const (
	HelmReleaseStatusPending     ReleaseStatus = "pending"
	HelmReleaseStatusDeployed    ReleaseStatus = "deployed"
	HelmReleaseStatusFailed      ReleaseStatus = "failed"
	HelmReleaseStatusNotDeployed ReleaseStatus = "notDeployed"
)

type ResourceCommon added in v1.9.9

type ResourceCommon struct {
	Name         string           `json:"name"`
	Type         string           `json:"type"`
	Images       []*WorkloadImage `json:"images,omitempty"`
	CreationTime string           `json:"creation_time"`
}

func (*ResourceCommon) GetCreationTime added in v1.9.9

func (rc *ResourceCommon) GetCreationTime() string

type ResourceConfigMap added in v1.9.9

type ResourceConfigMap struct {
	*ResourceCommon
}

type ResourceDeployStatus added in v1.9.9

type ResourceDeployStatus struct {
	Type         string                  `json:"type"`
	Name         string                  `json:"name"`
	Status       DeployStatus            `json:"status"`
	GVK          schema.GroupVersionKind `json:"-"`
	OverrideYaml string                  `json:"override_yaml"`
	OverrideKvs  []*commonservice.KVPair `json:"override_kvs"`
}

type ResourceIngress added in v1.9.9

type ResourceIngress struct {
	*ResourceCommon
	Class   string `json:"class"`
	Hosts   string `json:"hosts"`
	Address string `json:"address"`
	Ports   string `json:"ports"`
}

type ResourcePVC added in v1.9.9

type ResourcePVC struct {
	*ResourceCommon
	Status       string `json:"status"`
	Volume       string `json:"volume"`
	Capacity     string `json:"capacity"`
	AccessModes  string `json:"access_modes"`
	StorageClass string `json:"storage_class"`
}

type ResourceResponseBase added in v1.9.9

type ResourceResponseBase struct {
	Name           string                  `json:"-"`
	Type           config.CommonEnvCfgType `json:"-"`
	EnvName        string                  `json:"-"`
	ProjectName    string                  `json:"-"`
	YamlData       string                  `json:"yaml_data"`
	UpdateUserName string                  `json:"update_username"`
	CreateTime     time.Time               `json:"create_time"`
	Services       []string                `json:"services"`
	SourceDetail   *models.CreateFromRepo  `json:"source_detail"`
	AutoSync       bool                    `json:"auto_sync"`
}

type ResourceSecret added in v1.9.9

type ResourceSecret struct {
	*ResourceCommon
	SecretType string `json:"secret_type"`
}

type ResourceService added in v1.9.9

type ResourceService struct {
	*ResourceCommon
	ServiceType string `json:"service_type"`
	ClusterIP   string `json:"cluster_ip"`
	Ports       string `json:"ports"`
}

type ResourceWithLabel added in v1.9.9

type ResourceWithLabel interface {
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
	SetNamespace(ns string)
}

func GetResourceByCfgType added in v1.9.9

func GetResourceByCfgType(namespace, name string, cfgType config.CommonEnvCfgType, client client.Client, clientset *kubernetes.Clientset) (ResourceWithLabel, error)

type RestartScaleArgs

type RestartScaleArgs struct {
	Type        string `json:"type"`
	ProductName string `json:"product_name"`
	EnvName     string `json:"env_name"`
	Name        string `json:"name"`
	// deprecated, since it is not used
	ServiceName string `json:"service_name"`
}

type RollBackConfigMapArgs

type RollBackConfigMapArgs struct {
	EnvName          string `json:"env_name"`
	ProductName      string `json:"product_name"`
	ServiceName      string `json:"service_name"`
	SrcConfigName    string `json:"src_config_name"`
	DestinConfigName string `json:"destin_config_name"`
}

type ScaleArgs

type ScaleArgs struct {
	Type        string `json:"type"`
	ProductName string `json:"product_name"`
	EnvName     string `json:"env_name"`
	ServiceName string `json:"service_name"`
	Name        string `json:"name"`
	Number      int    `json:"number"`
}

type ServiceDeployStatus added in v1.9.9

type ServiceDeployStatus struct {
	ServiceName string                  `json:"service_name"`
	Resources   []*ResourceDeployStatus `json:"resources"`
}

func GetReleaseDeployStatus added in v1.9.9

func GetReleaseDeployStatus(productName string, request *HelmDeployStatusCheckRequest) ([]*ServiceDeployStatus, error)

func GetResourceDeployStatus added in v1.9.9

func GetResourceDeployStatus(productName string, request *K8sDeployStatusCheckRequest, log *zap.SugaredLogger) ([]*ServiceDeployStatus, error)

type ServiceImages added in v1.9.9

type ServiceImages struct {
	ServiceName string       `json:"serviceName"`
	Images      []*ImageData `json:"imageData"`
}

type ServiceMatchedDeploymentContainers added in v1.9.9

type ServiceMatchedDeploymentContainers struct {
	ServiceName string `json:"service_name"`
	Deployment  struct {
		DeploymentName string   `json:"deployments_name"`
		ContainerNames []string `json:"container_names"`
	} `json:"deployment"`
}

func ListCanaryDeploymentServiceInfo added in v1.9.9

func ListCanaryDeploymentServiceInfo(clusterID, namespace string, log *zap.SugaredLogger) ([]*ServiceMatchedDeploymentContainers, error)

list serivce and matched deployment containers for canary and blue-green deployment.

type ServiceVariable added in v1.9.9

type ServiceVariable struct {
	ServiceName string                          `json:"service_name"`
	Variables   []*commontypes.RenderVariableKV `json:"variable_kvs"`
}

type ShareEnvOp added in v1.9.9

type ShareEnvOp string
const (
	ShareEnvEnable  ShareEnvOp = "enable"
	ShareEnvDisable ShareEnvOp = "disable"
)

type ShareEnvReady added in v1.9.9

type ShareEnvReady struct {
	IsReady bool                `json:"is_ready"`
	Checks  ShareEnvReadyChecks `json:"checks"`
}

func CheckShareEnvReady added in v1.9.9

func CheckShareEnvReady(ctx context.Context, envName, op, productName string) (*ShareEnvReady, error)

func (*ShareEnvReady) CheckAndSetReady added in v1.9.9

func (s *ShareEnvReady) CheckAndSetReady(state ShareEnvOp)

Note: `WorkloadsHaveK8sService` is an optional condition.

type ShareEnvReadyChecks added in v1.9.9

type ShareEnvReadyChecks struct {
	NamespaceHasIstioLabel  bool `json:"namespace_has_istio_label"`
	VirtualServicesDeployed bool `json:"virtualservice_deployed"`
	PodsHaveIstioProxy      bool `json:"pods_have_istio_proxy"`
	WorkloadsReady          bool `json:"workloads_ready"`
	WorkloadsHaveK8sService bool `json:"workloads_have_k8s_service"`
}

type SortableByCreationTime added in v1.9.9

type SortableByCreationTime interface {
	GetCreationTime() string
}

type SvcDataSet added in v1.9.9

type SvcDataSet struct {
	ProdSvc    *models.ProductService
	TmplSvc    *models.Service
	SvcRelease *release.Release
}

type SvcDiffResult

type SvcDiffResult struct {
	ReleaseName       string   `json:"release_name"`
	ServiceName       string   `json:"service_name"`
	ChartName         string   `json:"chart_name"`
	DeployedFromChart bool     `json:"deployed_from_chart"`
	Current           TmplYaml `json:"current"`
	Latest            TmplYaml `json:"latest"`
	Error             string   `json:"error"`
}

func BatchPreviewService added in v1.9.9

func BatchPreviewService(args []*PreviewServiceArgs, logger *zap.SugaredLogger) ([]*SvcDiffResult, error)

func GetServiceDiff added in v1.3.0

func GetServiceDiff(envName, productName, serviceName string, log *zap.SugaredLogger) (*SvcDiffResult, error)

GetServiceDiff 获得服务模板当前版本和最新版本的对比

func PreviewHelmProductGlobalVariables added in v1.9.9

func PreviewHelmProductGlobalVariables(productName, envName, globalVariable string, log *zap.SugaredLogger) ([]*SvcDiffResult, error)

func PreviewProductGlobalVariables added in v1.9.9

func PreviewProductGlobalVariables(productName, envName string, arg []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) ([]*SvcDiffResult, error)

func PreviewProductGlobalVariablesWithRender added in v1.9.9

func PreviewProductGlobalVariablesWithRender(product *commonmodels.Product, productRenderset *models.RenderSet, args []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) ([]*SvcDiffResult, error)

func PreviewService added in v1.9.9

func PreviewService(args *PreviewServiceArgs, _ *zap.SugaredLogger) (*SvcDiffResult, error)

type SvcOptArgs

type SvcOptArgs struct {
	EnvName           string
	ProductName       string
	ServiceName       string
	ServiceType       string
	ServiceRev        *SvcRevision
	UpdateBy          string
	UpdateServiceTmpl bool
}

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   []*commonservice.Workload    `json:"-"`
}

SvcResp struct 产品-服务详情页面Response

func GetMseServiceImpl added in v1.18.0

func GetMseServiceImpl(serviceName string, workLoadType string, env *commonmodels.Product, kubeClient client.Client, clientset *kubernetes.Clientset, inf informers.SharedInformerFactory, log *zap.SugaredLogger) (ret *SvcResp, err error)

func GetService

func GetService(envName, productName, serviceName string, production bool, workLoadType string, isHelmChartDeploy bool, log *zap.SugaredLogger) (ret *SvcResp, err error)

func GetServiceImpl added in v1.17.0

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 SvcRevision

type SvcRevision struct {
	ServiceName       string                          `json:"service_name"`
	Type              string                          `json:"type"`
	CurrentRevision   int64                           `json:"current_revision"`
	NextRevision      int64                           `json:"next_revision"`
	Updatable         bool                            `json:"updatable"`
	DeployStrategy    string                          `json:"deploy_strategy"`
	Error             string                          `json:"error"`
	Deleted           bool                            `json:"deleted"`
	New               bool                            `json:"new"`
	Containers        []*commonmodels.Container       `json:"containers,omitempty"`
	UpdateServiceTmpl bool                            `json:"update_service_tmpl"`
	VariableYaml      string                          `json:"variable_yaml"`
	VariableKVs       []*commontypes.RenderVariableKV `json:"variable_kvs"`
}

type SyncEnvResourceArg added in v1.9.9

type SyncEnvResourceArg struct {
	EnvName     string `json:"env_name"`
	ProductName string `json:"product_name"`
	Name        string `json:"name"`
	Type        string `json:"type"`
}

type TmplConfig

type TmplConfig struct {
	Data []ConfigTmplData `json:"data,omitempty"`
}

type TmplYaml

type TmplYaml struct {
	Yaml     string `json:"yaml,omitempty"`
	UpdateBy string `json:"update_by,omitempty"`
	Revision int64  `json:"revision,omitempty"`
}

type UpdateConfigMapArgs

type UpdateConfigMapArgs struct {
	EnvName              string   `json:"env_name"`
	ProductName          string   `json:"product_name"`
	ServiceName          string   `json:"service_name"`
	ConfigName           string   `json:"config_name"`
	YamlData             string   `json:"yaml_data"`
	RestartAssociatedSvc bool     `json:"restart_associated_svc"`
	Services             []string `json:"services"`
}

type UpdateContainerImageArgs

type UpdateContainerImageArgs struct {
	Type          string `json:"type"`
	ProductName   string `json:"product_name"`
	EnvName       string `json:"env_name"`
	ServiceName   string `json:"service_name"`
	Name          string `json:"name"`
	ContainerName string `json:"container_name"`
	Image         string `json:"image"`
}

type UpdateEnv added in v1.9.9

type UpdateEnv struct {
	EnvName  string              `json:"env_name"`
	Services []*UpdateServiceArg `json:"services"`
}

type UpdateEnvRequest added in v1.9.9

type UpdateEnvRequest struct {
	Type        string `form:"type"`
	ProjectName string `form:"projectName"`
	Force       bool   `form:"force"`
}

type UpdateIngressArgs added in v1.9.9

type UpdateIngressArgs struct {
	EnvName              string `json:"env_name"`
	ProductName          string `json:"product_name"`
	IngressName          string `json:"ingress_name"`
	YamlData             string `json:"yaml_data"`
	RestartAssociatedSvc bool   `json:"restart_associated_svc"`
}

type UpdateMultiHelmProductArg added in v1.5.0

type UpdateMultiHelmProductArg struct {
	ProductName     string                            `json:"productName"`
	EnvNames        []string                          `json:"envNames"`
	ChartValues     []*commonservice.HelmSvcRenderArg `json:"chartValues"`
	DeletedServices []string                          `json:"deletedServices"`
	ReplacePolicy   string                            `json:"replacePolicy"` // TODO logic not implemented
}

type UpdatePvcArgs added in v1.9.9

type UpdatePvcArgs struct {
	EnvName              string `json:"env_name"`
	ProductName          string `json:"product_name"`
	PvcName              string `json:"pvc_name"`
	YamlData             string `json:"yaml_data"`
	RestartAssociatedSvc bool   `json:"restart_associated_svc"`
}

type UpdateServiceArg added in v1.9.9

type UpdateServiceArg struct {
	ServiceName    string                          `json:"service_name"`
	DeployStrategy string                          `json:"deploy_strategy"`
	VariableKVs    []*commontypes.RenderVariableKV `json:"variable_kvs"`
}

type WorkloadCommonData added in v1.9.9

type WorkloadCommonData struct {
	Name           string
	WorkloadDetail *resource.Workload
	Services       []*resource.Service
	Ingresses      []*resource.Ingress
}

func GetDeployWorkloadData added in v1.9.9

func GetDeployWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)

func GetDsWorkloadData added in v1.9.9

func GetDsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)

func GetJobData added in v1.9.9

func GetJobData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)

func GetStsWorkloadData added in v1.9.9

func GetStsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)

type WorkloadCronJob added in v1.9.9

type WorkloadCronJob struct {
	*ResourceCommon
	Schedule     string `json:"schedule"`
	Suspend      bool   `json:"suspend"`
	Active       int    `json:"active"`
	LastSchedule string `json:"last_schedule"`
	Age          string `json:"age"`
}

type WorkloadDaemonSet added in v1.9.9

type WorkloadDaemonSet struct {
	*ResourceCommon
	Desired   int `json:"desired"`
	Current   int `json:"current"`
	Ready     int `json:"ready"`
	UpToDate  int `json:"up_to_date"`
	Available int `json:"available"`
}

type WorkloadDeploySts added in v1.9.9

type WorkloadDeploySts struct {
	*ResourceCommon
	Ready string `json:"ready"`
}

type WorkloadDetailResp added in v1.9.9

type WorkloadDetailResp struct {
	Name     string                    `json:"name"`
	Type     string                    `json:"type"`
	Replicas int32                     `json:"replicas"`
	Images   []resource.ContainerImage `json:"images"`
	Pods     []*resource.Pod           `json:"pods"`
	Ingress  []*resource.Ingress       `json:"ingress"`
	Services []*resource.Service       `json:"service_endpoints"`
}

func GetWorkloadDetail added in v1.9.9

func GetWorkloadDetail(args *FetchResourceArgs, workloadType, workloadName string, log *zap.SugaredLogger) (*WorkloadDetailResp, error)

type WorkloadImage added in v1.9.9

type WorkloadImage struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

type WorkloadImageTarget added in v1.9.9

type WorkloadImageTarget struct {
	Target    string `json:"target"`
	ImageName string `json:"image_name"`
}

func ListCustomWorkload added in v1.9.9

func ListCustomWorkload(clusterID, namespace string, log *zap.SugaredLogger) ([]*WorkloadImageTarget, error)

type WorkloadInfo added in v1.9.9

type WorkloadInfo struct {
	WorkloadType  string `json:"workload_type"`
	WorkloadName  string `json:"workload_name"`
	ContainerName string `json:"container_name"`
}

func ListWorkloadsInfo added in v1.9.9

func ListWorkloadsInfo(clusterID, namespace string, log *zap.SugaredLogger) ([]*WorkloadInfo, error)

for now,only support deployment

type WorkloadItem added in v1.9.9

type WorkloadItem interface {
	GetName() string
	ImageInfos() []string
}

type WorkloadJob added in v1.9.9

type WorkloadJob struct {
	*ResourceCommon
	Completions string `json:"completions"`
	Duration    string `json:"duration"`
	Age         string `json:"age"`
}

type YamlContentRequestArg added in v1.6.0

type YamlContentRequestArg struct {
	CodehostID  int    `json:"codehostID" form:"codehostID"`
	Owner       string `json:"owner" form:"owner"`
	Repo        string `json:"repo" form:"repo"`
	Namespace   string `json:"namespace" form:"namespace"`
	Branch      string `json:"branch" form:"branch"`
	RepoLink    string `json:"repoLink" form:"repoLink"`
	ValuesPaths string `json:"valuesPaths" form:"valuesPaths"`
}

type YamlProductItem added in v1.9.9

type YamlProductItem struct {
	OldName         string                           `json:"old_name"`
	NewName         string                           `json:"new_name"`
	BaseName        string                           `json:"base_name"`
	DefaultValues   string                           `json:"default_values"`
	GlobalVariables []*commontypes.GlobalVariableKV  `json:"global_variables"`
	Services        []*commonservice.K8sSvcRenderArg `json:"services"`
}

type YamlServiceWithKV added in v1.9.9

type YamlServiceWithKV struct {
	ServiceName string                          `json:"service_name"`
	VariableKvs []*commontypes.RenderVariableKV `json:"variable_kvs"`
}

type ZadigServiceStatusResp added in v1.17.0

type ZadigServiceStatusResp struct {
	ServiceName string
	PodStatus   string
	Ready       string
	Ingress     []*resource.Ingress
	Images      []string
	Workloads   []*commonservice.Workload
}

Jump to

Keyboard shortcuts

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