Documentation ¶
Index ¶
- Constants
- Variables
- func AutoDeployHelmServiceToEnvs(userName, requestID, projectName string, ...) error
- func AutoDeployYamlServiceToEnvs(userName, requestID string, serviceTemplate *commonmodels.Service, ...) error
- func BulkCopyHelmProduct(projectName, user, requestID string, arg CopyHelmProductArg, ...) error
- func BulkCopyYamlProduct(projectName, user, requestID string, arg CopyYamlProductArg, ...) error
- func CalculateK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)
- func CalculateNonK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)
- func CheckServicesDeployedInSubEnvs(ctx context.Context, productName, envName string, services []string) (map[string][]string, error)
- func CheckWorkloadsK8sServices(ctx context.Context, envName, productName string) ([]string, error)
- func CleanProductCronJob(requestID string, log *zap.SugaredLogger)
- func CleanProducts()
- func ConnectSshPmExec(c *gin.Context, username, envName, productName, ip, hostId string, ...) error
- func CopyHelmProduct(productName, userName, requestID string, args []*CreateSingleProductArg, ...) error
- func CopyYamlProduct(user, requestID, projectName string, args []*CreateSingleProductArg, ...) (err error)
- func CreateCommonEnvCfg(args *models.CreateUpdateCommonEnvCfgArgs, userName string, ...) error
- func CreateHelmProduct(productName, userName, requestID string, args []*CreateSingleProductArg, ...) error
- func CreateHostProductionProduct(productName, userName, requestID string, args []*CreateSingleProductArg, ...) error
- func CreateProduct(user, requestID string, args *commonmodels.Product, log *zap.SugaredLogger) (err error)
- func CreateYamlProduct(productName, userName, requestID string, args []*CreateSingleProductArg, ...) error
- func DeleteClusterInformer(clusterID string)
- func DeleteCommonEnvCfg(envName, productName, objectName string, ...) error
- func DeletePod(envName, productName, podName string, log *zap.SugaredLogger) error
- func DeleteProduct(username, envName, productName, requestID string, isDelete bool, ...) (err error)
- func DeleteProductHelmReleases(userName, requestID, envName, productName string, releases []string, ...) (err error)
- func DeleteProductServices(userName, requestID, envName, productName string, serviceNames []string, ...) (err error)
- func DeleteProductionProduct(username, envName, productName, requestID string, log *zap.SugaredLogger) (err error)
- func DisableBaseEnv(ctx context.Context, envName, productName string) error
- func DownloadFile(envName, productName, podName, container, path string, log *zap.SugaredLogger) ([]byte, string, error)
- func EnableBaseEnv(ctx context.Context, envName, productName string) error
- func EnsureDeleteShareEnvConfig(ctx context.Context, env *commonmodels.Product, ...) error
- func EnsureDeleteZadigService(ctx context.Context, env *commonmodels.Product, svcSelector labels.Selector, ...) error
- func EnsureGrayEnvConfig(ctx context.Context, env *commonmodels.Product, kclient client.Client, ...) error
- func EnsureProductionNamespace(createArgs []*CreateSingleProductArg) error
- func EnsureUpdateZadigService(ctx context.Context, env *commonmodels.Product, svcName string, ...) error
- func EnvAnalysisNotification(projectName, envName, result string, ...) error
- func ExportProductionYaml(envName, productName, serviceName string, log *zap.SugaredLogger) ([]string, error)
- func ExportYaml(envName, productName, serviceName, source string, log *zap.SugaredLogger) []string
- func FindProductRenderSet(productName, renderName, envName string, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
- func GeneEstimatedValues(productName, envName, serviceOrReleaseName, scene, format string, ...) (interface{}, error)
- func GetAffectedServices(productName, envName string, arg *K8sRendersetArg, log *zap.SugaredLogger) (map[string][]string, error)
- func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)
- func GetEnvAnalysisHistory(projectName string, production bool, envName string, pageNum, pageSize int, ...) ([]*ai.EnvAIAnalysis, int64, error)
- func GetEnvServiceList(ctx context.Context, productName, baseEnvName string) ([][]string, error)
- func GetEstimatedRenderCharts(productName, envName string, getSvcRenderArgs []*commonservice.GetSvcRenderArg, ...) ([]*commonservice.HelmSvcRenderArg, error)
- func GetGlobalVariableCandidate(productName, envName string, log *zap.SugaredLogger) ([]*commontypes.ServiceVariableKV, error)
- func GetGlobalVariables(productName, envName string, log *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, int64, error)
- func GetHelmChartVersions(productName, envName string, log *zap.SugaredLogger) ([]*commonmodels.HelmVersions, error)
- func GetInitProduct(productTmplName string, envType types.EnvType, isBaseEnv bool, ...) (*commonmodels.Product, error)
- func GetK8sResourceYaml(args *FetchResourceArgs, log *zap.SugaredLogger) (string, error)
- func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)
- func GetProductAndFilterNs(namespace, workloadName, svcName string) (*models.Product, bool)
- func GetProductDeployType(projectName string) (string, error)
- func GetProductInfo(username, envName, productName string, log *zap.SugaredLogger) (*commonmodels.Product, error)
- func GetServiceContainer(envName, productName, serviceName, container string, log *zap.SugaredLogger) error
- func GetServiceWorkloads(svcTmpl *commonmodels.Service, env *commonmodels.Product, ...) ([]*commonservice.Workload, error)
- func InstallService(helmClient *helmtool.HelmClient, param *kube.ReleaseInstallParam) error
- func ListAvailableNamespaces(clusterID, listType string, log *zap.SugaredLogger) ([]*resource.Namespace, error)
- func ListDeploymentNames(clusterID, namespace string, log *zap.SugaredLogger) ([]string, error)
- func ListGroups(serviceName, envName, productName string, perPage, page int, production bool, ...) ([]*commonservice.ServiceResp, int, error)
- func ListKubeEvents(env string, productName string, name string, rtype string, ...) ([]*resource.Event, error)
- func ListNamespace(clusterID string, log *zap.SugaredLogger) ([]string, error)
- func ListNamespaceFromCluster(clusterID string) ([]*corev1.Namespace, error)
- func ListPodEvents(envName, productName, podName string, log *zap.SugaredLogger) ([]*resource.Event, error)
- func ListProductionGroups(serviceName, envName, productName string, perPage, page int, ...) ([]*commonservice.ServiceResp, int, error)
- func ListServicePods(productName, envName string, serviceName string, log *zap.SugaredLogger) ([]*resource.Pod, error)
- func MigrateHistoryConfigMaps(envName, productName string, log *zap.SugaredLogger) ([]*models.EnvResource, error)
- func NewClusterInformerFactory(clusterID string, cls *kubernetes.Clientset) (informers.SharedInformerFactory, error)
- func OpenAPICreateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, ...) error
- func OpenAPICreateK8sEnv(args *OpenAPICreateEnvArgs, userName, requestID string, ...) error
- func OpenAPICreateProductionEnv(args *OpenAPICreateEnvArgs, userName, requestID string, ...) error
- func OpenAPIDeleteCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error
- func OpenAPIDeleteProductionEnvCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error
- func OpenAPIGetGlobalVariables(projectName, envName string, production bool, logger *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, error)
- func OpenAPIRestartService(projectName, envName, serviceName string, logger *zap.SugaredLogger) error
- func OpenAPIScale(req *OpenAPIScaleServiceReq, logger *zap.SugaredLogger) error
- func OpenAPIUpdateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, ...) error
- func OpenAPIUpdateEnvBasicInfo(args *EnvBasicInfoArgs, userName, projectName, envName string, production bool, ...) error
- func OpenAPIUpdateGlobalVariables(args *OpenAPIEnvGlobalVariables, ...) error
- func OpenAPIUpdateYamlService(req *OpenAPIServiceVariablesReq, ...) error
- func PatchDebugContainer(ctx context.Context, projectName, envName, podName, debugImage string) error
- func PatchWorkload(ctx context.Context, projectName, envName, serviceName, devImage string) (*types.WorkloadInfo, error)
- func ReInstallHelmProductionSvcInAllEnvs(productName string, templateSvc *commonmodels.Service) error
- func ReInstallHelmSvcInAllEnvs(productName string, templateSvc *commonmodels.Service) error
- func RecoverWorkload(ctx context.Context, projectName, envName, serviceName string) error
- func ResetProductsStatus()
- func RestartScale(args *RestartScaleArgs, _ *zap.SugaredLogger) error
- func RestartService(envName string, args *SvcOptArgs, log *zap.SugaredLogger) (err error)
- func RollBackConfigMap(envName string, args *RollBackConfigMapArgs, userName, userID string, ...) error
- func Scale(args *ScaleArgs, logger *zap.SugaredLogger) error
- func StartClusterInformer()
- func SyncEnvResource(args *SyncEnvResourceArg, log *zap.SugaredLogger) error
- func SyncHelmProductEnvironment(productName, envName, requestID string, log *zap.SugaredLogger) error
- func SyncYamlFromSource(yamlData *templatemodels.CustomYaml, curValue string) (bool, string, error)
- func UpdateCVMProduct(envName, productName, user, requestID string, log *zap.SugaredLogger) error
- func UpdateCommonEnvCfg(args *models.CreateUpdateCommonEnvCfgArgs, userName string, ...) error
- func UpdateConfigMap(args *models.CreateUpdateCommonEnvCfgArgs, userName string, ...) error
- func UpdateContainerImage(requestID string, args *UpdateContainerImageArgs, log *zap.SugaredLogger) error
- func UpdateEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, production *bool, ...) error
- func UpdateHelmProductCharts(productName, envName, userName, requestID string, args *EnvRendersetArg, ...) error
- func UpdateHelmProductRenderset(productName, envName, userName, requestID string, args *EnvRendersetArg, ...) error
- func UpdateOrCreateIngress(args *models.CreateUpdateCommonEnvCfgArgs, userName string, isCreate bool, ...) error
- func UpdateProductAlias(envName, productName, alias string) error
- func UpdateProductDefaultValues(productName, envName, userName, requestID string, args *EnvRendersetArg, ...) error
- func UpdateProductDefaultValuesWithRender(productRenderset *models.RenderSet, userName, requestID string, ...) error
- func UpdateProductGlobalVariables(productName, envName, userName, requestID string, currentRevision int64, ...) error
- func UpdateProductGlobalVariablesWithRender(product *commonmodels.Product, productRenderset *models.RenderSet, ...) error
- func UpdateProductRecycleDay(envName, productName string, recycleDay int) error
- func UpdateProductRegistry(envName, productName, registryID string, log *zap.SugaredLogger) (err error)
- func UpdateProductVariable(productName, envName, username, requestID string, ...) error
- func UpdateProductionEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, logger *zap.SugaredLogger) error
- func UpdatePvc(args *models.CreateUpdateCommonEnvCfgArgs, userName string, ...) error
- func UpdateSecret(args *models.CreateUpdateCommonEnvCfgArgs, userName string, ...) error
- func UpdateService(args *SvcOptArgs, log *zap.SugaredLogger) error
- func UpsertEnvAnalysisCron(projectName, envName string, production *bool, req *EnvAnalysisCronArg, ...) error
- func VersionLessThan121(ver *k8sversion.Info) bool
- func VisitDeployment(deployment *appsv1.Deployment) (sets.String, sets.String, sets.String)
- func VisitStatefulSet(sts *appsv1.StatefulSet) (sets.String, sets.String, sets.String)
- type AutoCreator
- type CfgRepoInfo
- type ChartImagesResp
- type ChartInfo
- type ConfigTmplData
- type ContainerNotFound
- type CopyHelmProductArg
- type CopyYamlProductArg
- type CreateEnvRequest
- type CreateProductParam
- type CreateSingleProductArg
- type DefaultValuesResp
- type DeployStatus
- type EnvAnalysisCronArg
- type EnvAnalysisRespone
- type EnvBasicInfoArgs
- type EnvCfgArgs
- type EnvConfigsArgs
- type EnvGroupRequest
- type EnvRenderChartArg
- type EnvRendersetArg
- type EnvResp
- type EnvStatus
- func AutoCreateProduct(productName, envType, requestID string, log *zap.SugaredLogger) []*EnvStatus
- func OpenAPIApplyYamlService(projectKey string, req *OpenAPIApplyYamlServiceReq, production bool, ...) ([]*EnvStatus, error)
- func UpdateMultiCVMProducts(envNames []string, productName, user, requestID string, log *zap.SugaredLogger) ([]*EnvStatus, error)
- func UpdateMultipleHelmChartEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, ...) ([]*EnvStatus, error)
- func UpdateMultipleHelmEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, ...) ([]*EnvStatus, error)
- func UpdateMultipleK8sEnv(args []*UpdateEnv, envNames []string, productName, requestID string, ...) ([]*EnvStatus, error)
- type EnvoyAddress
- type EnvoyClusterConfigLoadAssignment
- type EnvoyEndpoint
- type EnvoyEndpoints
- type EnvoyLBEndpoints
- type EnvoySocketAddress
- type EstimateValuesArg
- type ExternalProductCreator
- type FetchResourceArgs
- type GetReleaseInstanceDeployStatusResponse
- type GitRepoConfig
- type GlobalVariables
- type HelmChartsResp
- type HelmDeployStatusCheckRequest
- type HelmProductCreator
- type HelmProductItem
- type HelmReleaseQueryArgs
- type HelmReleaseResp
- type IProductCreator
- type ImageData
- type K8sDeployStatusCheckRequest
- type K8sRendersetArg
- type K8sResource
- type K8sResourceResp
- func ListConfigMapOverview(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)
- func ListCronJobs(page, pageSize int, clusterID, namespace string, kc client.Client, ...) (*K8sResourceResp, error)
- func ListDaemonSets(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)
- func ListDeployments(page, pageSize int, namespace string, kc client.Client, ...) (*K8sResourceResp, error)
- func ListIngressOverview(page, pageSize int, clusterID, namespace string, kc client.Client, ...) (*K8sResourceResp, error)
- func ListJobs(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)
- func ListK8sResOverview(args *FetchResourceArgs, log *zap.SugaredLogger) (*K8sResourceResp, error)
- func ListK8sSecretOverview(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)
- func ListPVCs(page, pageSize int, namespace string, kc client.Client) (*K8sResourceResp, error)
- func ListServices(page, pageSize int, namespace string, kc client.Client, ...) (*K8sResourceResp, error)
- func ListStatefulSets(page, pageSize int, namespace string, kc client.Client, ...) (*K8sResourceResp, error)
- type K8sService
- type K8sYamlProductCreator
- type ListCommonEnvCfgHistoryArgs
- type ListCommonEnvCfgHistoryRes
- type ListConfigMapArgs
- type ListConfigMapRes
- type ListIngressesResponse
- type ListPvcsResponse
- type ListSecretsResponse
- type MatchedEnv
- type MigrateHistoryConfigMapsRes
- type NodeResp
- type OpenAPIApplyYamlServiceReq
- type OpenAPICreateEnvArgs
- type OpenAPICreateServiceArgs
- type OpenAPIDeleteYamlServiceFromEnvReq
- type OpenAPIEnvCfgArgs
- type OpenAPIEnvCfgBrief
- type OpenAPIEnvCfgConfigMapDetail
- type OpenAPIEnvCfgDetail
- type OpenAPIEnvCfgIngressDetail
- type OpenAPIEnvCfgPvcDetail
- type OpenAPIEnvCfgSecretDetail
- type OpenAPIEnvDetail
- type OpenAPIEnvGlobalVariables
- type OpenAPIEnvServiceDetail
- type OpenAPIListEnvBrief
- type OpenAPIScaleServiceReq
- type OpenAPIServiceDetail
- type OpenAPIServiceVariablesReq
- type PMProductCreator
- type PMService
- type PreviewServiceArgs
- type ProductHelmServiceCreationInfo
- type ProductIngressInfo
- type ProductK8sServiceCreationInfo
- type ProductParams
- type ProductResp
- type ProductRevision
- func GetProductRevision(product *commonmodels.Product, allServiceTmpls []*commonmodels.Service, ...) (*ProductRevision, error)
- func ListProductSnapsByOption(deployType string, log *zap.SugaredLogger) ([]*ProductRevision, error)
- func ListProductsRevision(productName, envName string, production bool, log *zap.SugaredLogger) (prodRevs []*ProductRevision, err error)
- type RawYamlResp
- type ReleaseFilter
- type ReleaseStatus
- type ResourceCommon
- type ResourceConfigMap
- type ResourceDeployStatus
- type ResourceIngress
- type ResourcePVC
- type ResourceResponseBase
- type ResourceSecret
- type ResourceService
- type ResourceWithLabel
- type RestartScaleArgs
- type RollBackConfigMapArgs
- type ScaleArgs
- type ServiceDeployStatus
- type ServiceImages
- type ServiceMatchedDeploymentContainers
- type ServiceVariable
- type ShareEnvOp
- type ShareEnvReady
- type ShareEnvReadyChecks
- type SortableByCreationTime
- type SvcDataSet
- type SvcDiffResult
- func BatchPreviewService(args []*PreviewServiceArgs, logger *zap.SugaredLogger) ([]*SvcDiffResult, error)
- func GetServiceDiff(envName, productName, serviceName string, log *zap.SugaredLogger) (*SvcDiffResult, error)
- func PreviewHelmProductGlobalVariables(productName, envName, globalVariable string, log *zap.SugaredLogger) ([]*SvcDiffResult, error)
- func PreviewProductGlobalVariables(productName, envName string, arg []*commontypes.GlobalVariableKV, ...) ([]*SvcDiffResult, error)
- func PreviewProductGlobalVariablesWithRender(product *commonmodels.Product, productRenderset *models.RenderSet, ...) ([]*SvcDiffResult, error)
- func PreviewService(args *PreviewServiceArgs, _ *zap.SugaredLogger) (*SvcDiffResult, error)
- type SvcOptArgs
- type SvcResp
- func GetMseServiceImpl(serviceName string, workLoadType string, env *commonmodels.Product, ...) (ret *SvcResp, err error)
- func GetService(envName, productName, serviceName string, production bool, workLoadType string, ...) (ret *SvcResp, err error)
- func GetServiceImpl(serviceName string, serviceTmpl *commonmodels.Service, workLoadType string, ...) (ret *SvcResp, err error)
- type SvcRevision
- type SyncEnvResourceArg
- type TmplConfig
- type TmplYaml
- type UpdateConfigMapArgs
- type UpdateContainerImageArgs
- type UpdateEnv
- type UpdateEnvRequest
- type UpdateIngressArgs
- type UpdateMultiHelmProductArg
- type UpdatePvcArgs
- type UpdateServiceArg
- type WorkloadCommonData
- func GetDeployWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, ...) (*WorkloadCommonData, error)
- func GetDsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, ...) (*WorkloadCommonData, error)
- func GetJobData(ns, name string, kc client.Client, cs *kubernetes.Clientset, ...) (*WorkloadCommonData, error)
- func GetStsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, ...) (*WorkloadCommonData, error)
- type WorkloadCronJob
- type WorkloadDaemonSet
- type WorkloadDeploySts
- type WorkloadDetailResp
- type WorkloadImage
- type WorkloadImageTarget
- type WorkloadInfo
- type WorkloadItem
- type WorkloadJob
- type YamlContentRequestArg
- type YamlProductItem
- type YamlServiceWithKV
- type ZadigServiceStatusResp
Constants ¶
const K8sBetaVersionForEphemeralContainer = "v1.23"
const (
Timeout = 60
)
const ZadigDebugContainerName = "zadig-debug"
Variables ¶
var ClusterInformersMap sync.Map
var ClusterStopChanMap sync.Map
var DefaultCleanWhiteList = []string{"spockadmin"}
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
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 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 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 DeleteProductServices ¶ added in v1.9.9
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 DownloadFile ¶ added in v1.9.9
func EnableBaseEnv ¶ added in v1.9.9
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 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 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 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 GetProductDeployType ¶ added in v1.9.9
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 GetServiceWorkloads(svcTmpl *commonmodels.Service, env *commonmodels.Product, inf informers.SharedInformerFactory, log *zap.SugaredLogger) ([]*commonservice.Workload, error)
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 ListNamespace ¶ added in v1.9.9
func ListNamespace(clusterID string, log *zap.SugaredLogger) ([]string, error)
func ListNamespaceFromCluster ¶ added in v1.9.9
func ListPodEvents ¶
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 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 PatchWorkload ¶ added in v1.9.9
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 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 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 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 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 VisitStatefulSet ¶ added in v1.9.9
Types ¶
type AutoCreator ¶ added in v1.5.0
type AutoCreator struct {
Param *CreateProductParam
}
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 ConfigTmplData ¶
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 CreateProductParam ¶ added in v1.5.0
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"` 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
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 EnvCfgArgs ¶ added in v1.9.9
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 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 }
func ListProductionEnvs ¶ added in v1.9.9
func ListProducts ¶
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 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
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 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 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 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 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 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 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 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 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 ListK8sResOverview ¶ added in v1.9.9
func ListK8sResOverview(args *FetchResourceArgs, log *zap.SugaredLogger) (*K8sResourceResp, error)
func ListK8sSecretOverview ¶ added in v1.9.9
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 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 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 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 }
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 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 RollBackConfigMapArgs ¶
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 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 ShareEnvReady ¶ added in v1.9.9
type ShareEnvReady struct {}
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 {}
type SortableByCreationTime ¶ added in v1.9.9
type SortableByCreationTime interface {
GetCreationTime() string
}
type SvcDataSet ¶ added in v1.9.9
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 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 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 TmplConfig ¶
type TmplConfig struct {
Data []ConfigTmplData `json:"data,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 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 UpdateIngressArgs ¶ added in v1.9.9
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 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 WorkloadDaemonSet ¶ added in v1.9.9
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 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 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
Source Files ¶
- bundle.go
- common_env_cfg.go
- common_env_cfg_informer.go
- configmap.go
- debug.go
- diff.go
- env.go
- environment.go
- environment_copy.go
- environment_creation.go
- environment_creator.go
- environment_define.go
- environment_group.go
- environment_update.go
- export.go
- helm.go
- ide.go
- image.go
- ingress.go
- k8s.go
- kube.go
- kube_fetcher.go
- openapi.go
- pm.go
- pm_exec.go
- product.go
- production_environment.go
- pvc.go
- renderset.go
- revision.go
- secret.go
- service.go
- share_env.go
- share_env_utils.go
- types.go