application

package
v1.24.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 88 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// labels
	LabelTenant      = gems.LabelTenant
	LabelProject     = gems.LabelProject
	LabelApplication = gems.LabelApplication
	LabelEnvironment = gems.LabelEnvironment

	// application label
	LabelKeyFrom           = application.LabelFrom // 区分是从 appstore 还是从应用 app 部署的argo
	LabelValueFromApp      = application.LabelValueFromApp
	LabelValueFromAppStore = application.LabelValueFromAppStore

	// annotations
	AnnotationKeyCreator = application.AnnotationCreator   // 创建人,仅用于当前部署实时更新,从kustomize部署的历史需要从gitcommit取得
	AnnotationRef        = application.AnnotationRef       // 标志这个资源所属的项目环境,避免使用过多label造成干扰
	AnnotationCluster    = application.AnnotationCluster   // 标志这个资源所属集群
	AnnotationNamespace  = application.AnnotationNamespace // 标志这个资源所属namespace
)
View Source
const (
	TaskFunction_Application_UpdateImages              = "application_update_images"
	TaskFunction_Application_Sync                      = "application_sync"
	TaskFunction_Application_BatchUpdateImages         = "application_batch_update_images"
	TaskFunction_Application_PrepareDeploymentStrategy = "application_preparedeploymentstrategy"
	TaskFunction_Application_WaitRollouts              = "application_wait_rollouts"
	TaskFunction_Application_Undo                      = "application_undo"
)
View Source
const (
	AnnotationGeneratedByPlatformKey           = application.AnnotationGeneratedByPlatformKey           // 表示该资源是为了{for}自动生成的,需要在特定的时刻被清理
	AnnotationGeneratedByPlatformValueRollouts = application.AnnotationGeneratedByPlatformValueRollouts // 表示该资源是为了rollouts而生成的
)
View Source
const (
	AnalysisArgServiceName = "service-name"
	AnalysisArgNamespace   = "namespace"
)
View Source
const (
	ReadmeFilename = "readme.md"
	MetaFilename   = ".meta"
)
View Source
const BaseEnv = "base"
View Source
const LabelIstioVersion = "version"
View Source
const StatusNoArgoApp = "NoArgoApp"
View Source
const (
	TaskAddtionalKeyCommiter = "committer"
)
View Source
const TaskGroupApplication = "application"

Variables

View Source
var ErrNotManagedRegistry = errors.New("unsupported image")
View Source
var ForFileContentFunc = git.ForFileContentFunc
View Source
var KustimizationFilename = konfig.DefaultKustomizationFileName()
View Source
var ResourceWhileList = []schema.GroupVersionKind{
	{Group: corev1.GroupName},
	{Group: appsv1.GroupName},
	{Group: batchv1.GroupName},
	{Group: extensionsv1beta1.GroupName},
	{Group: networkingv1.GroupName},
	{Group: storagev1.GroupName, Kind: "PersistentVolumeClaim"},
	{Group: rollouts.Group},
}

ResourceWhileList 允许编排的资源类型

Functions

func AuthorFromContext

func AuthorFromContext(ctx context.Context) *object.Signature

func CleanRollout

func CleanRollout(ctx context.Context, cli GitStore) error

取消灰度

func ClusterNamespaceFromCtx

func ClusterNamespaceFromCtx(ctx context.Context) (string, string)

func DecodeArgoClusterName

func DecodeArgoClusterName(full string) string

func DecodeManifest

func DecodeManifest(ctx context.Context, fs billy.Filesystem, manifest *Manifest, options ManifestListOptions) error

从应用编排根目录获取编排详情

func DecodeResource

func DecodeResource(content []byte) (client.Object, error)

func ForManifestFsFunc

func ForManifestFsFunc(fs billy.Filesystem, fun func(string, billy.Filesystem))

func GenArgoClusterName

func GenArgoClusterName(cluster string) string

func GenArgoPrjNameFromRef

func GenArgoPrjNameFromRef(ref PathRef) string

func GetCurrentCanaryStep

func GetCurrentCanaryStep(rollout *rolloutsv1alpha1.Rollout) (*rolloutsv1alpha1.CanaryStep, *int32)

GetCurrentCanaryStep returns the current canary step. If there are no steps or the rollout has already executed the last step, the func returns nil

func InitOrUpdateKustomization

func InitOrUpdateKustomization(fs billy.Filesystem) error

func IsPermmitedResource

func IsPermmitedResource(obj runtime.Object) bool

func ObjectPodTemplateFunc

func ObjectPodTemplateFunc(obj client.Object, fun func(template *corev1.PodTemplateSpec))

func ParseImagesFrom

func ParseImagesFrom(obj client.Object) []string

func ParseMainDeployment

func ParseMainDeployment(ctx context.Context, store GitStore) (*appsv1.Deployment, error)

func ParseMainStatefulSet

func ParseMainStatefulSet(ctx context.Context, store GitStore) (*appsv1.StatefulSet, error)

func ParseMainWorkload

func ParseMainWorkload(ctx context.Context, store GitStore) (client.Object, error)

func PromoteRollout

func PromoteRollout(ctx context.Context, cli client.Client, namespace, name string, full bool) (*rolloutsv1alpha1.Rollout, error)

copy from: https://github.com/argoproj/argo-rollouts/blob/v1.1.0/pkg/kubectl-argo-rollouts/cmd/promote/promote.go#L92 默认下一步,full则跳过所有

func StringsContain

func StringsContain(list []string, i string) bool

func StringsIn

func StringsIn(li []string, i string) bool

func TaskNameOf

func TaskNameOf(ref PathRef, taskname string) string

func UpdateContentImages

func UpdateContentImages(ctx context.Context, store GitStore, images []string, version string) error

func UpdateImage

func UpdateImage(template *corev1.PodTemplateSpec, images []string)

func UpdatedReourcesLimits

func UpdatedReourcesLimits(obj client.Object, suggestion ResourceSuggestion) bool

Types

type AppReplicas

type AppReplicas struct {
	Replicas *int32 `json:"replicas"`
}

type AppStoreDeployForm

type AppStoreDeployForm struct {
	Name         string            `json:"name" binding:"required"`
	Annotations  map[string]string `json:"annotations"`
	Labels       map[string]string `json:"labels"`
	RepoURL      string            `json:"repoURL" binding:"required"`      // 仓库index地址
	Chart        string            `json:"chart" binding:"required"`        // chart名称
	ChartVersion string            `json:"chartVersion" binding:"required"` // chart版本
	Values       json.RawMessage   `json:"values" binding:"required"`
}

type ApplicationHandler

type ApplicationHandler struct {
	BaseHandler
	ApplicationProcessor *ApplicationProcessor
	Agents               *agents.ClientSet
	Manifest             ManifestHandler
	Task                 *TaskHandler
	// self cluster cli
	ArgoCD *argo.Client
}

func MustNewApplicationDeployHandler

func MustNewApplicationDeployHandler(provider git.Provider, argocli *argo.Client, commonbase base.BaseHandler) *ApplicationHandler

func (*ApplicationHandler) Argohistory

func (h *ApplicationHandler) Argohistory(c *gin.Context)

@Tags Application @Summary 部署历史 @Description 部署历史 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "name" @Success 200 {object} handlers.ResponseStruct{Data=handlers.PageData{Data=[]ArgoHistory}} "history" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/argohistory [get] @Security JWT

func (*ApplicationHandler) BatchUpdateImages

func (h *ApplicationHandler) BatchUpdateImages(c *gin.Context)

@Tags Application @Summary 更新应用镜像并部署 @Description 更新部署镜像 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "应用名称,全部应用可设置为'_'" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/_/images [put] @Security JWT

func (*ApplicationHandler) Create

func (h *ApplicationHandler) Create(c *gin.Context)

@Tags Application @Summary 部署应用 @Description 应用部署 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications [post] @Security JWT

func (*ApplicationHandler) CreateAppstoreApp

func (h *ApplicationHandler) CreateAppstoreApp(c *gin.Context)

@Tags Application @Summary 应用商店部署 @Description 应用商店部署 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param body body AppStoreDeployForm true "chart 部署信息" @Success 200 {object} handlers.ResponseStruct{Data=[]DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/appstoreapplications [post] @Security JWT

func (*ApplicationHandler) CreateBatch

func (h *ApplicationHandler) CreateBatch(c *gin.Context)

@Tags Application @Summary 批量部署应用 @Description 批量部署应用 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param body body []DeploiedManifest true "body" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications-batch [post] @Security JWT

func (*ApplicationHandler) DeleteArgoResource

func (h *ApplicationHandler) DeleteArgoResource(c *gin.Context)

@Tags Application @Summary argo资源 @Description argo资源 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "appname" @params name query string "resourcename" @params group query string "group" @params version query string "version" @params namespace query string "namespace" @params kind query string "kind" @Success 200 {object} handlers.ResponseStruct{Data=string} "history" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/argoresource [delete] @Security JWT

func (*ApplicationHandler) DeleteHPA

func (h *ApplicationHandler) DeleteHPA(c *gin.Context)

@Tags Application @Summary 应用编排HPA @Description 应用编排中HPA @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=HPAMetrics} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/hpa [delete] @Security JWT

func (*ApplicationHandler) DirectUpdateImage

func (h *ApplicationHandler) DirectUpdateImage(c *gin.Context)

@Tags Application @Summary 更新应用镜像 @Description 更新应用镜像 @Accept json @Produce json @Param tenant path string true "租户名称" @Param project path string true "项目名称" @param environment path string true "环境名称" @Param application path string true "应用名称" @Param image query string true "需要更新的完整镜像(会根据镜像名称寻找编排中相似的镜像并更新tag)" @Param version query string false "istio version to set" @Success 200 {object} handlers.ResponseStruct{Data=object} "status" @Router /tenants/{tenant}/projects/{project}/environments/{environment}/applications/{application}/images [post] @Security JWT

func (*ApplicationHandler) EnableStrategyDeployment

func (h *ApplicationHandler) EnableStrategyDeployment(c *gin.Context)
@Tags			StrategyDeployment
@Summary		使用更新策略更新应用
@Description	使用更新策略更新应用
@Accept			json
@Produce		json
@Param			tenant_id		path		int													true	"tenaut id"
@Param			project_id		path		int													true	"project id"
@param			environment_id	path		int													true	"environment id"
@Param			name			path		string												true	"applicationname"
@Param			body			body		DeploymentStrategyWithImages						true	"reqbody"
@Success		200				{object}	handlers.ResponseStruct{Data=DeploymentStrategy}	"-"
@Router			/v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/strategydeploy [post]
@Security		JWT

开始灰度发布流程 灰度发布流程目前有如下几种: - 滚动更新,deployment rollingupdate 策略。 - 重新创建,deployment recreated 策略。 - 灰度发布,rollout canary 策略。 - 蓝绿发布,rollout bluegreen 策略。

func (*ApplicationHandler) Get

func (h *ApplicationHandler) Get(c *gin.Context)

@Tags Application @Summary 应用部署 @Description 应用部署 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name} [get] @Security JWT

func (*ApplicationHandler) GetAppstoreApp

func (h *ApplicationHandler) GetAppstoreApp(c *gin.Context)

@Tags Application @Summary 应用商店应用 @Description 应用商店应用 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/appstoreapplications/{name} [get] @Security JWT

func (*ApplicationHandler) GetArgoResource

func (h *ApplicationHandler) GetArgoResource(c *gin.Context)

@Tags Application @Summary argo资源 @Description argo资源 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "appname" @params name query string "resourcename" @params group query string "group" @params version query string "version" @params kind query string "kind" @Success 200 {object} handlers.ResponseStruct{Data=string} "history" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/argoresource [get] @Security JWT

func (*ApplicationHandler) GetHPA

func (h *ApplicationHandler) GetHPA(c *gin.Context)

@Tags Application @Summary 应用编排中HPA @Description 应用编排中HPA @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=HPAMetrics} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/hpa [get] @Security JWT

func (*ApplicationHandler) GetImages

func (h *ApplicationHandler) GetImages(c *gin.Context)

@Tags Application @Summary 更新应用镜像并部署 @Description 更新部署镜像 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "应用名称" @Param body body DeployImages true "更新参数" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/images [get] @Security JWT

func (*ApplicationHandler) GetReplicas

func (h *ApplicationHandler) GetReplicas(c *gin.Context)

@Tags Application @Summary 应用编排中副本数scale(包含运行时调整) @Description 应用编排中副本数scale @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param name query string true "workload name" @Param replicas query string true "scale replicas" @Success 200 {object} handlers.ResponseStruct{Data=AppReplicas} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/replicas [get] @Security JWT

func (*ApplicationHandler) GetStrategyDeployment

func (h *ApplicationHandler) GetStrategyDeployment(c *gin.Context)
@Tags			StrategyDeployment
@Summary		获取当前的应用更新策略
@Description	获取部署
@Accept			json
@Produce		json
@Param			tenant_id		path		int															true	"tenautid"
@Param			project_id		path		int															true	"proid"
@param			environment_id	path		int															true	"envid"
@Param			name			path		string														true	"applicationname"
@Success		200				{object}	handlers.ResponseStruct{Data=DeploymentStrategyWithImages}	"deploy"
@Router			/v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/strategydeploy [get]
@Security		JWT

通过 argo app 将部署策略设置至,在sync是根据策略进行修改或者 rollout创建

func (*ApplicationHandler) GitDiff

func (h *ApplicationHandler) GitDiff(c *gin.Context)

@Tags Application @Summary 应用编排文件diff @Description 应用编排文件diff @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param hash query string true "gitcommit hash" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/gitdiff [get] @Security JWT

func (*ApplicationHandler) GitLog

func (h *ApplicationHandler) GitLog(c *gin.Context)

@Tags Application @Summary 应用编排文件历史 @Description 应用编排文件历史 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=[]FileContent} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/gitlog [get] @Security JWT

func (*ApplicationHandler) GitPull

func (h *ApplicationHandler) GitPull(c *gin.Context)

@Tags Application @Summary 应用编排文件刷新 @Description 应用编排文件刷新(git pull) @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param hash query string true "gitcommit hash" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/gitpull [post] @Security JWT

func (*ApplicationHandler) GitRevert

func (h *ApplicationHandler) GitRevert(c *gin.Context)

@Tags Application @Summary 应用编排文件回滚 @Description 应用编排文件回滚 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param hash query string true "gitcommit hash" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/gitrevert [post] @Security JWT

func (*ApplicationHandler) ImageHistory

func (h *ApplicationHandler) ImageHistory(c *gin.Context)

@Tags Application @Summary 镜像历史 @Description 镜像历史(生成镜像跟踪功能数据) @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "name" @Success 200 {object} handlers.ResponseStruct{Data=string} "history" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/imagehistory [get] @Security JWT

func (*ApplicationHandler) List

func (h *ApplicationHandler) List(c *gin.Context)

@Tags Application @Summary 应用列表 @Description 应用列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Success 200 {object} handlers.ResponseStruct{Data=[]DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications [get] @Security JWT

func (*ApplicationHandler) ListAnalysisTemplate

func (h *ApplicationHandler) ListAnalysisTemplate(c *gin.Context)

@Tags StrategyDeployment @Summary 获取支持的灰度分析 @Description 获取支持的灰度分析 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "applicationname" @param environment_id path int true "environment id" @Success 200 {object} handlers.ResponseStruct{Data=[]rolloutsv1alpha1.ClusterAnalysisTemplate} "-" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/analysistemplate [get] @Security JWT

func (*ApplicationHandler) ListAppstoreApp

func (h *ApplicationHandler) ListAppstoreApp(c *gin.Context)

@Tags Application @Summary 应用商店应用列表 @Description 应用商店应用列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Success 200 {object} handlers.ResponseStruct{Data=[]DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/appstoreapplications [get] @Security JWT

func (*ApplicationHandler) ListFiles

func (h *ApplicationHandler) ListFiles(c *gin.Context)

@Tags Application @Summary 列举文件 @Description 应用编排内容 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=[]FileContent} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/application/{name}/files [get] @Security JWT

func (*ApplicationHandler) ListImages

func (h *ApplicationHandler) ListImages(c *gin.Context)

@Tags Application @Summary 应用部署镜像 @Description 部署镜像 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "应用名称,全部应用可设置为'_'" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/_/images [get] @Security JWT

func (*ApplicationHandler) ListRelatedService

func (h *ApplicationHandler) ListRelatedService(c *gin.Context)

@Tags Application @Summary 获取对应的服务信息 @Description 获取对应的服务信息 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "applicationname" @Success 200 {object} handlers.ResponseStruct{Data=RelatedService} "-" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/services [get] @Security JWT

func (*ApplicationHandler) LocalAndRemoteCliFunc

func (h *ApplicationHandler) LocalAndRemoteCliFunc(c *gin.Context, body interface{}, fun LocalAndRemoteStoreFunc, msg string)

func (*ApplicationHandler) LocalCliFunc

func (h *ApplicationHandler) LocalCliFunc(c *gin.Context, body interface{}, fun LocalStoreFunc, msg string)

func (*ApplicationHandler) PutFile

func (h *ApplicationHandler) PutFile(c *gin.Context)

@Tags Application @Summary 写入文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param filename path string true "file name" @Param body body string true "filecontent" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/files/{filename} [put] @Security JWT

func (*ApplicationHandler) PutFiles

func (h *ApplicationHandler) PutFiles(c *gin.Context)

@Tags Application @Summary 写入多个文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Param filename path string true "file name" @Param msg query string true "commit mesage" @Param body body []FileContent true "files" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/files [put] @Security JWT

func (*ApplicationHandler) RegistRouter

func (h *ApplicationHandler) RegistRouter(rg *gin.RouterGroup) error

nolint: lll,funlen

func (*ApplicationHandler) RemoteCliFunc

func (h *ApplicationHandler) RemoteCliFunc(c *gin.Context, body interface{}, fun RemoteStoreFunc)

func (*ApplicationHandler) Remove

func (h *ApplicationHandler) Remove(c *gin.Context)

@Tags Application @Summary 删除应用 @Description 删除应用 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=string} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name} [delete] @Security JWT

func (*ApplicationHandler) RemoveAppstoreApp

func (h *ApplicationHandler) RemoveAppstoreApp(c *gin.Context)

@Tags Application @Summary 应用商店应用列表 @Description 应用商店应用列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=[]DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/appstoreapplications [delete] @Security JWT

func (*ApplicationHandler) RemoveFile

func (h *ApplicationHandler) RemoveFile(c *gin.Context)

@Tags Application @Summary 删除文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param filename path string true "file name" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/files/{filename} [delete] @Security JWT

func (*ApplicationHandler) ResourceTree

func (h *ApplicationHandler) ResourceTree(c *gin.Context)

@Tags Application @Summary 资源树实时状态(List/Watch) @Description 资源树实时状态 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "envid" @Param name path string true "应用名称,应用商店名称" @param watch query bool false "true"// 是否watch @Success 200 {object} handlers.ResponseStruct{Data=ArgoResourceTree} "summary" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/resourcetree [get] @Security JWT

func (*ApplicationHandler) SetHPA

func (h *ApplicationHandler) SetHPA(c *gin.Context)

@Tags Application @Summary 应用编排中HPA @Description 应用编排中HPA @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param body body HPAMetrics true "hpa metrics" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/hpa [post] @Security JWT

func (*ApplicationHandler) SetReplicas

func (h *ApplicationHandler) SetReplicas(c *gin.Context)

@Tags Application @Summary 应用编排中副本数scale(包含运行时调整) @Description 应用编排中副本数scale @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param name query string true "workload name" @Param body body AppReplicas true "scale replicas,body优先" @Param replicas query string true "scale replicas,如果body不存在值则使用该值" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/replicas [post] @Security JWT

func (*ApplicationHandler) StrategyDeploymentControl

func (h *ApplicationHandler) StrategyDeploymentControl(c *gin.Context)

@Tags StrategyDeployment @Summary 更新过程中的控制 @Description 更新控制 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "applicationname" @param body body StrategyDeploymentControl true "command" @Success 200 {object} handlers.ResponseStruct{Data=object} "-" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/application/{name}/strategydeploycontrol [post] @Security JWT

func (*ApplicationHandler) StrategyDeploymentStatus

func (h *ApplicationHandler) StrategyDeploymentStatus(c *gin.Context)

@Tags StrategyDeployment @Summary 更新过程中的实时状态 @Description 更新中的实时状态 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "applicationname" @param watch query bool false "watch 则返回 ssevent" @Success 200 {object} handlers.ResponseStruct{Data=rollout.RolloutInfo} "-" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/application/{name}/strategydeploystatus [get] @Security JWT

func (*ApplicationHandler) SwitchStrategy

func (h *ApplicationHandler) SwitchStrategy(c *gin.Context)

SwitchStrategy 用于在不同类型的发布策略中切换,切换时创建异步任务

func (*ApplicationHandler) Sync

func (h *ApplicationHandler) Sync(c *gin.Context)

@Tags Application @Summary Sync同步 @Description Sync同步 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @param environment_id path int true "environment id" @Param name path string true "name" @Param body body SyncRequest false "指定需要同步的资源,否则全部同步" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/sync [post] @Security JWT

func (*ApplicationHandler) UpdateImages

func (h *ApplicationHandler) UpdateImages(c *gin.Context)

@Tags Application @Summary 更新应用镜像并部署 @Description 更新部署镜像 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "应用名称" @Param body body DeployImages true "更新参数" @Success 200 {object} handlers.ResponseStruct{Data=DeploiedManifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/images [put] @Security JWT

func (*ApplicationHandler) UpdateWorkloadResources

func (h *ApplicationHandler) UpdateWorkloadResources(c *gin.Context)

@Tags Application @Summary 更新资源建议至 gitrepo @Description 更新资源建议至 gitrepo @Accept json @Produce json @Param cluster path string true "-" @Param group path string true "-" @Param version path string true "-" @param namespace path string true "-" @Param resource path string true "-" @Param name path string true "-" @Success 200 {object} handlers.ResponseStruct{Data=object} "-" @Router /v1/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [patch] @Security JWT

type ApplicationProcessor

type ApplicationProcessor struct {
	Agents   *agents.ClientSet
	Argo     *argo.Client
	DataBase *DatabseProcessor
	Manifest *ManifestProcessor
	Task     *TaskProcessor
	// contains filtered or unexported fields
}

func NewApplicationProcessor

func NewApplicationProcessor(db *database.Database, gitp git.Provider, argo *argo.Client, tp *TaskProcessor, agents *agents.ClientSet) *ApplicationProcessor

func (*ApplicationProcessor) BatchUpdateImages

func (p *ApplicationProcessor) BatchUpdateImages(ctx context.Context, ref PathRef, args []UpdateImageArgs) error

func (*ApplicationProcessor) Create

func (h *ApplicationProcessor) Create(ctx context.Context, ref PathRef) error

func (*ApplicationProcessor) CreateBatch

func (h *ApplicationProcessor) CreateBatch(ctx context.Context, baseref PathRef, names []string) error

func (*ApplicationProcessor) CreateIfNotExist

func (p *ApplicationProcessor) CreateIfNotExist(ctx context.Context, cli GitStore, obj client.Object) error

func (*ApplicationProcessor) DeleteHorizontalPodAutoscaler

func (p *ApplicationProcessor) DeleteHorizontalPodAutoscaler(ctx context.Context, ref PathRef) error

func (*ApplicationProcessor) Get

func (*ApplicationProcessor) GetHorizontalPodAutoscaler

func (p *ApplicationProcessor) GetHorizontalPodAutoscaler(ctx context.Context, ref PathRef) (*v2beta2.HorizontalPodAutoscaler, error)

func (*ApplicationProcessor) GetReplicas

func (p *ApplicationProcessor) GetReplicas(ctx context.Context, ref PathRef) (*int32, error)

func (*ApplicationProcessor) List

func (*ApplicationProcessor) PrepareDeploymentStrategy

func (p *ApplicationProcessor) PrepareDeploymentStrategy(ctx context.Context, ref PathRef, strategy DeploymentStrategy) error

func (*ApplicationProcessor) PrepareDeploymentStrategyWithImages

func (p *ApplicationProcessor) PrepareDeploymentStrategyWithImages(
	ctx context.Context, ref PathRef, strategy DeploymentStrategyWithImages,
) error

func (*ApplicationProcessor) ProvideFuntions

func (p *ApplicationProcessor) ProvideFuntions() map[string]interface{}

ProvideFuntions 用于对异步任务框架指出所使用的方法

func (*ApplicationProcessor) Remove

func (h *ApplicationProcessor) Remove(ctx context.Context, ref PathRef) error

func (*ApplicationProcessor) SetHorizontalPodAutoscaler

func (p *ApplicationProcessor) SetHorizontalPodAutoscaler(ctx context.Context, ref PathRef, scalerMetrics HPAMetrics) error

func (*ApplicationProcessor) SetReplicas

func (p *ApplicationProcessor) SetReplicas(ctx context.Context, ref PathRef, replicas *int32) error

func (*ApplicationProcessor) Sync

func (*ApplicationProcessor) Undo

func (h *ApplicationProcessor) Undo(ctx context.Context, ref PathRef, targetrev string) error

func (*ApplicationProcessor) UpdateImages

func (p *ApplicationProcessor) UpdateImages(ctx context.Context, ref PathRef, images []string, version string) error

func (*ApplicationProcessor) WaitRollouts

func (p *ApplicationProcessor) WaitRollouts(ctx context.Context, ref PathRef) error

type ApplicationTask

type ApplicationTask struct {
	Name string        `json:"name"` // 应用名称
	Task workflow.Task `json:"task"` // 最新一次任务,如果不存在最新一次任务,则返回一个空任务
}

@Tags Application @Summary 应用列表的异步任务列表 @Description 应用列表的异步任务列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param names query string false "names,逗号','分隔,限制返回结果为这些name" @Success 200 {object} handlers.ResponseStruct{Data=[]ApplicationTask} "task status" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/_/tasks [get] @Security JWT

type ArgoHistory

type ArgoHistory struct {
	ID          string      `json:"id,omitempty"`
	Name        string      `json:"name,omitempty"`
	Environment string      `json:"environment,omitempty"`
	Tenant      string      `json:"tenant,omitempty"`
	Images      []string    `json:"images,omitempty"`     // 发布的镜像
	Status      string      `json:"status,omitempty"`     // 如果发布,有发布的状态,从argocd取得
	GitVersion  string      `json:"gitVersion,omitempty"` // 如果发布,有发布的 gitversion(commmit) commitid or branchname
	Publisher   string      `json:"publisher"`            // 如果发布,有发布人
	PublishAt   metav1.Time `json:"publishAt"`            // 如果发布,有发布时间 gitcommit 时间
}

type ArgoResourceDiff

type ArgoResourceDiff struct {
	Group               string      `json:"group"`
	Kind                string      `json:"kind"`
	Namespace           string      `json:"namespace"`
	Name                string      `json:"name"`
	TargetState         interface{} `json:"targetState"`
	LiveState           interface{} `json:"liveState"`
	Diff                interface{} `json:"diff"` // Diff contains the JSON patch between target and live resource
	Hook                bool        `json:"hook"`
	NormalizedLiveState interface{} `json:"normalizedLiveState"`
	PredictedLiveState  interface{} `json:"predictedLiveState"`
}

type ArgoResourceNode

type ArgoResourceNode struct {
	v1alpha1.ResourceNode
	Sync string `json:"sync,omitempty"`
}

type ArgoResourceTree

type ArgoResourceTree struct {
	ArgoResourceNode
	Children  []*ArgoResourceTree `json:"children,omitempty"`
	LiveState interface{}         `json:"liveState,omitempty"`
}

ResourceTree 跟节点是 argoapp

type BaseHandler

type BaseHandler struct {
	base.BaseHandler
	// contains filtered or unexported fields
}

func (*BaseHandler) BindNameRefFunc

func (h *BaseHandler) BindNameRefFunc(c *gin.Context, ref *PathRef) error

func (*BaseHandler) BindTenantProjectedRefFunc

func (h *BaseHandler) BindTenantProjectedRefFunc(c *gin.Context, ref *PathRef) error

func (*BaseHandler) DirectNamedRefFunc

func (h *BaseHandler) DirectNamedRefFunc(c *gin.Context, body interface{}, fun func(ctx context.Context, ref PathRef) (interface{}, error))

func (*BaseHandler) DirectRefNameFunc

func (h *BaseHandler) DirectRefNameFunc(c *gin.Context, ref *PathRef) error

func (*BaseHandler) MayBindEnvRefFunc

func (h *BaseHandler) MayBindEnvRefFunc(c *gin.Context, ref *PathRef) error

func (*BaseHandler) NamedRefFunc

func (h *BaseHandler) NamedRefFunc(c *gin.Context, body interface{}, fun func(ctx context.Context, ref PathRef) (interface{}, error))

func (*BaseHandler) NoNameRefFunc

func (h *BaseHandler) NoNameRefFunc(c *gin.Context, body interface{}, fun func(ctx context.Context, ref PathRef) (interface{}, error))

type BlueGreenDeploymentStrategy

type BlueGreenDeploymentStrategy struct {
	rolloutsv1alpha1.BlueGreenStrategy
}

type Cache

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

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, error)

func (*Cache) Set

func (c *Cache) Set(key string, value interface{})

type CanaryDeploymentStrategy

type CanaryDeploymentStrategy struct {
	ExtendCanaryStrategy
}

type ClusterNamespace

type ClusterNamespace struct {
	Cluster   string
	Namespace string
}

type CommitImageDetails

type CommitImageDetails struct {
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
	Creator   string      `json:"creator,omitempty"`
	Images    []string    `json:"images,omitempty"`
}

type Container

type Container struct {
	Name      string                      `json:"name,omitempty"`
	Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
}

type DatabseProcessor

type DatabseProcessor struct {
	DB *gorm.DB
}

func (*DatabseProcessor) GetEnvironmentWithCluster

func (p *DatabseProcessor) GetEnvironmentWithCluster(ref PathRef) (*EnvironmentDetails, error)

func (*DatabseProcessor) RemoveDeploy

func (p *DatabseProcessor) RemoveDeploy(ctx context.Context, ref PathRef, deploy DeploiedManifest) error

func (*DatabseProcessor) SyncDeploies

func (p *DatabseProcessor) SyncDeploies(ctx context.Context, ref PathRef, deploies []DeploiedManifest) error

SyncDeploies full sync current deploies to database Use git store as database instead of orm database on application, but sometimes database as data source from other component, so we need to sync it

func (*DatabseProcessor) SyncDeploy

func (p *DatabseProcessor) SyncDeploy(ctx context.Context, ref PathRef, deploy DeploiedManifest) error

type DeploiedHelm

type DeploiedHelm struct {
	HelmManifest `json:",inline"`
	Runtime      ManifestRuntime `json:"runtime"`
}

type DeploiedManifest

type DeploiedManifest struct {
	Manifest `json:",inline"`
	Runtime  ManifestRuntime `json:"runtime"`
}

func CompleteDeploiedManifestRuntime

func CompleteDeploiedManifestRuntime(app *v1alpha1.Application, status *DeploiedManifest) *DeploiedManifest

type DeployImage

type DeployImage struct {
	Running string `json:"running"` // 意为当前 argo 实际正在运行的版本
	Publish string `json:"publish"` // 意为需要更新到的版本,argo更新版本会失败,所以两个版本会存在差异
}

type DeployImages

type DeployImages struct {
	Name         string                  `json:"name"`
	IstioVersion string                  `json:"istioVersion"`
	Kind         string                  `json:"kind"`
	Images       map[string]*DeployImage `json:"images"`    // 当前准备发布的镜像(gitrepo 中)
	Published    bool                    `json:"published"` // 是否已经发布至 argo
	PublishAt    *metav1.Time            `json:"publishAt"` //
}

func ConvertDeploiedManifestToView

func ConvertDeploiedManifestToView(dm DeploiedManifest) DeployImages

func (*DeployImages) PublishImages

func (d *DeployImages) PublishImages() []string

type DeploymentStrategy

type DeploymentStrategy struct {
	Type      DeploymentStrategyType          `json:"type,omitempty" validate:"required"` // 更新策略: in(Recreate,RollingUpdate,Canary,BlueGreen)
	Canary    *CanaryDeploymentStrategy       `json:"canary,omitempty"`
	BlueGreen *BlueGreenDeploymentStrategy    `json:"blueGreen,omitempty"`
	Recreat   *RecreatDeploymentStrategy      `json:"recreat,omitempty"`
	Rolling   *appsv1.RollingUpdateDeployment `json:"rolling,omitempty"`
}

type DeploymentStrategyType

type DeploymentStrategyType string
const (
	RollingUpdateDeploymentStrategyType DeploymentStrategyType = DeploymentStrategyType(appsv1.RollingUpdateDeploymentStrategyType)
	RecreatDeploymentStrategyType       DeploymentStrategyType = DeploymentStrategyType(appsv1.RecreateDeploymentStrategyType)
	CanaryDeploymentStrategyType        DeploymentStrategyType = "Canary"
	BlueGreenDeploymentStrategyType     DeploymentStrategyType = "BlueGreen"
)

type DeploymentStrategyWithDeployment

type DeploymentStrategyWithDeployment struct {
	Strategy   DeploymentStrategy
	Deployment *appsv1.Deployment
}

func ParseUpdateStrategyAndDeployment

func ParseUpdateStrategyAndDeployment(ctx context.Context, store GitStore) (*DeploymentStrategyWithDeployment, error)

type DeploymentStrategyWithImages

type DeploymentStrategyWithImages struct {
	DeployImages
	Strategy DeploymentStrategy `json:"strategy,omitempty"`
}

type EnvironmentDetails

type EnvironmentDetails struct {
	ClusterName       string `json:"clusterName,omitempty"`
	ClusterKubeConfig []byte `json:"clusterKubeConfig,omitempty"`
	Namespace         string `json:"namespace,omitempty"`
	EnvironmentName   string `json:"environmentName,omitempty"`
	EnvironmentType   string `json:"environmentType,omitempty"`
}

type ExtendCanaryStrategy

type ExtendCanaryStrategy struct {
	rolloutsv1alpha1.CanaryStrategy
	// TrafficRouting hosts all the supported service meshes supported to enable more fine-grained traffic routing
	TrafficRouting *RolloutTrafficRouting `json:"trafficRouting,omitempty" protobuf:"bytes,4,opt,name=trafficRouting"`
}

ExtendCanaryStrategy 用于扩展原canary策略中 virtualservice 匹配的字段

func ExtendCanaryStrategyFromCanaryStrategy

func ExtendCanaryStrategyFromCanaryStrategy(from *rolloutsv1alpha1.CanaryStrategy) *ExtendCanaryStrategy

func (*ExtendCanaryStrategy) ToCanaryStrategy

func (s *ExtendCanaryStrategy) ToCanaryStrategy() *rolloutsv1alpha1.CanaryStrategy

type FileContent

type FileContent struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

type FsStore

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

func NewGitFsStore

func NewGitFsStore(fs billy.Filesystem) *FsStore

NewGitFsStore 是一个代价比较高的操作

func (*FsStore) Create

func (c *FsStore) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*FsStore) Delete

func (c *FsStore) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*FsStore) DeleteAllOf

func (c *FsStore) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

func (*FsStore) Get

func (c *FsStore) Get(ctx context.Context, key client.ObjectKey, into client.Object) error

func (*FsStore) List

func (c *FsStore) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

func (*FsStore) ListAll

func (c *FsStore) ListAll(ctx context.Context) ([]client.Object, error)

func (*FsStore) Patch

func (c *FsStore) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*FsStore) RESTMapper

func (c *FsStore) RESTMapper() meta.RESTMapper

RESTMapper returns the rest this client is using.

func (*FsStore) Scheme

func (c *FsStore) Scheme() *runtime.Scheme

Scheme returns the scheme this client is using.

func (*FsStore) Status

func (c *FsStore) Status() client.StatusWriter

func (*FsStore) Update

func (c *FsStore) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type GVKN

type GVKN struct {
	Group   string `json:"group,omitempty" uri:"group"`
	Version string `json:"version,omitempty" uri:"version"`
	Kind    string `json:"kind,omitempty" uri:"kind"`
	Name    string `json:"name,omitempty" uri:"resourcename"`
}

func (GVKN) GVK

func (g GVKN) GVK() schema.GroupVersionKind

type GitLog

type GitLog struct {
	Hash      string `json:"hash,omitempty"`
	Message   string `json:"message,omitempty"`
	Author    string `json:"author,omitempty"`
	Timestamp string `json:"timestamp,omitempty"`
}

type GitStore

type GitStore = *FsStore

type HPAMetrics

type HPAMetrics struct {
	MinReplicas *int32 `json:"min_replicas" binding:"required,gte=1"`
	MaxReplicas int32  `json:"max_replicas" binding:"required"`
	Cpu         int32  `json:"cpu" binding:"lte=100"`
	Memory      int32  `json:"memory" binding:"lte=100"`
}

type HarborFunc

type HarborFunc func(ctx context.Context, cli *harbor.Client, image string) (interface{}, error)

type HelmManifest

type HelmManifest struct {
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	Kind         string      `json:"kind"`
	Creator      string      `json:"creator"`
	CreateAt     metav1.Time `json:"createAt"`
	RepoURL      string      `json:"repoURL"`      // 仓库index地址
	Chart        string      `json:"chart"`        // chart名称
	ChartVersion string      `json:"chartVersion"` // chart版本
	Values       string      `json:"values"`
}

type ImageDetails

type ImageDetails struct {
	Running string // 意为当前 argo 实际正在运行的版本
	Publish string // 意为需要更新到的版本,argo更新版本会失败,所以两个版本会存在差异
}

type ImageHandler

type ImageHandler struct {
	BaseHandler
}

func (*ImageHandler) ImageTags

func (h *ImageHandler) ImageTags(c *gin.Context)

@Tags ProjectImage @Summary 镜像tags @Description 查询镜像tags @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param application_id path int true "application id" @Param image query string true "eg. kubegems/nginx:v1.14" @Success 200 {object} handlers.ResponseStruct{Data=vuln.Report} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/images/tags [post] @Security JWT

func (*ImageHandler) OnHarborFunc

func (h *ImageHandler) OnHarborFunc(c *gin.Context, harborfun HarborFunc, ocifunc OCIFunc)

func (*ImageHandler) Scan

func (h *ImageHandler) Scan(c *gin.Context)

@Tags ProjectImage @Summary 镜像扫描 @Description 触发镜像扫描 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param image query string true "eg. kubegems/nginx:v1.14" @Success 200 {object} handlers.ResponseStruct{Data=vuln.Report} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/images/scan [post] @Security JWT

func (*ImageHandler) Summary

func (h *ImageHandler) Summary(c *gin.Context)

@Tags ProjectImage @Summary 镜像summary @Description 镜像summary @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param image query string true "eg. kubegems/nginx:v1.14" @Success 200 {object} handlers.ResponseStruct{Data=vuln.Report} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/images/summary [get] @Security JWT

func (*ImageHandler) Unpublishable

func (h *ImageHandler) Unpublishable(c *gin.Context)

@Tags ProjectImage @Summary 镜像不可发布标记 @Description 镜像不可发布标记 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param image query string true "eg. kubegems/nginx:v1.14" @Success 200 {object} handlers.ResponseStruct{Data=vuln.Report} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/images/unpublishable [get] @Security JWT

func (*ImageHandler) Vulnerabilities

func (h *ImageHandler) Vulnerabilities(c *gin.Context)

@Tags ProjectImage @Summary 镜像安全报告 @Description 镜像安全报告 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param image query string true "eg. kubegems/nginx:v1.14" @Success 200 {object} handlers.ResponseStruct{Data=vuln.Report} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/images/vulnerabilities [get] @Security JWT

type ImageHistory

type ImageHistory struct {
	ID          string      `json:"id,omitempty"`
	Image       string      `json:"image,omitempty"`
	PublishAt   metav1.Time `json:"publishAt,omitempty"`
	Publisher   string      `json:"publisher,omitempty"`
	Environment string      `json:"environment,omitempty"` // 环境名称
	Type        string      `json:"type"`                  // 环境类型
}

type ImageSummaryItem

type ImageSummaryItem struct {
	Image            string         `json:"image,omitempty"`
	IsHarborRegistry bool           `json:"isHarborRegistry,omitempty"` // 是否为受集群管理的镜像仓库且为 harbor 仓库
	ScanStatus       string         `json:"scanStatus,omitempty"`       // 扫描状态
	Severity         vuln.Severity  `json:"severity,omitempty"`         // 从低到高依次为 "None""Unknown" "Negligible" "Low""Medium""High""Critical"
	Report           interface{}    `json:"report,omitempty"`           // harbor 报告原文: {"fixable": 122,"summary": {"Critical": 3,"High": 10,"Low": 61,"Medium": 125},"total": 199}
	Unpublishable    bool           `json:"unpublishable,omitempty"`    // 不可发布状态,若为true则不可发布
	Labels           []harbor.Label `json:"labels,omitempty"`           // harbor 标签
	Status           string         `json:"status,omitempty"`
	UpdatedAt        *metav1.Time   `json:"updatedAt,omitempty"` // time.Time.Format(RFC3339) 格式,若非可管理仓库则为空
}

type ImageTag

type ImageTag struct {
	TagName       string `json:"name"`
	Image         string `json:"image"`
	Unpublishable bool   `json:"unpublishable"` // 不可发布
}

type IngressPorts

type IngressPorts struct {
	IngressClassName *string `json:"ingressClassName"`
	Host             string  `json:"host"`
	IngressPort      int     `json:"ingressPort"`
	ServicePort      string  `json:"servicePort"`
}

type IstioTrafficRouting

type IstioTrafficRouting struct {
	rolloutsv1alpha1.IstioTrafficRouting
	// VirtualService references an Istio VirtualService to modify to shape traffic
	VirtualService IstioVirtualService `json:"virtualService" protobuf:"bytes,1,opt,name=virtualService"`
}

type IstioVirtualService

type IstioVirtualService struct {
	rolloutsv1alpha1.IstioVirtualService
	Uri           *istionetworkingv1alpha3.StringMatch            `json:"uri,omitempty"`
	Headers       map[string]*istionetworkingv1alpha3.StringMatch `json:"headers,omitempty"`
	IgnoreUriCase bool                                            `json:"ignoreUriCase,omitempty"`
}

根据header进行灰度

type LocalAndRemoteStoreFunc

type LocalAndRemoteStoreFunc func(ctx context.Context, local GitStore, remote agents.Client, namespace string, ref PathRef) (interface{}, error)

type LocalStoreFunc

type LocalStoreFunc func(ctx context.Context, store GitStore, ref PathRef) (interface{}, error)

type Manifest

type Manifest struct {
	Name         string            `json:"name"`
	Description  string            `json:"description"`
	Kind         string            `json:"kind"`
	Images       []string          `json:"images"`
	Creator      string            `json:"creator"`
	CreateAt     metav1.Time       `json:"createAt"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	Ref          PathRef           `json:"ref"`
	IstioVersion string            `json:"istioVersion"`
}

type ManifestDeploy

type ManifestDeploy struct {
	Cluster   string
	Namespace string
	Name      string
	Contents  []unstructured.Unstructured
}

type ManifestHandler

type ManifestHandler struct {
	BaseHandler
	*ManifestProcessor
}

func (*ManifestHandler) CreateManifest

func (h *ManifestHandler) CreateManifest(c *gin.Context)

@Tags ApplicationManifest @Summary 创建应用编排 @Description 只创建一个空的应用没有内容文件 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param body body Manifest true "project meta" @Success 200 {object} handlers.ResponseStruct{Data=Manifest} "Application" @Router /v1/tenant/{tenaut_id}/project/{project_id}/manifests [post] @Security JWT

func (*ManifestHandler) CreateResource

func (h *ManifestHandler) CreateResource(c *gin.Context)

func (*ManifestHandler) DeleteResource

func (h *ManifestHandler) DeleteResource(c *gin.Context)

func (*ManifestHandler) GetManifest

func (h *ManifestHandler) GetManifest(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排详情 @Description 应用编排详情 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "application name" @Success 200 {object} handlers.ResponseStruct{Data=Manifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name} [get] @Security JWT

func (*ManifestHandler) GetResource

func (h *ManifestHandler) GetResource(c *gin.Context)

func (*ManifestHandler) GitDiff

func (h *ManifestHandler) GitDiff(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排文件diff @Description 应用编排文件diff @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "application name" @Param hash query string true "gitcommit hash" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/gitdiff [get] @Security JWT

func (*ManifestHandler) GitLog

func (h *ManifestHandler) GitLog(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排文件历史 @Description 应用编排文件历史 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Success 200 {object} handlers.ResponseStruct{Data=[]GitLog} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/gitlog [get] @Security JWT

func (*ManifestHandler) GitPull

func (h *ManifestHandler) GitPull(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排文件刷新 @Description 应用编排文件刷新(git pull) @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "application name" @Param hash query string true "gitcommit hash" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/gitpull [post] @Security JWT

func (*ManifestHandler) GitRevert

func (h *ManifestHandler) GitRevert(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排文件回滚 @Description 回滚应用编排文件 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "application name" @Param hash query string true "gitcommit hash to rollback" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/gitrevert [get] @Security JWT

func (*ManifestHandler) ListFiles

func (h *ManifestHandler) ListFiles(c *gin.Context)

@Tags ApplicationManifest @Summary 列举文件 @Description 应用编排内容 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Success 200 {object} handlers.ResponseStruct{Data=[]FileContent} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/files [get] @Security JWT

func (*ManifestHandler) ListManifest

func (h *ManifestHandler) ListManifest(c *gin.Context)

@Tags ApplicationManifest @Summary 应用编排列表 @Description 应用编排列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Success 200 {object} handlers.ResponseStruct{Data=[]Manifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests [get] @Security JWT

func (*ManifestHandler) ListManifestAdmin

func (h *ManifestHandler) ListManifestAdmin(c *gin.Context)

@Tags ApplicationManifest @Summary admim查询所有应用编排列表 @Description 应用编排列表 @Accept json @Produce json @Success 200 {object} handlers.ResponseStruct{Data=[]Manifest} "Application" @Router /v1/tenant/_/project/_/manifests [get] @Security JWT

func (*ManifestHandler) ListResource

func (h *ManifestHandler) ListResource(c *gin.Context)

func (*ManifestHandler) Metas

func (h *ManifestHandler) Metas(c *gin.Context)

@Tags Application @Summary 应用内容类型摘要 @Description 对应用内所有资源进行列举,用于自动补全 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param application_id path int true "application id" @param environment_id path int true "environment id" @Param name path string true "name" @Param kind query string false "若设置,则仅显示设置的类型,例如 Deployment,StatefulSet,Job,ConfigMap" @Success 200 {object} handlers.ResponseStruct{Data=[]object} "类型信息" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/metas [get] @Security JWT

func (*ManifestHandler) PutFile

func (h *ManifestHandler) PutFile(c *gin.Context)

@Tags ApplicationManifest @Summary 写入文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Param filename path string true "file name" @Param body body FileContent true "filecontent" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/files/{filename} [put] @Security JWT

func (*ManifestHandler) PutFiles

func (h *ManifestHandler) PutFiles(c *gin.Context)

@Tags ApplicationManifest @Summary 写入多个文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Param filename path string true "file name" @Param msg query string true "commit mesage" @Param body body []FileContent true "files" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/files [put] @Security JWT

func (*ManifestHandler) RemoveFile

func (h *ManifestHandler) RemoveFile(c *gin.Context)

@Tags ApplicationManifest @Summary 删除文件 @Description 修改应用编排 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Param filename path string true "file name" @Success 200 {object} handlers.ResponseStruct{Data=string} "ok" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name}/files/{filename} [delete] @Security JWT

func (*ManifestHandler) RemoveManifest

func (h *ManifestHandler) RemoveManifest(c *gin.Context)

@Tags ApplicationManifest @Summary 删除创建应用编排 @Description 删除创建应用编排以及git内容 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "name" @Success 200 {object} handlers.ResponseStruct{Data=string} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name} [delete] @Security JWT

func (*ManifestHandler) UpdateManifest

func (h *ManifestHandler) UpdateManifest(c *gin.Context)

@Tags ApplicationManifest @Summary 修改应用编排描述 @Description 修改应用编排描述 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param name path string true "application name" @Param body body Manifest true "project meta" @Success 200 {object} handlers.ResponseStruct{Data=Manifest} "Application" @Router /v1/tenant/{tenant_id}/project/{project_id}/manifests/{name} [put] @Security JWT

func (*ManifestHandler) UpdateResource

func (h *ManifestHandler) UpdateResource(c *gin.Context)

type ManifestListOption

type ManifestListOption func(*ManifestListOptions)

func WithImages

func WithImages() ManifestListOption

type ManifestListOptions

type ManifestListOptions struct {
	WithImages bool // 解析资源中的镜像 和 istioVersion 更准确的kind等
}

type ManifestProcessor

type ManifestProcessor struct {
	GitProvider git.Provider
}

func NewManifestProcessor

func NewManifestProcessor(GitProvider *git.SimpleLocalProvider) (*ManifestProcessor, error)

func (*ManifestProcessor) ContentFunc

func (*ManifestProcessor) Create

func (h *ManifestProcessor) Create(ctx context.Context, ref PathRef, manifest Manifest) error

func (*ManifestProcessor) Func

func (h *ManifestProcessor) Func(ctx context.Context, ref PathRef, funcs ...RepositoryFunc) error

using ContentFunc StoreFunc instead of directly calling

func (*ManifestProcessor) Get

func (h *ManifestProcessor) Get(ctx context.Context, ref PathRef) (*Manifest, error)

func (*ManifestProcessor) List

func (h *ManifestProcessor) List(ctx context.Context, ref PathRef, options ...ManifestListOption) ([]Manifest, error)

func (*ManifestProcessor) Remove

func (h *ManifestProcessor) Remove(ctx context.Context, ref PathRef) error

func (*ManifestProcessor) StoreFunc

func (h *ManifestProcessor) StoreFunc(ctx context.Context, ref PathRef, fun func(ctx context.Context, store GitStore) error) error

func (*ManifestProcessor) StoreUpdateFunc

func (h *ManifestProcessor) StoreUpdateFunc(ctx context.Context, ref PathRef, fun func(ctx context.Context, store GitStore) error, commitmsg string) error

func (*ManifestProcessor) Update

func (h *ManifestProcessor) Update(ctx context.Context, ref PathRef, manifest Manifest) error

func (*ManifestProcessor) UpdateContentFunc

func (h *ManifestProcessor) UpdateContentFunc(ctx context.Context, ref PathRef, fun RepositoryFileSystemFunc, commitmsg string) error

type ManifestRuntime

type ManifestRuntime struct {
	Status       string            `json:"status"` // 运行时状态
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	Kind         string            `json:"kind"`         // 运行时负载类型
	WorkloadName string            `json:"workloadName"` // 运行时
	Images       []string          `json:"images"`       // 运行时镜像
	Message      string            `json:"message"`      // 运行时消息提示
	CreateAt     metav1.Time       `json:"createAt"`     // 运行时创建时间
	Creator      string            `json:"creator"`      // 运行时创建人
	Raw          interface{}       `json:"raw"`          // 运行时
	DeployStatus string            `json:"deployStatus"` // 异步部署的状态,取最新一个
	IstioVersion string            `json:"istioVersion"` // 运行时的 istio version
}

type OCIFunc

type OCIFunc func(ctx context.Context, cli *harbor.OCIDistributionClient, image string) (interface{}, error)

type PathRef

type PathRef struct {
	Tenant  string `json:"tenant,omitempty"`
	Project string `json:"project,omitempty"`
	Env     string `json:"environment,omitempty"`
	Name    string `json:"name,omitempty"`
}

PathRef 存储了从 租户项目环境应用 到 git仓库中的 group repo branch path的映射关系

func (*PathRef) DecodeFrom

func (p *PathRef) DecodeFrom(str string) error

func (PathRef) Encode

func (p PathRef) Encode() string

func (*PathRef) FromAnnotations

func (p *PathRef) FromAnnotations(annotations map[string]string)

func (*PathRef) FromArgoLabel

func (p *PathRef) FromArgoLabel(labels map[string]string)

func (*PathRef) FromJsonBase64

func (p *PathRef) FromJsonBase64(str string)

func (PathRef) FullName

func (p PathRef) FullName() string

FullName is the full name for the argo application

func (PathRef) GitBranch

func (p PathRef) GitBranch() string

func (PathRef) GitRef

func (p PathRef) GitRef() git.RepositoryRef

func (PathRef) IsEmpty

func (p PathRef) IsEmpty() bool

func (PathRef) JsonStringBase64

func (p PathRef) JsonStringBase64() string

func (PathRef) Path

func (p PathRef) Path() string

Path is where the manifests located in the repository

type PodSpec

type PodSpec struct {
	InitContainers      []Container `json:"initContainers,omitempty"`
	Containers          []Container `json:"containers"`
	EphemeralContainers []Container `json:"ephemeralContainers,omitempty"`
}

type PodTemplateSpec

type PodTemplateSpec struct {
	Spec PodSpec `json:"spec,omitempty"`
}

type RecreatDeploymentStrategy

type RecreatDeploymentStrategy struct {
	WaitShutdown bool `json:"waitShutdown,omitempty"` // 暂未使用
}

type RefCompleteFunc

type RefCompleteFunc func(*gin.Context, *PathRef) error

type RegistryOptions

type RegistryOptions struct {
	URL      string
	Username string
	Password string
}

type RelatedService

type RelatedService struct {
	ServiceIP    string               `json:"serviceIP"`
	Ports        []corev1.ServicePort `json:"ports"`
	IngressPorts []IngressPorts       `json:"ingresses"`
}

type RemoteStoreFunc

type RemoteStoreFunc func(ctx context.Context, remote agents.Client, namespace string, ref PathRef) (interface{}, error)

type Repository

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

func (*Repository) Diff

func (r *Repository) Diff(ctx context.Context, hash string) ([]git.FileDiff, error)

func (*Repository) FS

func (r *Repository) FS(ctx context.Context) (billy.Filesystem, error)

func (*Repository) HistoryFiles

func (r *Repository) HistoryFiles(ctx context.Context, hash string) (*git.Commit, error)

func (*Repository) HistoryFunc

func (r *Repository) HistoryFunc(ctx context.Context, fun git.ContentVistitFunc) error

type RepositoryFileSystemFunc

type RepositoryFileSystemFunc func(ctx context.Context, fs billy.Filesystem) error

func FSStoreFunc

func FSStoreFunc(funcs ...func(ctx context.Context, store GitStore) error) RepositoryFileSystemFunc

type RepositoryFunc

type RepositoryFunc func(ctx context.Context, repository Repository) error

func Commit

func Commit(msg string) RepositoryFunc

func FsFunc

func Pull

func Pull() RepositoryFunc

func Revert

func Revert(rev string) RepositoryFunc

func UpdateKustomizeCommit

func UpdateKustomizeCommit(msg string) RepositoryFunc

type ResourceSuggestion

type ResourceSuggestion struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ResourceSuggestionSpec `json:"spec,omitempty"`
}

func (*ResourceSuggestion) DeepCopyObject

func (r *ResourceSuggestion) DeepCopyObject() runtime.Object

type ResourceSuggestionSpec

type ResourceSuggestionSpec struct {
	Template PodTemplateSpec `json:"template"`
}

type RolloutTrafficRouting

type RolloutTrafficRouting struct {
	rolloutsv1alpha1.RolloutTrafficRouting
	// Istio holds Istio specific configuration to route traffic
	Istio *IstioTrafficRouting `json:"istio,omitempty" protobuf:"bytes,1,opt,name=istio"`
}

RolloutTrafficRouting hosts all the different configuration for supported service meshes to enable more fine-grained traffic routing

type StrategyDeploymentControl

type StrategyDeploymentControl struct {
	Command string                 `json:"command,omitempty"` // 指令名称 in(pause,restart,retry,promote,terminate,undo)
	Args    map[string]interface{} `json:"args,omitempty"`    // 一些指令可能会携带的参数,比如 undo {reversion=1} ; promote {full=true}
}

type SyncRequest

type SyncRequest struct {
	Resources []v1alpha1.SyncOperationResource `json:"resources,omitempty"`
}

type TaskHandler

type TaskHandler struct {
	BaseHandler
	Processor *TaskProcessor
}

func NewTaskHandler

func NewTaskHandler(base BaseHandler, tp *TaskProcessor) *TaskHandler

func (*TaskHandler) BatchList

func (h *TaskHandler) BatchList(c *gin.Context)

func (*TaskHandler) List

func (h *TaskHandler) List(c *gin.Context)

@Tags Application @Summary 应用异步任务 @Description 应用异步任务列表 @Accept json @Produce json @Param tenant_id path int true "tenaut id" @Param project_id path int true "project id" @Param environment_id path int true "environment_id" @Param name path string true "application name" @Param watch query string false "is watch sse ,sse key 为 'data'" @Param limit query int false "限制返回的条数,返回最新的n条记录" @Param type query string false "限制返回的任务类型,例如仅返回 部署镜像(update-image),切换模式(switch-strategy) 的任务" @Success 200 {object} handlers.ResponseStruct{Data=[]workflow.Task} "task status" @Router /v1/tenant/{tenant_id}/project/{project_id}/environment/{environment_id}/applications/{name}/tasks [get] @Security JWT

type TaskProcessor

type TaskProcessor struct {
	Workflowcli workflow.Client
}

func (*TaskProcessor) ListTasks

func (p *TaskProcessor) ListTasks(ctx context.Context, ref PathRef, typ string) ([]workflow.Task, error)

func (*TaskProcessor) SubmitTask

func (p *TaskProcessor) SubmitTask(ctx context.Context, ref PathRef, typ string, steps []workflow.Step) error

func (*TaskProcessor) WatchTasks

func (p *TaskProcessor) WatchTasks(ctx context.Context, ref PathRef,
	typ string, callback func(ctx context.Context, task *workflow.Task) error,
) error

type UpdateImageArgs

type UpdateImageArgs struct {
	Name         string   `json:"name"`
	Images       []string `json:"images,omitempty"`
	IstioVersion string   `json:"istioVersion,omitempty"`
}

Jump to

Keyboard shortcuts

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