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, production bool) ([]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 *ProductCreateArg, 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, production bool, 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 DisableIstioGrayscale(ctx context.Context, envName, productName string) error
- func DownloadFile(envName, productName, podName, container, path string, production bool, ...) ([]byte, string, error)
- func EnableBaseEnv(ctx context.Context, envName, productName string) error
- func EnableIstioGrayscale(ctx context.Context, envName, productName string) error
- func EnsureDeleteShareEnvConfig(ctx context.Context, env *commonmodels.Product, ...) error
- func EnsureDeleteZadigService(ctx context.Context, env *commonmodels.Product, svcName string, ...) 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 EnvSleep(productName, envName string, isEnable, isProduction bool, ...) error
- func ExportYaml(envName, productName, serviceName, source string, production bool, ...) []string
- func FetchServiceYaml(productName, envName, serviceName string, _ *zap.SugaredLogger) (string, 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, production bool, log *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, int64, error)
- func GetInitProduct(productTmplName string, envType types.EnvType, isBaseEnv bool, ...) (*commonmodels.Product, error)
- func GetIstioGrayscaleConfig(ctx context.Context, envName, productName string) (commonmodels.IstioGrayscale, error)
- func GetK8sResourceYaml(args *FetchResourceArgs, log *zap.SugaredLogger) (string, error)
- func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)
- func GetPodDetailInfo(projectName, envName, podName string, production bool, log *zap.SugaredLogger) (*resource.Pod, error)
- func GetProductAndFilterNs(namespace, workloadName, svcName string) (*models.Product, bool)
- func GetProductDeployType(projectName string) (string, error)
- func GetService(envName, productName, serviceName string, production bool, workLoadType string, ...) (ret *commonservice.SvcResp, err error)
- func GetServiceWorkloads(svcTmpl *commonmodels.Service, env *commonmodels.Product, ...) ([]*commonservice.Workload, error)
- func GetZadigReleaseServiceImpl(releaseType, serviceName string, _ string, env *commonmodels.Product, ...) (ret *commonservice.SvcResp, err error)
- func InitializeEnvironment(projectKey string, envArgs []*commonmodels.Product, envType string, ...) error
- func InstallService(helmClient *helmtool.HelmClient, param *kube.ReleaseInstallParam) 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 ListPodEvents(envName, productName, podName string, production bool, log *zap.SugaredLogger) ([]*resource.Event, error)
- func ListProductionGroups(serviceName, envName, productName string, perPage, page int, ...) ([]*commonservice.ServiceResp, int, error)
- func MigrateHistoryConfigMaps(envName, productName string, production bool, 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, production bool, ...) 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 ReInstallHelmSvcInAllEnvs(productName string, templateSvc *commonmodels.Service, production bool) error
- func RecoverWorkload(ctx context.Context, projectName, envName, serviceName string) error
- func ResetProductsStatus()
- func RestartScale(args *RestartScaleArgs, production bool, _ *zap.SugaredLogger) error
- func RestartService(envName string, args *SvcOptArgs, production bool, log *zap.SugaredLogger) (err error)
- func RollBackConfigMap(envName string, args *RollBackConfigMapArgs, userName, userID string, ...) error
- func RollbackEnvServiceVersion(ctx *internalhandler.Context, projectName, envName, serviceName string, ...) error
- func Scale(args *ScaleArgs, logger *zap.SugaredLogger) error
- func SetIstioGrayscaleConfig(ctx context.Context, envName, productName string, ...) error
- func SetupIstioGrayscalePortalService(ctx context.Context, productName, envName, serviceName string, ...) error
- func SetupPortalService(ctx context.Context, productName, envName, serviceName string, ...) 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, username string, args *UpdateContainerImageArgs, ...) error
- func UpdateEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, production *bool, ...) error
- func UpdateHelmProductCharts(productName, envName, userName, requestID string, production bool, ...) error
- func UpdateOrCreateIngress(args *models.CreateUpdateCommonEnvCfgArgs, userName string, isCreate bool, ...) error
- func UpdateProductAlias(envName, productName, alias string, production bool) error
- func UpdateProductDefaultValues(productName, envName, userName, requestID string, args *EnvRendersetArg, ...) error
- func UpdateProductDefaultValuesWithRender(product *commonmodels.Product, _ *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, production bool, ...) (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 UpsertEnvSleepCron(projectName, envName string, production *bool, req *EnvSleepCronArg, ...) 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 AutoCreateProductParam
- type AutoCreator
- type AvailableNamespace
- type CfgRepoInfo
- type ChartImagesResp
- type ChartInfo
- type ConfigTmplData
- type ContainerNotFound
- type CopyHelmProductArg
- type CopyYamlProductArg
- type CreateEnvRequest
- type CreateSingleProductArg
- type DefaultValuesResp
- type DeployStatus
- type DiffEnvServiceVersionsResponse
- type EnvAnalysisCronArg
- type EnvAnalysisRespone
- type EnvBasicInfoArgs
- type EnvCfgArgs
- type EnvConfigsArgs
- type EnvGroupRequest
- type EnvRenderChartArg
- type EnvRendersetArg
- type EnvResp
- type EnvSleepCronArg
- 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 GetEnvServiceVersionYamlResponse
- type GetPortalServiceResponse
- type GetReleaseInstanceDeployStatusResponse
- type GitRepoConfig
- type GlobalVariables
- type HelmChartsResp
- type HelmDeployStatusCheckRequest
- type HelmProductCreator
- type HelmProductItem
- type HelmReleaseQueryArgs
- type HelmReleaseResp
- type IProductCreator
- type ImageData
- type IstioGrayscaleChecks
- type IstioGrayscaleReady
- 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 ListEnvServiceVersionsResponse
- type ListIngressesResponse
- type ListPodsInfoRespone
- 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 ProductCreateArg
- 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 SetupPortalServiceRequest
- type ShareEnvOp
- type ShareEnvReady
- type ShareEnvReadyChecks
- type SharedNSEnvs
- type SortableByCreationTime
- type SvcDataSet
- type SvcDiffResult
- func BatchPreviewService(args []*PreviewServiceArgs, logger *zap.SugaredLogger) ([]*SvcDiffResult, error)
- func GetServiceDiff(envName, productName, serviceName string, production bool, ...) (*SvcDiffResult, error)
- func PreviewHelmProductGlobalVariables(productName, envName, globalVariable string, proudction bool, ...) ([]*SvcDiffResult, error)
- func PreviewProductGlobalVariables(productName, envName string, arg []*commontypes.GlobalVariableKV, ...) ([]*SvcDiffResult, error)
- func PreviewProductGlobalVariablesWithRender(product *commonmodels.Product, args []*commontypes.GlobalVariableKV, ...) ([]*SvcDiffResult, error)
- func PreviewService(args *PreviewServiceArgs, _ *zap.SugaredLogger) (*SvcDiffResult, error)
- type SvcOptArgs
- 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
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 ¶
func AutoDeployHelmServiceToEnvs(userName, requestID, projectName string, serviceTemplates []*commonmodels.Service, log *zap.SugaredLogger) error
func AutoDeployYamlServiceToEnvs ¶
func AutoDeployYamlServiceToEnvs(userName, requestID string, serviceTemplate *commonmodels.Service, production bool, log *zap.SugaredLogger) error
func BulkCopyHelmProduct ¶
func BulkCopyHelmProduct(projectName, user, requestID string, arg CopyHelmProductArg, log *zap.SugaredLogger) error
func BulkCopyYamlProduct ¶
func BulkCopyYamlProduct(projectName, user, requestID string, arg CopyYamlProductArg, log *zap.SugaredLogger) error
func CalculateK8sProductStatus ¶
func CalculateK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)
func CalculateNonK8sProductStatus ¶
func CalculateNonK8sProductStatus(productInfo *commonmodels.Product, log *zap.SugaredLogger) (string, error)
CalculateNonK8sProductStatus calculate product status for non k8s product: Helm
func CheckServicesDeployedInSubEnvs ¶
func CheckServicesDeployedInSubEnvs(ctx context.Context, productName, envName string, services []string) (map[string][]string, error)
Map of map[ServiceName][]string{EnvName} is returned.
func CheckWorkloadsK8sServices ¶
func CheckWorkloadsK8sServices(ctx context.Context, envName, productName string, production bool) ([]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 ¶
func CopyHelmProduct ¶
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 ¶
func CopyYamlProduct(user, requestID, projectName string, args []*CreateSingleProductArg, log *zap.SugaredLogger) (err error)
CopyYamlProduct copy product from source product
func CreateCommonEnvCfg ¶
func CreateCommonEnvCfg(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error
func CreateHelmProduct ¶
func CreateHelmProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error
CreateHelmProduct create helm product, only works in test product
func CreateHostProductionProduct ¶
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 *ProductCreateArg, log *zap.SugaredLogger) (err error)
CreateProduct create a new product with its dependent stacks
func CreateYamlProduct ¶
func CreateYamlProduct(productName, userName, requestID string, args []*CreateSingleProductArg, log *zap.SugaredLogger) error
func DeleteClusterInformer ¶
func DeleteClusterInformer(clusterID string)
func DeleteCommonEnvCfg ¶
func DeleteCommonEnvCfg(envName, productName, objectName string, commonEnvCfgType config.CommonEnvCfgType, production bool, log *zap.SugaredLogger) error
func DeletePod ¶
func DeletePod(envName, productName, podName string, production bool, log *zap.SugaredLogger) error
func DeleteProduct ¶
func DeleteProduct(username, envName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) (err error)
func DeleteProductServices ¶
func DeleteProductionProduct ¶
func DeleteProductionProduct(username, envName, productName, requestID string, log *zap.SugaredLogger) (err error)
func DisableIstioGrayscale ¶
func DownloadFile ¶
func EnableIstioGrayscale ¶
func EnsureDeleteShareEnvConfig ¶
func EnsureDeleteShareEnvConfig(ctx context.Context, env *commonmodels.Product, istioClient versionedclient.Interface) error
func EnsureDeleteZadigService ¶
func EnsureDeleteZadigService(ctx context.Context, env *commonmodels.Product, svcName string, kclient client.Client, istioClient versionedclient.Interface) error
func EnsureProductionNamespace ¶
func EnsureProductionNamespace(createArgs []*CreateSingleProductArg) error
func EnsureUpdateZadigService ¶
func EnsureUpdateZadigService(ctx context.Context, env *commonmodels.Product, svcName string, kclient client.Client, istioClient versionedclient.Interface) error
func EnvAnalysisNotification ¶
func EnvAnalysisNotification(projectName, envName, result string, configs []*commonmodels.NotificationConfig) error
func EnvSleep ¶
func EnvSleep(productName, envName string, isEnable, isProduction bool, log *zap.SugaredLogger) error
func ExportYaml ¶
func ExportYaml(envName, productName, serviceName, source string, production bool, log *zap.SugaredLogger) []string
ExportYaml 查询使用到服务模板的服务组模板 source determines where the request comes from, can be "wd" or "nil"
func FetchServiceYaml ¶
func FetchServiceYaml(productName, envName, serviceName string, _ *zap.SugaredLogger) (string, error)
func GeneEstimatedValues ¶
func GeneEstimatedValues(productName, envName, serviceOrReleaseName, scene, format string, arg *EstimateValuesArg, isHelmChartDeploy bool, log *zap.SugaredLogger) (interface{}, error)
func GetAffectedServices ¶
func GetAffectedServices(productName, envName string, arg *K8sRendersetArg, log *zap.SugaredLogger) (map[string][]string, error)
func GetBundleResources ¶
func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)
func GetEnvAnalysisHistory ¶
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 ¶
func GetEstimatedRenderCharts ¶
func GetEstimatedRenderCharts(productName, envName string, getSvcRenderArgs []*commonservice.GetSvcRenderArg, production bool, log *zap.SugaredLogger) ([]*commonservice.HelmSvcRenderArg, error)
func GetGlobalVariableCandidate ¶
func GetGlobalVariableCandidate(productName, envName string, log *zap.SugaredLogger) ([]*commontypes.ServiceVariableKV, error)
func GetGlobalVariables ¶
func GetGlobalVariables(productName, envName string, production bool, log *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, int64, error)
func GetInitProduct ¶
func GetIstioGrayscaleConfig ¶
func GetIstioGrayscaleConfig(ctx context.Context, envName, productName string) (commonmodels.IstioGrayscale, error)
func GetK8sResourceYaml ¶
func GetK8sResourceYaml(args *FetchResourceArgs, log *zap.SugaredLogger) (string, error)
func GetMergedYamlContent ¶
func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)
func GetPodDetailInfo ¶
func GetProductAndFilterNs ¶
func GetProductDeployType ¶
func GetService ¶
func GetService(envName, productName, serviceName string, production bool, workLoadType string, log *zap.SugaredLogger) (ret *commonservice.SvcResp, err error)
func GetServiceWorkloads ¶
func GetServiceWorkloads(svcTmpl *commonmodels.Service, env *commonmodels.Product, inf informers.SharedInformerFactory, log *zap.SugaredLogger) ([]*commonservice.Workload, error)
func GetZadigReleaseServiceImpl ¶
func GetZadigReleaseServiceImpl(releaseType, serviceName string, _ string, env *commonmodels.Product, kubeClient client.Client, _ *kubernetes.Clientset, inf informers.SharedInformerFactory, log *zap.SugaredLogger) (ret *commonservice.SvcResp, err error)
func InitializeEnvironment ¶
func InitializeEnvironment(projectKey string, envArgs []*commonmodels.Product, envType string, log *zap.SugaredLogger) error
func InstallService ¶
func InstallService(helmClient *helmtool.HelmClient, param *kube.ReleaseInstallParam) error
func ListDeploymentNames ¶
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 ¶
func ListNamespace(clusterID string, log *zap.SugaredLogger) ([]string, error)
func ListPodEvents ¶
func ListProductionGroups ¶
func ListProductionGroups(serviceName, envName, productName string, perPage, page int, log *zap.SugaredLogger) ([]*commonservice.ServiceResp, int, error)
func MigrateHistoryConfigMaps ¶
func MigrateHistoryConfigMaps(envName, productName string, production bool, log *zap.SugaredLogger) ([]*models.EnvResource, error)
func NewClusterInformerFactory ¶
func NewClusterInformerFactory(clusterID string, cls *kubernetes.Clientset) (informers.SharedInformerFactory, error)
func OpenAPICreateCommonEnvCfg ¶
func OpenAPICreateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, logger *zap.SugaredLogger) error
func OpenAPICreateK8sEnv ¶
func OpenAPICreateK8sEnv(args *OpenAPICreateEnvArgs, userName, requestID string, logger *zap.SugaredLogger) error
func OpenAPICreateProductionEnv ¶
func OpenAPICreateProductionEnv(args *OpenAPICreateEnvArgs, userName, requestID string, logger *zap.SugaredLogger) error
func OpenAPIDeleteCommonEnvCfg ¶
func OpenAPIDeleteCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error
func OpenAPIDeleteProductionEnvCommonEnvCfg ¶
func OpenAPIDeleteProductionEnvCommonEnvCfg(projectName, envName, cfgType, name string, logger *zap.SugaredLogger) error
func OpenAPIGetGlobalVariables ¶
func OpenAPIGetGlobalVariables(projectName, envName string, production bool, logger *zap.SugaredLogger) ([]*commontypes.GlobalVariableKV, error)
func OpenAPIRestartService ¶
func OpenAPIRestartService(projectName, envName, serviceName string, production bool, logger *zap.SugaredLogger) error
func OpenAPIScale ¶
func OpenAPIScale(req *OpenAPIScaleServiceReq, logger *zap.SugaredLogger) error
func OpenAPIUpdateCommonEnvCfg ¶
func OpenAPIUpdateCommonEnvCfg(projectName string, args *OpenAPIEnvCfgArgs, userName string, logger *zap.SugaredLogger) error
func OpenAPIUpdateEnvBasicInfo ¶
func OpenAPIUpdateEnvBasicInfo(args *EnvBasicInfoArgs, userName, projectName, envName string, production bool, logger *zap.SugaredLogger) error
func OpenAPIUpdateGlobalVariables ¶
func OpenAPIUpdateGlobalVariables(args *OpenAPIEnvGlobalVariables, userName, requestID, projectName, envName string, production bool, logger *zap.SugaredLogger) error
func OpenAPIUpdateYamlService ¶
func OpenAPIUpdateYamlService(req *OpenAPIServiceVariablesReq, userName, requestID, projectName, envName string, production bool, logger *zap.SugaredLogger) error
func PatchDebugContainer ¶
func PatchWorkload ¶
func ReInstallHelmSvcInAllEnvs ¶
func ReInstallHelmSvcInAllEnvs(productName string, templateSvc *commonmodels.Service, production bool) error
ReInstallHelmSvcInAllEnvs reinstall svc in all envs in which the svc is already installed
func RecoverWorkload ¶
func ResetProductsStatus ¶
func ResetProductsStatus()
func RestartScale ¶
func RestartScale(args *RestartScaleArgs, production bool, _ *zap.SugaredLogger) error
func RestartService ¶
func RestartService(envName string, args *SvcOptArgs, production bool, log *zap.SugaredLogger) (err error)
RestartService 在kube中, 如果资源存在就更新不存在就创建
func RollBackConfigMap ¶
func RollBackConfigMap(envName string, args *RollBackConfigMapArgs, userName, userID string, log *zap.SugaredLogger) error
func RollbackEnvServiceVersion ¶
func RollbackEnvServiceVersion(ctx *internalhandler.Context, projectName, envName, serviceName string, revision int64, isHelmChart, isProduction bool, log *zap.SugaredLogger) error
func SetIstioGrayscaleConfig ¶
func SetupIstioGrayscalePortalService ¶
func SetupIstioGrayscalePortalService(ctx context.Context, productName, envName, serviceName string, servers []SetupPortalServiceRequest) error
func SetupPortalService ¶
func SetupPortalService(ctx context.Context, productName, envName, serviceName string, servers []SetupPortalServiceRequest) error
func StartClusterInformer ¶
func StartClusterInformer()
func SyncEnvResource ¶
func SyncEnvResource(args *SyncEnvResourceArg, log *zap.SugaredLogger) error
func SyncHelmProductEnvironment ¶
func SyncHelmProductEnvironment(productName, envName, requestID string, log *zap.SugaredLogger) error
func SyncYamlFromSource ¶
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 ¶
func UpdateCVMProduct(envName, productName, user, requestID string, log *zap.SugaredLogger) error
func UpdateCommonEnvCfg ¶
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, username string, args *UpdateContainerImageArgs, log *zap.SugaredLogger) error
func UpdateEnvConfigs ¶
func UpdateEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, production *bool, logger *zap.SugaredLogger) error
func UpdateHelmProductCharts ¶
func UpdateHelmProductCharts(productName, envName, userName, requestID string, production bool, args *EnvRendersetArg, log *zap.SugaredLogger) error
func UpdateOrCreateIngress ¶
func UpdateOrCreateIngress(args *models.CreateUpdateCommonEnvCfgArgs, userName string, isCreate bool, log *zap.SugaredLogger) error
func UpdateProductAlias ¶
func UpdateProductDefaultValues ¶
func UpdateProductDefaultValues(productName, envName, userName, requestID string, args *EnvRendersetArg, production bool, log *zap.SugaredLogger) error
func UpdateProductDefaultValuesWithRender ¶
func UpdateProductDefaultValuesWithRender(product *commonmodels.Product, _ *models.RenderSet, userName, requestID string, args *EnvRendersetArg, production bool, log *zap.SugaredLogger) error
func UpdateProductGlobalVariables ¶
func UpdateProductGlobalVariables(productName, envName, userName, requestID string, currentRevision int64, arg []*commontypes.GlobalVariableKV, production bool, log *zap.SugaredLogger) error
func UpdateProductGlobalVariablesWithRender ¶
func UpdateProductGlobalVariablesWithRender(product *commonmodels.Product, productRenderset *models.RenderSet, userName, requestID string, args []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) error
func UpdateProductRecycleDay ¶
func UpdateProductRegistry ¶
func UpdateProductRegistry(envName, productName, registryID string, production bool, log *zap.SugaredLogger) (err error)
func UpdateProductVariable ¶
func UpdateProductVariable(productName, envName, username, requestID string, updatedSvcs []*templatemodels.ServiceRender, _ []*commontypes.GlobalVariableKV, defaultValue string, yamlData *templatemodels.CustomYaml, log *zap.SugaredLogger) error
func UpdateProductionEnvConfigs ¶
func UpdateProductionEnvConfigs(projectName, envName string, arg *EnvConfigsArgs, logger *zap.SugaredLogger) error
func UpdatePvc ¶
func UpdatePvc(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error
func UpdateSecret ¶
func UpdateSecret(args *models.CreateUpdateCommonEnvCfgArgs, userName string, log *zap.SugaredLogger) error
func UpdateService ¶
func UpdateService(args *SvcOptArgs, log *zap.SugaredLogger) error
func UpsertEnvAnalysisCron ¶
func UpsertEnvAnalysisCron(projectName, envName string, production *bool, req *EnvAnalysisCronArg, logger *zap.SugaredLogger) error
func UpsertEnvSleepCron ¶
func UpsertEnvSleepCron(projectName, envName string, production *bool, req *EnvSleepCronArg, logger *zap.SugaredLogger) error
func VersionLessThan121 ¶
func VersionLessThan121(ver *k8sversion.Info) bool
func VisitDeployment ¶
func VisitStatefulSet ¶
Types ¶
type AutoCreateProductParam ¶
type AutoCreator ¶
type AutoCreator struct {
Param *AutoCreateProductParam
}
type AvailableNamespace ¶
func ListAvailableNamespaces ¶
func ListAvailableNamespaces(clusterID, listType string, log *zap.SugaredLogger) ([]*AvailableNamespace, error)
ListAvailableNamespaces lists available namespaces created by non-koderover
type CfgRepoInfo ¶
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 ¶
type ChartImagesResp struct {
ServiceImages []*ServiceImages `json:"serviceImages"`
}
func GetImageInfos ¶
func GetImageInfos(productName, envName, serviceNames string, production bool, 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 ¶
type CopyHelmProductArg struct {
Items []HelmProductItem
}
type CopyYamlProductArg ¶
type CopyYamlProductArg struct {
Items []YamlProductItem `json:"items"`
}
type CreateEnvRequest ¶
type CreateSingleProductArg ¶
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"` // New Since v2.1.0 IstioGrayscale commonmodels.IstioGrayscale `json:"istio_grayscale"` }
type DefaultValuesResp ¶
type DefaultValuesResp struct { DefaultVariable string `json:"default_variable"` YamlData *templatemodels.CustomYaml `json:"yaml_data,omitempty"` }
func GetDefaultValues ¶
func GetDefaultValues(productName, envName string, production bool, log *zap.SugaredLogger) (*DefaultValuesResp, error)
type DeployStatus ¶
type DeployStatus string
const ( StatusDeployed DeployStatus = "deployed" StatusUnDeployed DeployStatus = "undeployed" )
type DiffEnvServiceVersionsResponse ¶
type DiffEnvServiceVersionsResponse struct { Type string `json:"type"` YamlA string `json:"yaml_a"` YamlB string `json:"yaml_b"` VariableYamlA string `json:"variable_yaml_a"` VariableYamlB string `json:"variable_yaml_b"` }
func DiffEnvServiceVersions ¶
func DiffEnvServiceVersions(ctx *internalhandler.Context, projectName, envName, serviceName string, revisionA, revisionB int64, isHelmChart, isProduction bool, log *zap.SugaredLogger) (DiffEnvServiceVersionsResponse, error)
type EnvAnalysisCronArg ¶
func GetEnvAnalysisCron ¶
func GetEnvAnalysisCron(projectName, envName string, production *bool, logger *zap.SugaredLogger) (*EnvAnalysisCronArg, error)
type EnvAnalysisRespone ¶
type EnvAnalysisRespone struct {
Result string `json:"result"`
}
func EnvAnalysis ¶
func EnvAnalysis(projectName, envName string, production *bool, triggerName string, userName string, logger *zap.SugaredLogger) (*EnvAnalysisRespone, error)
type EnvBasicInfoArgs ¶
type EnvCfgArgs ¶
type EnvConfigsArgs ¶
type EnvConfigsArgs struct { AnalysisConfig *models.AnalysisConfig `json:"analysis_config"` NotificationConfigs []*models.NotificationConfig `json:"notification_configs"` }
func GetEnvConfigs ¶
func GetEnvConfigs(projectName, envName string, production *bool, logger *zap.SugaredLogger) (*EnvConfigsArgs, error)
func GetProductionEnvConfigs ¶
func GetProductionEnvConfigs(projectName, envName string, logger *zap.SugaredLogger) (*EnvConfigsArgs, error)
type EnvGroupRequest ¶
type EnvRenderChartArg ¶
type EnvRenderChartArg struct {
ChartValues []*commonservice.HelmSvcRenderArg `json:"chartValues"`
}
type EnvRendersetArg ¶
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 ¶
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 // New Since v2.1.0 IstioGrayscaleEnable bool `json:"istio_grayscale_enable"` IstioGrayscaleIsBase bool `json:"istio_grayscale_is_base"` IstioGrayscaleBaseEnv string `json:"istio_grayscale_base_env"` }
func ListProductionEnvs ¶
func ListProducts ¶
type EnvSleepCronArg ¶
type EnvSleepCronArg struct { SleepCronEnable bool `json:"sleep_cron_enable"` SleepCron string `json:"sleep_cron"` AwakeCronEnable bool `json:"awake_cron_enable"` AwakeCron string `json:"awake_cron"` }
func GetEnvSleepCron ¶
func GetEnvSleepCron(projectName, envName string, production *bool, logger *zap.SugaredLogger) (*EnvSleepCronArg, 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
AutoCreateProduct happens in onboarding progress of pm project
func OpenAPIApplyYamlService ¶
func OpenAPIApplyYamlService(projectKey string, req *OpenAPIApplyYamlServiceReq, production bool, requestID string, logger *zap.SugaredLogger) ([]*EnvStatus, error)
func UpdateMultiCVMProducts ¶
func UpdateMultipleHelmChartEnv ¶
func UpdateMultipleHelmChartEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, log *zap.SugaredLogger) ([]*EnvStatus, error)
func UpdateMultipleHelmEnv ¶
func UpdateMultipleHelmEnv(requestID, userName string, args *UpdateMultiHelmProductArg, production bool, log *zap.SugaredLogger) ([]*EnvStatus, error)
func UpdateMultipleK8sEnv ¶
type EnvoyAddress ¶
type EnvoyAddress struct {
SocketAddress EnvoySocketAddress `json:"socket_address"`
}
type EnvoyClusterConfigLoadAssignment ¶
type EnvoyClusterConfigLoadAssignment struct { ClusterName string `json:"cluster_name"` Endpoints []EnvoyLBEndpoints `json:"endpoints"` }
type EnvoyEndpoint ¶
type EnvoyEndpoint struct {
Address EnvoyAddress `json:"address"`
}
type EnvoyEndpoints ¶
type EnvoyEndpoints struct {
Endpoint EnvoyEndpoint `json:"endpoint"`
}
type EnvoyLBEndpoints ¶
type EnvoyLBEndpoints struct {
LBEndpoints []EnvoyEndpoints `json:"lb_endpoints"`
}
type EnvoySocketAddress ¶
type EstimateValuesArg ¶
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 ¶
type ExternalProductCreator struct { }
func (*ExternalProductCreator) Create ¶
func (creator *ExternalProductCreator) Create(user, requestID string, args *ProductCreateArg, log *zap.SugaredLogger) error
type FetchResourceArgs ¶
type GetEnvServiceVersionYamlResponse ¶
type GetEnvServiceVersionYamlResponse struct { Type string `json:"type"` Yaml string `json:"yaml"` VariableYaml string `json:"variable_yaml"` }
func GetEnvServiceVersionYaml ¶
func GetEnvServiceVersionYaml(ctx *internalhandler.Context, projectName, envName, serviceName string, revision int64, isHelmChart, isProduction bool, log *zap.SugaredLogger) (GetEnvServiceVersionYamlResponse, error)
type GetPortalServiceResponse ¶
type GetPortalServiceResponse struct { DefaultGatewayAddress string `json:"default_gateway_address"` Servers []SetupPortalServiceRequest `json:"servers"` }
func GetIstioGrayscalePortalService ¶
func GetIstioGrayscalePortalService(ctx context.Context, productName, envName, serviceName string) (GetPortalServiceResponse, error)
func GetPortalService ¶
func GetPortalService(ctx context.Context, productName, envName, serviceName string) (GetPortalServiceResponse, error)
type GetReleaseInstanceDeployStatusResponse ¶
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 ¶
func GetReleaseInstanceDeployStatus(productName string, production bool, request *HelmDeployStatusCheckRequest) ([]*GetReleaseInstanceDeployStatusResponse, error)
type GitRepoConfig ¶
type GlobalVariables ¶
type GlobalVariables struct { Variables []*commontypes.ServiceVariableKV `json:"variables"` ProductionVariables []*commontypes.ServiceVariableKV `json:"production_variables"` }
type HelmChartsResp ¶
type HelmChartsResp struct { ChartInfos []*ChartInfo `json:"chartInfos"` FileInfos []*types.FileInfo `json:"fileInfos"` }
func GetChartInfos ¶
func GetChartInfos(productName, envName, serviceName string, production bool, log *zap.SugaredLogger) (*HelmChartsResp, error)
type HelmProductCreator ¶
type HelmProductCreator struct{}
func (*HelmProductCreator) Create ¶
func (creator *HelmProductCreator) Create(user, requestID string, args *ProductCreateArg, log *zap.SugaredLogger) error
type HelmProductItem ¶
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 ¶
type HelmReleaseResp ¶
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 ¶
func ListReleases(args *HelmReleaseQueryArgs, envName string, production bool, log *zap.SugaredLogger) ([]*HelmReleaseResp, error)
type IProductCreator ¶
type IProductCreator interface {
Create(string, string, *ProductCreateArg, *zap.SugaredLogger) error
}
type IstioGrayscaleChecks ¶
type IstioGrayscaleReady ¶
type IstioGrayscaleReady struct { IsReady bool `json:"is_ready"` Checks IstioGrayscaleChecks `json:"checks"` }
func CheckIstioGrayscaleReady ¶
func CheckIstioGrayscaleReady(ctx context.Context, envName, op, productName string) (*IstioGrayscaleReady, error)
func (*IstioGrayscaleReady) CheckAndSetReady ¶
func (s *IstioGrayscaleReady) CheckAndSetReady(state ShareEnvOp)
Note: `WorkloadsHaveK8sService` is an optional condition.
type K8sDeployStatusCheckRequest ¶
type K8sDeployStatusCheckRequest struct { EnvName string `json:"env_name"` Services []*commonservice.K8sSvcRenderArg `json:"services"` ClusterID string `json:"cluster_id"` Namespace string `json:"namespace"` }
type K8sRendersetArg ¶
type K8sRendersetArg struct {
VariableYaml string `json:"variable_yaml"`
}
type K8sResource ¶
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 ¶
func ListAllK8sResourcesInNamespace(clusterID, namespace string, log *zap.SugaredLogger) ([]*K8sResource, error)
type K8sResourceResp ¶
type K8sResourceResp struct { Count int `json:"count"` Workloads []interface{} `json:"workloads,omitempty"` Resources []SortableByCreationTime `json:"resources,omitempty"` }
func ListConfigMapOverview ¶
func ListCronJobs ¶
func ListCronJobs(page, pageSize int, clusterID, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)
func ListDaemonSets ¶
func ListDeployments ¶
func ListDeployments(page, pageSize int, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)
func ListIngressOverview ¶
func ListIngressOverview(page, pageSize int, clusterID, namespace string, kc client.Client, log *zap.SugaredLogger) (*K8sResourceResp, error)
func ListK8sResOverview ¶
func ListK8sResOverview(args *FetchResourceArgs, log *zap.SugaredLogger) (*K8sResourceResp, error)
func ListK8sSecretOverview ¶
func ListServices ¶
func ListServices(page, pageSize int, namespace string, kc client.Client, informer informers.SharedInformerFactory) (*K8sResourceResp, error)
func ListStatefulSets ¶
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
}
func (*K8sService) GetGroupService ¶
func (k *K8sService) GetGroupService(service *commonmodels.ProductService, string, informer informers.SharedInformerFactory, productInfo *commonmodels.Product) *commonservice.ServiceResp
type K8sYamlProductCreator ¶
type K8sYamlProductCreator struct { }
func (*K8sYamlProductCreator) Create ¶
func (creator *K8sYamlProductCreator) Create(user, requestID string, args *ProductCreateArg, log *zap.SugaredLogger) error
type ListCommonEnvCfgHistoryArgs ¶
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"` Production bool `json:"production" form:"production"` }
type ListCommonEnvCfgHistoryRes ¶
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 ¶
func ListEnvResourceHistory(args *ListCommonEnvCfgHistoryArgs, log *zap.SugaredLogger) ([]*ListCommonEnvCfgHistoryRes, error)
func ListLatestEnvResources ¶
func ListLatestEnvResources(args *ListCommonEnvCfgHistoryArgs, log *zap.SugaredLogger) ([]*ListCommonEnvCfgHistoryRes, error)
type ListConfigMapArgs ¶
type ListConfigMapRes ¶
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 ListEnvServiceVersionsResponse ¶
type ListEnvServiceVersionsResponse struct { ServiceName string `json:"service_name"` Revision int64 `json:"revision"` CreateTime int64 `json:"create_time"` CreateBy string `json:"create_by"` }
func ListEnvServiceVersions ¶
func ListEnvServiceVersions(ctx *internalhandler.Context, projectName, envName, serviceName string, isHelmChart, isProduction bool, log *zap.SugaredLogger) ([]ListEnvServiceVersionsResponse, error)
type ListIngressesResponse ¶
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 ¶
func ListIngresses(envName, productName string, production bool, log *zap.SugaredLogger) ([]*ListIngressesResponse, error)
type ListPodsInfoRespone ¶
type ListPodsInfoRespone struct { Name string `json:"name"` Ready string `json:"ready"` Status string `json:"status"` Images []string `json:"images"` CreateTime int64 `json:"create_time"` }
func ListPodsInfo ¶
func ListPodsInfo(projectName, envName string, production bool, log *zap.SugaredLogger) ([]*ListPodsInfoRespone, error)
type ListPvcsResponse ¶
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 ¶
func ListPvcs(envName, productName string, production bool, log *zap.SugaredLogger) ([]*ListPvcsResponse, error)
type ListSecretsResponse ¶
type ListSecretsResponse struct { *ResourceResponseBase SecretName string `json:"secret_name"` SecretType string `json:"secret_type"` }
func ListSecrets ¶
func ListSecrets(envName, productName string, production bool, log *zap.SugaredLogger) ([]*ListSecretsResponse, error)
type MatchedEnv ¶
type MigrateHistoryConfigMapsRes ¶
type MigrateHistoryConfigMapsRes struct { }
type NodeResp ¶
type NodeResp struct { Nodes []*internalresource.Node `json:"data"` Labels []string `json:"labels"` }
func ListAvailableNodes ¶
func ListAvailableNodes(clusterID string, log *zap.SugaredLogger) (*NodeResp, error)
type OpenAPIApplyYamlServiceReq ¶
type OpenAPIApplyYamlServiceReq struct { EnvName string `json:"env_key"` ServiceList []*YamlServiceWithKV `json:"service_list"` }
func (*OpenAPIApplyYamlServiceReq) Validate ¶
func (req *OpenAPIApplyYamlServiceReq) Validate() error
type OpenAPICreateEnvArgs ¶
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 ¶
func (env *OpenAPICreateEnvArgs) Validate() error
type OpenAPICreateServiceArgs ¶
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 ¶
type OpenAPIDeleteYamlServiceFromEnvReq struct { EnvName string `json:"env_key"` ServiceNames []string `json:"service_names"` }
func (*OpenAPIDeleteYamlServiceFromEnvReq) Validate ¶
func (req *OpenAPIDeleteYamlServiceFromEnvReq) Validate() error
type OpenAPIEnvCfgArgs ¶
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 ¶
func (req *OpenAPIEnvCfgArgs) Validate() error
type OpenAPIEnvCfgBrief ¶
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 ¶
func OpenAPIListCommonEnvCfg(projectName, envName string, cfgType string, production bool, logger *zap.SugaredLogger) ([]*OpenAPIEnvCfgBrief, error)
type OpenAPIEnvCfgConfigMapDetail ¶
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 ¶
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 ¶
func OpenAPIGetCommonEnvCfg(projectName, envName, cfgType, name string, production bool, logger *zap.SugaredLogger) (*OpenAPIEnvCfgDetail, error)
type OpenAPIEnvCfgIngressDetail ¶
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 ¶
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 ¶
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 ¶
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 ¶
func GetEnvDetail(projectName, envName string, production bool, logger *zap.SugaredLogger) (*OpenAPIEnvDetail, error)
type OpenAPIEnvGlobalVariables ¶
type OpenAPIEnvGlobalVariables struct {
GlobalVariables []*commontypes.GlobalVariableKV `json:"global_variables"`
}
type OpenAPIEnvServiceDetail ¶
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 ¶
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 ¶
func OpenAPIListEnvs(userID, projectName string, envNames []string, production bool, log *zap.SugaredLogger) ([]*OpenAPIListEnvBrief, error)
func OpenAPIListProductionEnvs ¶
func OpenAPIListProductionEnvs(userId string, projectName string, envNames []string, log *zap.SugaredLogger) ([]*OpenAPIListEnvBrief, error)
type OpenAPIScaleServiceReq ¶
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 ¶
func (req *OpenAPIScaleServiceReq) Validate() error
type OpenAPIServiceDetail ¶
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 ¶
type OpenAPIServiceVariablesReq struct {
ServiceList []*ServiceVariable `json:"service_list"`
}
type PMProductCreator ¶
type PMProductCreator struct { }
func (*PMProductCreator) Create ¶
func (creator *PMProductCreator) Create(user, requestID string, args *ProductCreateArg, log *zap.SugaredLogger) error
type PreviewServiceArgs ¶
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 ¶
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 ¶
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 // New Since v2.1.0 RelatedEnvs []*SharedNSEnvs `json:"related_envs"` IstioGrayscaleEnable bool `json:"istio_grayscale_enable"` IstioGrayscaleIsBase bool `json:"istio_grayscale_is_base"` IstioGrayscaleBaseEnv string `json:"istio_grayscale_base_env"` YamlData *templatemodels.CustomYaml `json:"yaml_data,omitempty"` // used for cron service }
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 ¶
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 ¶
type RawYamlResp struct {
YamlContent string `json:"yamlContent"`
}
type ReleaseFilter ¶
type ReleaseFilter struct { Name string `json:"name"` Status ReleaseStatus `json:"status"` }
type ReleaseStatus ¶
type ReleaseStatus string
const ( HelmReleaseStatusPending ReleaseStatus = "pending" HelmReleaseStatusDeployed ReleaseStatus = "deployed" HelmReleaseStatusFailed ReleaseStatus = "failed" HelmReleaseStatusNotDeployed ReleaseStatus = "notDeployed" )
type ResourceCommon ¶
type ResourceCommon struct { Name string `json:"name"` Type string `json:"type"` Images []*WorkloadImage `json:"images,omitempty"` CreationTime string `json:"creation_time"` }
func (*ResourceCommon) GetCreationTime ¶
func (rc *ResourceCommon) GetCreationTime() string
type ResourceConfigMap ¶
type ResourceConfigMap struct {
*ResourceCommon
}
type ResourceDeployStatus ¶
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 ¶
type ResourceIngress struct { *ResourceCommon Class string `json:"class"` Hosts string `json:"hosts"` Address string `json:"address"` Ports string `json:"ports"` }
type ResourcePVC ¶
type ResourceResponseBase ¶
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 ¶
type ResourceSecret struct { *ResourceCommon SecretType string `json:"secret_type"` }
type ResourceService ¶
type ResourceService struct { *ResourceCommon ServiceType string `json:"service_type"` ClusterIP string `json:"cluster_ip"` Ports string `json:"ports"` }
type ResourceWithLabel ¶
type ResourceWithLabel interface { GetLabels() map[string]string SetLabels(labels map[string]string) SetNamespace(ns string) }
func GetResourceByCfgType ¶
func GetResourceByCfgType(namespace, name string, cfgType config.CommonEnvCfgType, client client.Client, clientset *kubernetes.Clientset) (ResourceWithLabel, error)
type RestartScaleArgs ¶
type RollBackConfigMapArgs ¶
type ServiceDeployStatus ¶
type ServiceDeployStatus struct { ServiceName string `json:"service_name"` Resources []*ResourceDeployStatus `json:"resources"` }
func GetReleaseDeployStatus ¶
func GetReleaseDeployStatus(productName string, production bool, request *HelmDeployStatusCheckRequest) ([]*ServiceDeployStatus, error)
func GetResourceDeployStatus ¶
func GetResourceDeployStatus(productName string, request *K8sDeployStatusCheckRequest, production bool, log *zap.SugaredLogger) ([]*ServiceDeployStatus, error)
type ServiceImages ¶
type ServiceMatchedDeploymentContainers ¶
type ServiceMatchedDeploymentContainers struct { ServiceName string `json:"service_name"` Deployment struct { DeploymentName string `json:"deployments_name"` ContainerNames []string `json:"container_names"` } `json:"deployment"` }
func ListCanaryDeploymentServiceInfo ¶
func ListCanaryDeploymentServiceInfo(clusterID, namespace string, log *zap.SugaredLogger) ([]*ServiceMatchedDeploymentContainers, error)
list serivce and matched deployment containers for canary and blue-green deployment.
type ServiceVariable ¶
type ServiceVariable struct { ServiceName string `json:"service_name"` Variables []*commontypes.RenderVariableKV `json:"variable_kvs"` }
type ShareEnvReady ¶
type ShareEnvReady struct {}
func CheckShareEnvReady ¶
func CheckShareEnvReady(ctx context.Context, envName, op, productName string) (*ShareEnvReady, error)
func (*ShareEnvReady) CheckAndSetReady ¶
func (s *ShareEnvReady) CheckAndSetReady(state ShareEnvOp)
Note: `WorkloadsHaveK8sService` is an optional condition.
type ShareEnvReadyChecks ¶
type ShareEnvReadyChecks struct {}
type SharedNSEnvs ¶
type SharedNSEnvs struct {}
func FindNsUseEnvs ¶
func FindNsUseEnvs(productInfo *commonmodels.Product, log *zap.SugaredLogger) ([]*SharedNSEnvs, error)
type SortableByCreationTime ¶
type SortableByCreationTime interface {
GetCreationTime() string
}
type SvcDataSet ¶
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 ¶
func BatchPreviewService(args []*PreviewServiceArgs, logger *zap.SugaredLogger) ([]*SvcDiffResult, error)
func GetServiceDiff ¶
func GetServiceDiff(envName, productName, serviceName string, production bool, log *zap.SugaredLogger) (*SvcDiffResult, error)
GetServiceDiff 获得服务模板当前版本和最新版本的对比
func PreviewHelmProductGlobalVariables ¶
func PreviewHelmProductGlobalVariables(productName, envName, globalVariable string, proudction bool, log *zap.SugaredLogger) ([]*SvcDiffResult, error)
func PreviewProductGlobalVariables ¶
func PreviewProductGlobalVariables(productName, envName string, arg []*commontypes.GlobalVariableKV, production bool, log *zap.SugaredLogger) ([]*SvcDiffResult, error)
func PreviewProductGlobalVariablesWithRender ¶
func PreviewProductGlobalVariablesWithRender(product *commonmodels.Product, args []*commontypes.GlobalVariableKV, log *zap.SugaredLogger) ([]*SvcDiffResult, error)
func PreviewService ¶
func PreviewService(args *PreviewServiceArgs, _ *zap.SugaredLogger) (*SvcDiffResult, error)
type SvcOptArgs ¶
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 ¶
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 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"` Production bool `json:"production"` }
type UpdateEnv ¶
type UpdateEnv struct { EnvName string `json:"env_name"` Services []*UpdateServiceArg `json:"services"` }
type UpdateEnvRequest ¶
type UpdateIngressArgs ¶
type UpdateMultiHelmProductArg ¶
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 ¶
type UpdateServiceArg ¶
type UpdateServiceArg struct { ServiceName string `json:"service_name"` DeployStrategy string `json:"deploy_strategy"` VariableKVs []*commontypes.RenderVariableKV `json:"variable_kvs"` }
type WorkloadCommonData ¶
type WorkloadCommonData struct { Name string WorkloadDetail *resource.Workload Services []*resource.Service Ingresses []*resource.Ingress }
func GetDeployWorkloadData ¶
func GetDeployWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)
func GetDsWorkloadData ¶
func GetDsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)
func GetJobData ¶
func GetJobData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)
func GetStsWorkloadData ¶
func GetStsWorkloadData(ns, name string, kc client.Client, cs *kubernetes.Clientset, log *zap.SugaredLogger) (*WorkloadCommonData, error)
type WorkloadCronJob ¶
type WorkloadDaemonSet ¶
type WorkloadDeploySts ¶
type WorkloadDeploySts struct { *ResourceCommon Ready string `json:"ready"` }
type WorkloadDetailResp ¶
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 ¶
func GetWorkloadDetail(args *FetchResourceArgs, workloadType, workloadName string, log *zap.SugaredLogger) (*WorkloadDetailResp, error)
type WorkloadImage ¶
type WorkloadImageTarget ¶
type WorkloadImageTarget struct { Target string `json:"target"` ImageName string `json:"image_name"` }
func ListCustomWorkload ¶
func ListCustomWorkload(clusterID, namespace string, log *zap.SugaredLogger) ([]*WorkloadImageTarget, error)
type WorkloadInfo ¶
type WorkloadInfo struct { WorkloadType string `json:"workload_type"` WorkloadName string `json:"workload_name"` ContainerName string `json:"container_name"` }
func ListWorkloadsInfo ¶
func ListWorkloadsInfo(clusterID, namespace string, log *zap.SugaredLogger) ([]*WorkloadInfo, error)
for now,only support deployment
type WorkloadItem ¶
type WorkloadJob ¶
type WorkloadJob struct { *ResourceCommon Completions string `json:"completions"` Duration string `json:"duration"` Age string `json:"age"` }
type YamlContentRequestArg ¶
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 ¶
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 ¶
type YamlServiceWithKV struct { ServiceName string `json:"service_name"` VariableKvs []*commontypes.RenderVariableKV `json:"variable_kvs"` }
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
- istio_grayscale.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
- version.go