Documentation ¶
Index ¶
- Constants
- Variables
- func BulkCopyHelmProduct(projectName, user, requestID string, arg CopyHelmProductArg, ...) error
- func BulkCopyYamlProduct(projectName, user, requestID string, arg CopyYamlProductArg, ...) 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 []*CreateHelmProductArg, ...) error
- func CreateCommonEnvCfg(args *CreateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
- func CreateHelmProduct(productName, userName, requestID string, args []*CreateHelmProductArg, ...) error
- func CreateProduct(user, requestID string, args *commonmodels.Product, log *zap.SugaredLogger) (err 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, log *zap.SugaredLogger) (err error)
- func DeleteProductServices(userName, requestID, envName, productName string, serviceNames []string, ...) (err error)
- func DisableBaseEnv(ctx context.Context, envName, productName 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 EnsureUpdateZadigService(ctx context.Context, env *commonmodels.Product, svcName string, ...) error
- func ExportYaml(envName, productName, serviceName string, log *zap.SugaredLogger) []string
- func FillProductVars(products []*commonmodels.Product, log *zap.SugaredLogger) error
- func FindHelmRenderSet(productName, renderName string, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
- func GeneEstimatedValues(productName, envName, serviceName, scene, format string, ...) (interface{}, error)
- func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)
- func GetEnvServiceList(ctx context.Context, productName, baseEnvName string) ([][]string, error)
- func GetEstimatedRenderCharts(productName, envName, serviceNameListStr string, log *zap.SugaredLogger) ([]*commonservice.RenderChartArg, error)
- func GetHelmChartVersions(productName, envName string, log *zap.SugaredLogger) ([]*commonmodels.HelmVersions, error)
- func GetIngressInfo(product *commonmodels.Product, service *commonmodels.Service, ...) *commonservice.IngressInfo
- func GetInitProduct(productTmplName string, envType types.EnvType, isBaseEnv bool, ...) (*commonmodels.Product, error)
- func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)
- func GetProductAndFilterNs(namespace, workloadName, svcName string) (*models.Product, bool)
- func GetProductInfo(username, envName, productName string, log *zap.SugaredLogger) (*commonmodels.Product, error)
- func GetServiceContainer(envName, productName, serviceName, container string, log *zap.SugaredLogger) error
- func InstallService(helmClient helmclient.Client, param *ReleaseInstallParam) error
- func ListAvailableNamespaces(clusterID, listType string, log *zap.SugaredLogger) ([]*resource.Namespace, error)
- func ListGroups(serviceName, envName, productName string, perPage, page int, ...) ([]*commonservice.ServiceResp, int, error)
- func ListKubeEvents(env string, productName string, name string, rtype string, ...) ([]*resource.Event, error)
- func ListPodEvents(envName, productName, podName string, log *zap.SugaredLogger) ([]*resource.Event, error)
- func ListServicePods(productName, envName string, serviceName string, log *zap.SugaredLogger) ([]*resource.Pod, error)
- func MigrateHistoryConfigMaps(envName, productName string, log *zap.SugaredLogger) ([]*models.EnvConfigMap, error)
- func NewClusterInformerFactory(clusterID string, cls *kubernetes.Clientset) (informers.SharedInformerFactory, error)
- func ReInstallServiceInEnv(productInfo *commonmodels.Product, 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 ScaleService(envName, productName, serviceName string, number int, log *zap.SugaredLogger) (err error)
- func StartClusterInformer()
- func SyncHelmProductEnvironment(productName, envName, requestID string, log *zap.SugaredLogger) error
- func SyncYamlFromSource(yamlData *templatemodels.CustomYaml, curValue string) (bool, string, error)
- func UninstallService(helmClient helmclient.Client, productName, namespace, envName string, ...) error
- func UninstallServiceByName(helmClient helmclient.Client, ...) error
- func UpdateCommonEnvCfg(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
- func UpdateConfigMap(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
- func UpdateContainerImage(requestID string, args *UpdateContainerImageArgs, log *zap.SugaredLogger) error
- func UpdateHelmProduct(productName, envName, username, requestID string, ...) error
- func UpdateHelmProductRenderset(productName, envName, userName, requestID string, args *EnvRendersetArg, ...) error
- func UpdateHelmProductVariable(productName, envName, username, requestID string, ...) error
- func UpdateOrCreateIngress(args *UpdateCommonEnvCfgArgs, userName, userID string, isCreate bool, ...) error
- func UpdateProduct(serviceNames []string, existedProd, updateProd *commonmodels.Product, ...) (err error)
- func UpdateProductRecycleDay(envName, productName string, recycleDay int) error
- func UpdateProductRegistry(envName, productName, registryID string, log *zap.SugaredLogger) (err error)
- func UpdateProductV2(envName, productName, user, requestID string, serviceNames []string, ...) (err error)
- func UpdatePvc(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
- func UpdateSecret(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
- func UpdateService(args *SvcOptArgs, log *zap.SugaredLogger) error
- func UpdateSvcInAllEnvs(productName, serviceName string, templateSvc *commonmodels.Service) error
- 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 ChartImagesResp
- type ChartInfo
- type ConfigDiffResult
- type ConfigTmplData
- type ContainerNotFound
- type CopyHelmProductArg
- type CopyYamlProductArg
- type CreateCommonEnvCfgArgs
- type CreateHelmProductArg
- type CreateProductParam
- type DefaultProductCreator
- type DefaultValuesResp
- type EnvRenderChartArg
- type EnvRendersetArg
- type EnvResp
- type EnvStatus
- func AutoCreateProduct(productName, envType, requestID string, log *zap.SugaredLogger) []*EnvStatus
- func AutoUpdateProduct(args []*UpdateEnv, envNames []string, productName, requestID string, ...) ([]*EnvStatus, error)
- func UpdateMultipleHelmEnv(requestID, userName string, args *UpdateMultiHelmProductArg, ...) ([]*EnvStatus, error)
- type EnvoyAddress
- type EnvoyClusterConfigLoadAssignment
- type EnvoyEndpoint
- type EnvoyEndpoints
- type EnvoyLBEndpoints
- type EnvoySocketAddress
- type EstimateValuesArg
- type ExternalProductCreator
- type HelmChartsResp
- type HelmProductCreator
- type HelmProductItem
- type HelmReleaseResp
- type IProductCreator
- type ImageData
- type K8sService
- type ListCommonEnvCfgHistoryArgs
- type ListCommonEnvCfgHistoryRes
- type ListConfigMapArgs
- type ListConfigMapRes
- type ListIngressesResponse
- type ListPvcsResponse
- type ListSecretsResponse
- type MatchedEnv
- type MigrateHistoryConfigMapsRes
- type NodeResp
- type PMProductCreator
- type PMService
- type ProductIngressInfo
- type ProductParams
- type ProductResp
- type ProductRevision
- func GetProductRevision(product *commonmodels.Product, allServiceTmpls []*commonmodels.Service, ...) (*ProductRevision, error)
- func ListProductsRevision(productName, envName string, log *zap.SugaredLogger) (prodRevs []*ProductRevision, err error)
- func ListProductsRevisionByOption(basicFacility string, deployType string, log *zap.SugaredLogger) ([]*ProductRevision, error)
- type RawYamlResp
- type ReleaseInstallParam
- type RestartScaleArgs
- type RollBackConfigMapArgs
- type ScaleArgs
- type ServiceImages
- type ShareEnvOp
- type ShareEnvReady
- type ShareEnvReadyChecks
- type SvcDiffResult
- type SvcOptArgs
- type SvcResp
- type SvcRevision
- type TmplConfig
- type TmplYaml
- type UpdateCommonEnvCfgArgs
- type UpdateConfigMapArgs
- type UpdateContainerImageArgs
- type UpdateEnv
- type UpdateIngressArgs
- type UpdateMultiHelmProductArg
- type UpdatePvcArgs
- type YamlContentRequestArg
- type YamlProductItem
Constants ¶
const (
Timeout = 60
)
Variables ¶
var ClusterInformersMap sync.Map
var ClusterStopChanMap sync.Map
var DefaultCleanWhiteList = []string{"spockadmin"}
Functions ¶
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 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 []*CreateHelmProductArg, log *zap.SugaredLogger) error
func CreateCommonEnvCfg ¶ added in v1.9.9
func CreateCommonEnvCfg(args *CreateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
func CreateHelmProduct ¶ added in v1.5.0
func CreateHelmProduct(productName, userName, requestID string, args []*CreateHelmProductArg, log *zap.SugaredLogger) error
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 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, log *zap.SugaredLogger) (err error)
func DeleteProductServices ¶ added in v1.9.9
func DeleteProductServices(userName, requestID, envName, productName string, serviceNames []string, log *zap.SugaredLogger) (err error)
func DisableBaseEnv ¶ 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 EnsureUpdateZadigService ¶ added in v1.9.9
func EnsureUpdateZadigService(ctx context.Context, env *commonmodels.Product, svcName string, kclient client.Client, istioClient versionedclient.Interface) error
func ExportYaml ¶
func ExportYaml(envName, productName, serviceName string, log *zap.SugaredLogger) []string
ExportYaml 查询使用到服务模板的服务组模板
func FillProductVars ¶
func FillProductVars(products []*commonmodels.Product, log *zap.SugaredLogger) error
func FindHelmRenderSet ¶ added in v1.2.0
func FindHelmRenderSet(productName, renderName string, log *zap.SugaredLogger) (*commonmodels.RenderSet, error)
func GeneEstimatedValues ¶ added in v1.6.0
func GeneEstimatedValues(productName, envName, serviceName, scene, format string, arg *EstimateValuesArg, log *zap.SugaredLogger) (interface{}, error)
func GetBundleResources ¶ added in v1.7.1
func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)
func GetEnvServiceList ¶ added in v1.9.9
func GetEstimatedRenderCharts ¶ added in v1.5.0
func GetEstimatedRenderCharts(productName, envName, serviceNameListStr string, log *zap.SugaredLogger) ([]*commonservice.RenderChartArg, error)
func GetHelmChartVersions ¶ added in v1.2.0
func GetHelmChartVersions(productName, envName string, log *zap.SugaredLogger) ([]*commonmodels.HelmVersions, error)
func GetIngressInfo ¶
func GetIngressInfo(product *commonmodels.Product, service *commonmodels.Service, log *zap.SugaredLogger) *commonservice.IngressInfo
func GetInitProduct ¶
func GetInitProduct(productTmplName string, envType types.EnvType, isBaseEnv bool, baseEnvName string, log *zap.SugaredLogger) (*commonmodels.Product, error)
func GetMergedYamlContent ¶ added in v1.6.0
func GetMergedYamlContent(arg *YamlContentRequestArg, paths []string) (string, error)
func GetProductAndFilterNs ¶ 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 InstallService ¶ added in v1.9.9
func InstallService(helmClient helmclient.Client, param *ReleaseInstallParam) error
func ListAvailableNamespaces ¶
func ListAvailableNamespaces(clusterID, listType string, log *zap.SugaredLogger) ([]*resource.Namespace, error)
ListAvailableNamespaces lists available namespaces created by non-koderover
func ListGroups ¶
func ListGroups(serviceName, envName, productName string, perPage, page int, log *zap.SugaredLogger) ([]*commonservice.ServiceResp, int, error)
func ListKubeEvents ¶
func ListPodEvents ¶
func ListServicePods ¶
func MigrateHistoryConfigMaps ¶ added in v1.9.9
func MigrateHistoryConfigMaps(envName, productName string, log *zap.SugaredLogger) ([]*models.EnvConfigMap, error)
func NewClusterInformerFactory ¶ added in v1.9.9
func NewClusterInformerFactory(clusterID string, cls *kubernetes.Clientset) (informers.SharedInformerFactory, error)
func ReInstallServiceInEnv ¶ added in v1.11.0
func ReInstallServiceInEnv(productInfo *commonmodels.Product, serviceName string, templateSvc *commonmodels.Service) error
ReInstallServiceInEnv uninstall the service and reinstall to update releaseNaming rule
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 ScaleService ¶
func ScaleService(envName, productName, serviceName string, number int, log *zap.SugaredLogger) (err error)
ScaleService 增加或者缩减服务的deployment或者stafefulset的副本数量
func StartClusterInformer ¶ added in v1.9.9
func StartClusterInformer()
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 currently only support gitHub and gitlab
func UninstallService ¶ added in v1.11.0
func UninstallService(helmClient helmclient.Client, productName, namespace, envName string, revisionSvc *commonmodels.Service, force bool) error
func UninstallServiceByName ¶ added in v1.11.0
func UpdateCommonEnvCfg ¶ added in v1.9.9
func UpdateCommonEnvCfg(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
func UpdateConfigMap ¶
func UpdateConfigMap(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
func UpdateContainerImage ¶
func UpdateContainerImage(requestID string, args *UpdateContainerImageArgs, log *zap.SugaredLogger) error
func UpdateHelmProduct ¶ added in v1.2.0
func UpdateHelmProduct(productName, envName, username, requestID string, overrideCharts []*commonservice.RenderChartArg, deletedServices []string, 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 UpdateHelmProductVariable ¶ added in v1.2.0
func UpdateHelmProductVariable(productName, envName, username, requestID string, updatedRcs []*templatemodels.RenderChart, renderset *commonmodels.RenderSet, log *zap.SugaredLogger) error
func UpdateOrCreateIngress ¶ added in v1.9.9
func UpdateOrCreateIngress(args *UpdateCommonEnvCfgArgs, userName, userID string, isCreate bool, log *zap.SugaredLogger) error
func UpdateProduct ¶
func UpdateProduct(serviceNames []string, existedProd, updateProd *commonmodels.Product, renderSet *commonmodels.RenderSet, log *zap.SugaredLogger) (err 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 UpdateProductV2 ¶
func UpdateProductV2(envName, productName, user, requestID string, serviceNames []string, force bool, kvs []*templatemodels.RenderKV, log *zap.SugaredLogger) (err error)
func UpdatePvc ¶ added in v1.9.9
func UpdatePvc(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
func UpdateSecret ¶ added in v1.9.9
func UpdateSecret(args *UpdateCommonEnvCfgArgs, userName, userID string, log *zap.SugaredLogger) error
func UpdateService ¶
func UpdateService(args *SvcOptArgs, log *zap.SugaredLogger) error
func UpdateSvcInAllEnvs ¶ added in v1.11.0
func UpdateSvcInAllEnvs(productName, serviceName string, templateSvc *commonmodels.Service) error
UpdateSvcInAllEnvs updates svc in all envs in which the svc is already installed
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 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 ConfigDiffResult ¶
type ConfigDiffResult struct { Current TmplConfig `json:"current,omitempty"` Latest TmplConfig `json:"latest,omitempty"` }
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 CreateCommonEnvCfgArgs ¶ added in v1.11.0
type CreateCommonEnvCfgArgs struct { EnvName string `json:"env_name"` ProductName string `json:"product_name"` YamlData string `json:"yaml_data"` CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"` }
type CreateHelmProductArg ¶ added in v1.5.0
type CreateHelmProductArg struct { ProductName string `json:"productName"` EnvName string `json:"envName"` Namespace string `json:"namespace"` ClusterID string `json:"clusterID"` DefaultValues string `json:"defaultValues"` ValuesData *commonservice.ValuesDataArgs `json:"valuesData"` RegistryID string `json:"registry_id"` ChartValues []*commonservice.RenderChartArg `json:"chartValues"` BaseEnvName string `json:"baseEnvName"` BaseName string `json:"base_name,omitempty"` IsExisted bool `json:"is_existed"` EnvConfigYamls []string `json:"env_config_yamls,omitempty"` }
type CreateProductParam ¶ added in v1.5.0
type DefaultProductCreator ¶ added in v1.5.0
type DefaultProductCreator struct { }
func (*DefaultProductCreator) Create ¶ added in v1.5.0
func (creator *DefaultProductCreator) Create(user, requestID string, args *models.Product, log *zap.SugaredLogger) error
type DefaultValuesResp ¶ added in v1.6.0
type DefaultValuesResp struct { DefaultValues string `json:"defaultValues"` 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 EnvRenderChartArg ¶ added in v1.5.0
type EnvRenderChartArg struct {
ChartValues []*commonservice.RenderChartArg `json:"chartValues"`
}
type EnvRendersetArg ¶ added in v1.6.0
type EnvRendersetArg struct { DefaultValues string `json:"defaultValues"` ValuesData *commonservice.ValuesDataArgs `json:"valuesData"` ChartValues []*commonservice.RenderChartArg `json:"chartValues"` }
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"` 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"` // New Since v1.11.0 }
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 AutoUpdateProduct ¶
func UpdateMultipleHelmEnv ¶ added in v1.5.0
func UpdateMultipleHelmEnv(requestID, userName string, args *UpdateMultiHelmProductArg, log *zap.SugaredLogger) ([]*EnvStatus, error)
type EnvoyAddress ¶ added in v1.9.9
type EnvoyAddress struct {
SocketAddress EnvoySocketAddress `json:"socket_address"`
}
type EnvoyClusterConfigLoadAssignment ¶ added in v1.9.9
type EnvoyClusterConfigLoadAssignment struct { ClusterName string `json:"cluster_name"` Endpoints []EnvoyLBEndpoints `json:"endpoints"` }
type EnvoyEndpoint ¶ added in v1.9.9
type EnvoyEndpoint struct {
Address EnvoyAddress `json:"address"`
}
type EnvoyEndpoints ¶ added in v1.9.9
type EnvoyEndpoints struct {
Endpoint EnvoyEndpoint `json:"endpoint"`
}
type EnvoyLBEndpoints ¶ added in v1.9.9
type EnvoyLBEndpoints struct {
LBEndpoints []EnvoyEndpoints `json:"lb_endpoints"`
}
type EnvoySocketAddress ¶ added in v1.9.9
type EstimateValuesArg ¶ added in v1.6.0
type EstimateValuesArg struct { DefaultValues string `json:"defaultValues"` OverrideYaml string `json:"overrideYaml"` OverrideValues []*commonservice.KVPair `json:"overrideValues,omitempty"` }
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 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 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.RenderChartArg `json:"chart_values"` }
type HelmReleaseResp ¶ added in v1.8.0
type HelmReleaseResp struct { ReleaseName string `json:"releaseName"` ServiceName string `json:"serviceName"` Revision int `json:"revision"` Chart string `json:"chart"` AppVersion string `json:"appVersion"` }
func ListReleases ¶ added in v1.8.0
func ListReleases(productName, envName string, log *zap.SugaredLogger) ([]*HelmReleaseResp, error)
type IProductCreator ¶ added in v1.5.0
type K8sService ¶
type K8sService struct {
// contains filtered or unexported fields
}
type ListCommonEnvCfgHistoryArgs ¶ added in v1.9.9
type ListCommonEnvCfgHistoryArgs struct { EnvName string `json:"envName"` ProductName string `json:"productName"` Name string CommonEnvCfgType config.CommonEnvCfgType `json:"commonEnvCfgType"` }
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"` YamlData string `json:"yaml_data"` }
func ListCommonEnvCfgHistory ¶ added in v1.11.0
func ListCommonEnvCfgHistory(args *ListCommonEnvCfgHistoryArgs, log *zap.SugaredLogger) ([]*ListCommonEnvCfgHistoryRes, error)
type ListConfigMapArgs ¶
type ListConfigMapRes ¶ added in v1.9.9
type ListConfigMapRes struct { CmName string `json:"cm_name"` Immutable bool `json:"immutable"` CmData map[string]string `json:"cm_data"` YamlData string `json:"yaml_data"` UpdateUserName string `json:"update_username"` CreateTime time.Time `json:"create_time"` Services []string `json:"services"` }
func ListConfigMaps ¶
func ListConfigMaps(args *ListConfigMapArgs, log *zap.SugaredLogger) ([]*ListConfigMapRes, error)
type ListIngressesResponse ¶ added in v1.9.9
type ListIngressesResponse struct { IngressName string `json:"ingress_name"` HostInfo string `json:"host_info"` Address string `json:"address"` Ports string `json:"ports"` ErrorReason string `json:"error_reason"` YamlData string `json:"yaml_data"` UpdateUserName string `json:"update_username"` CreateTime time.Time `json:"create_time"` }
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 { 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"` YamlData string `json:"yaml_data"` UpdateUserName string `json:"update_username"` CreateTime time.Time `json:"create_time"` Services []string `json:"services"` }
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 { SecretName string `json:"secret_name"` SecretType string `json:"secret_type"` YamlData string `json:"yaml_data"` UpdateUserName string `json:"update_username"` CreateTime time.Time `json:"create_time"` Services []string `json:"services"` }
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 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 ProductIngressInfo ¶
type ProductIngressInfo struct { IngressInfos []*commonservice.IngressInfo `json:"ingress_infos"` EnvName string `json:"env_name"` }
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 [][]string `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)
func ListProductsRevision ¶
func ListProductsRevision(productName, envName string, log *zap.SugaredLogger) (prodRevs []*ProductRevision, err error)
func ListProductsRevisionByOption ¶ added in v1.11.0
func ListProductsRevisionByOption(basicFacility string, deployType string, log *zap.SugaredLogger) ([]*ProductRevision, error)
ListProductsRevisionByOption called by service cron
func (*ProductRevision) GroupsUpdated ¶
func (pr *ProductRevision) GroupsUpdated() bool
type RawYamlResp ¶ added in v1.6.0
type RawYamlResp struct {
YamlContent string `json:"yamlContent"`
}
type ReleaseInstallParam ¶ added in v1.11.0
type ReleaseInstallParam struct { ProductName string Namespace string ReleaseName string MergedValues string RenderChart *templatemodels.RenderChart // contains filtered or unexported fields }
type RestartScaleArgs ¶
type RollBackConfigMapArgs ¶
type ServiceImages ¶ added in v1.9.9
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 SvcDiffResult ¶
type SvcDiffResult struct { Current TmplYaml `json:"current,omitempty"` Latest TmplYaml `json:"latest,omitempty"` }
func GetServiceDiff ¶ added in v1.3.0
func GetServiceDiff(envName, productName, serviceName string, log *zap.SugaredLogger) (*SvcDiffResult, error)
GetServiceDiff 获得服务模板当前版本和最新版本的对比
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"` EnvName string `json:"env_name"` ProductName string `json:"product_name"` GroupName string `json:"group_name"` }
SvcResp struct 产品-服务详情页面Response
func GetService ¶
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"` Deleted bool `json:"deleted"` New bool `json:"new"` Containers []*commonmodels.Container `json:"containers,omitempty"` }
type TmplConfig ¶
type TmplConfig struct {
Data []ConfigTmplData `json:"data,omitempty"`
}
type UpdateCommonEnvCfgArgs ¶ added in v1.11.0
type UpdateCommonEnvCfgArgs struct { EnvName string `json:"env_name"` ProductName string `json:"product_name"` ServiceName string `json:"service_name"` Name string `json:"name"` YamlData string `json:"yaml_data"` RestartAssociatedSvc bool `json:"restart_associated_svc"` CommonEnvCfgType config.CommonEnvCfgType `json:"common_env_cfg_type"` Services []string `json:"services"` }
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 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.RenderChartArg `json:"chartValues"` DeletedServices []string `json:"deletedServices"` ReplacePolicy string `json:"replacePolicy"` // TODO logic not implemented }
type UpdatePvcArgs ¶ added in v1.9.9
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"` 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"` Vars []*templatemodels.RenderKV `json:"vars"` }
Source Files ¶
- bundle.go
- common_env_cfg.go
- common_env_cfg_informer.go
- configmap.go
- diff.go
- env.go
- environment.go
- environment_creator.go
- environment_group.go
- environment_update.go
- export.go
- helm.go
- image.go
- ingress.go
- k8s.go
- kube.go
- pm.go
- pm_exec.go
- product.go
- pvc.go
- renderset.go
- revision.go
- secret.go
- service.go
- share_env.go
- share_env_utils.go
- types.go