Documentation
¶
Index ¶
- Constants
- type BaseParams
- type BaseValue
- type BaseValueTemplate
- type Chart
- type ClusterCommit
- type ClusterFiles
- type ClusterGitRepo
- type ClusterTemplate
- type ClusterValueFile
- type CreateClusterParams
- type Dependency
- type EnvValue
- type Git
- type PipelineOutput
- type ReadFileParam
- type RepoInfo
- type UpdateClusterParams
- type UpgradeValuesParamdeprecated
Constants ¶
View Source
const ( GitOpsBranch = "gitops" PipelineValueParent = "pipeline" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseParams ¶
type BaseParams struct { ClusterID uint Cluster string PipelineJSONBlob map[string]interface{} ApplicationJSONBlob map[string]interface{} TemplateRelease *trmodels.TemplateRelease Application *models.Application Environment string RegionEntity *regionmodels.RegionEntity Namespace string Version string }
type BaseValue ¶
type BaseValue struct { Application string `yaml:"application"` ClusterID uint `yaml:"clusterID"` Cluster string `yaml:"cluster"` Template *BaseValueTemplate `yaml:"template"` Priority string `yaml:"priority"` }
type BaseValueTemplate ¶
type Chart ¶
type Chart struct { APIVersion string `yaml:"apiVersion"` Name string `yaml:"name"` Version string `yaml:"version"` Dependencies []Dependency `yaml:"dependencies"` }
type ClusterCommit ¶
type ClusterFiles ¶
type ClusterGitRepo ¶
type ClusterGitRepo interface { GetCluster(ctx context.Context, application, cluster, templateName string) (*ClusterFiles, error) GetClusterValueFiles(ctx context.Context, application, cluster string) ([]ClusterValueFile, error) // GetClusterTemplate parses cluster's template name and release from GitopsFileChart GetClusterTemplate(ctx context.Context, application, cluster string) (*ClusterTemplate, error) CreateCluster(ctx context.Context, params *CreateClusterParams) error UpdateCluster(ctx context.Context, params *UpdateClusterParams) error DeleteCluster(ctx context.Context, application, cluster string, clusterID uint) error HardDeleteCluster(ctx context.Context, application, cluster string) error // CompareConfig compare config of `from` commit with `to` commit. // if `from` or `to` is nil, compare the master branch with gitops branch CompareConfig(ctx context.Context, application, cluster string, from, to *string) (string, error) // MergeBranch merge branch and return target branch's newest commit MergeBranch(ctx context.Context, application, cluster, sourceBranch, targetBranch string, pipelineRunID *uint) (_ string, err error) GetPipelineOutput(ctx context.Context, application, cluster string, template string) (interface{}, error) UpdatePipelineOutput(ctx context.Context, application, cluster, template string, pipelineOutput interface{}) (string, error) // UpdateRestartTime update restartTime in git repo for restart // TODO(gjq): some template cannot restart, for example serverless, how to do it ? GetRestartTime(ctx context.Context, application, cluster string, template string) (string, error) UpdateRestartTime(ctx context.Context, application, cluster, template string) (string, error) GetConfigCommit(ctx context.Context, application, cluster string) (*ClusterCommit, error) GetRepoInfo(ctx context.Context, application, cluster string) *RepoInfo GetEnvValue(ctx context.Context, application, cluster, templateName string) (*EnvValue, error) // Rollback rolls gitOps branch back to a specific commit if there are diffs Rollback(ctx context.Context, application, cluster, commit string) (string, error) UpdateTags(ctx context.Context, application, cluster, templateName string, tags []*tagmodels.Tag) error DefaultBranch() string // Deprecated: for internal usage, v1 to v2 UpgradeCluster(ctx context.Context, param *UpgradeValuesParam) (string, error) // GetManifest returns manifest with specific revision, defaults to gitops branch GetManifest(ctx context.Context, application, cluster string, commit *string) (*pkgcommon.Manifest, error) // CheckAndSyncGitOpsBranch checks and sync if gitops branch is not up-to-date with master branch // for internal usage CheckAndSyncGitOpsBranch(ctx context.Context, application, cluster, commit string) error // SyncGitOpsBranch syncs gitops branch to up-to-date with master branch SyncGitOpsBranch(ctx context.Context, application, cluster string) error }
nolint
func NewClusterGitlabRepo ¶
func NewClusterGitlabRepo(ctx context.Context, rootGroup *gitlab.Group, templateRepo templaterepo.TemplateRepo, gitlabLib gitlablib.Interface, defaultBranch string, defaultVisibility string) (ClusterGitRepo, error)
type ClusterTemplate ¶
type ClusterValueFile ¶
type ClusterValueFile struct { FileName string Content map[interface{}]interface{} }
type CreateClusterParams ¶
type CreateClusterParams struct { *BaseParams Tags []*tagmodels.Tag Image string }
type Dependency ¶
type PipelineOutput ¶
type ReadFileParam ¶
type UpdateClusterParams ¶
type UpdateClusterParams struct {
*BaseParams
}
type UpgradeValuesParam
deprecated
type UpgradeValuesParam struct { Application string Cluster string Template *ClusterTemplate TargetRelease *trmodels.TemplateRelease BuildConfig *template.BuildConfig }
Deprecated: for internal usage
Click to show internal directories.
Click to hide internal directories.